Using XML variables with filter dimensions
Dynamic reports do not depend on a particular data source. Instead, variables and report parameters are used as placeholders for the required data connection and cube, and for the dimensions.
The designer of a dynamic report cannot know what database or data structure the report will be used with and does not know, for example, the number of dimensions, or which dimensions will be used as filter dimensions. If the report is to be used in a dashboard and the filter dimensions are to be used for widget communication, the values selected from each filter dimension must be stored. But because the dimensions are unknown, this cannot be done by assigning individual variables and parameters to each dimension. The solution is to store the filter values in an XML variable of a specified format. That variable can be assigned to a Tuple report parameter and used in widget communication on a dashboard.
This solution involves using multiple SETPROPERTY formulas in multiple actions to populate a single XML variable.
For example, you have a report in which Product and Period dimensions are filter dimensions. The user's selections from those dimensions are passed to report variables called rv_product and rv_period. Those report variables are then referenced by SETPROPERTY formulas to populate a third report variable, called rv_XMLFilters.
For the Product filter dimension, this SETPROPERTY formula is used within a Set Parameters action:
=SETPROPERTY(ReportVariables.rv_XMLFilters,"[Product]","Unique",ReportVariables.rv_product.text)
.
For the Period dimension, this formula is used:
=SETPROPERTY(ReportVariables.rv_XMLFilters,"[Period]","Unique",ReportVariables.rv_period.text)
As users select from the Product and Period filters, the XMLFilters variable is populated with the values from rv_product and rv_period. For example:
<Table><Row
name="[Period]"><Property name="unique" value="[Period].[All Years].[2012]"
/></Row><Row name="[Product]"><Property name="unique"
value="[PRODUCT].[All Tires].[Special Offers]"
/></Row></Table>
By assigning the XML variable to a Tuple report parameter, the values held in the variable could be used for widget communication if the report were displayed in a dashboard.