May 2, 2022
Building a MDX Form in Slice
Slice v3.3 introduces a new way to build reports, it is called MDX Form. This report is driven by one MDX query bringing the following advantages:
- Easier to maintain because everything is driven by one MDX query
- Expand and collapse on rows and columns
- Create on the fly calculation by using calculated members in MDX
Creating a new MDX Form from Slice
Just right click on a cell and then go to Slice > Insert Form and click on MDX Form:
The Insert Form pop-up will open, just select the Server, Cube, View, the Type and finally click OK
Slice is going to insert the function with the format area:
Creating a new MDX Form From Scratch
The report is driven by one function, MDXForm with the following parameters:
- ID: ID of the grid
- Server: Name of the TM1 instance in Slice.
- MDX: The MDX statement driving the report
- Write Back: 1 true and 0 false
- Attributes: list of attributes to show in rows or columns instead of the element ID
- Format Range
Using Attributes
To show attributes instead of Element ID, you need to use the following syntax:
- Dimension:Hierarchy:Attribute
In the example below, we are showing the Description attribute for the Account dimension and the Short Description for Period:
Format Range
Format can be applied on the row headers and on the data cells as below: