INITSLICERS
In dynamic reports, users are often able to choose which dimensions form the columns and rows, and which form the slice dimensions. And, in database-independent reports, which dimensions are available is unknown to the designer of the report. For this reason, the values of the slice dimensions are typically stored in an XML variable. If the report uses the tuple report parameter for communication in dashboards, the XML must be in a valid format.
The INITSLICERS function generates an XML slicer variable in the correct format to be used by the tuple report parameter.
You can validate the XML with the VALIDATESLICERS function.
Syntax
=INITSLICERS("cube_Olapmetadata_uniquename"
{,"omit_Olapmetadata_uniquename"})
Example
This example generates XML that excludes all but the Measure dimension of the Analysis cube:
=INITSLICERS("[repository].[bestpracticesolap].[analysis]","[repository].[bestpracticesolap].[analysis].[period]","[repository].[bestpracticesolap].[analysis].[pos]","[repository].[bestpracticesolap].[analysis].[product]","[repository].[bestpracticesolap].[analysis].[region]","[repository].[bestpracticesolap].[analysis].[channel]","[repository].[bestpracticesolap].[analysis].[valtype]")
This is the resultant XML:
<Table><Row
name="[Repository].[BestPracticesOLAP].[ANALYSIS].[MEASURE].[MEASURE]"><Property
name="element" value="[MEASURE].[Gross Margin]"
/></Row></Table>
Example
In cell B2, specify [repository].[bestpracticesolap].[analysis]
.
In cell B23, specify =INITSLICERS(B2)
.
The resulting XML includes all dimensions of the Analysis cube:
<Table><Row name="[Repository].[BestPracticesOLAP].[ANALYSIS].[CHANNEL].[CHANNEL]"><Property name="element"
value="[CHANNEL].[All Channels]" /></Row><Row
name="[Repository].[BestPracticesOLAP].[ANALYSIS].[MEASURE].[MEASURE]"><Property name="element"
value="[MEASURE].[Gross Margin]" /></Row><Row
name="[Repository].[BestPracticesOLAP].[ANALYSIS].[Period].[Period]"><Property name="element"
value="[Period].[All Years]" /></Row><Row name="[Repository].[BestPracticesOLAP].[ANALYSIS].[POS].[POS]"><Property name="element"
value="[POS].[All Pos]" /></Row><Row name="[Repository].[BestPracticesOLAP].[ANALYSIS].[PRODUCT].[PRODUCT]"><Property name="element"
value="[PRODUCT].[All Tires]" /></Row><Row name="[Repository].[BestPracticesOLAP].[ANALYSIS].[REGION].[REGION]"><Property name="element"
value="[REGION].[All Regions]" /></Row><Row
name="[Repository].[BestPracticesOLAP].[ANALYSIS].[VALTYPE].[VALTYPE]"><Property name="element"
value="[VALTYPE].[Variance]" /></Row></Table>