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
![](https://codebackend.kinsta.cloud/wp-content/uploads/2023/04/slice-mdx-form-4.gif)
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:
![](https://codebackend.kinsta.cloud/wp-content/uploads/2023/04/Screenshot_1-10.png)
The Insert Form pop-up will open, just select the Server, Cube, View, the Type and finally click OK
![](https://codebackend.kinsta.cloud/wp-content/uploads/2023/04/Screenshot_2-7.png)
Slice is going to insert the function with the format area:
![](https://codebackend.kinsta.cloud/wp-content/uploads/2023/04/Screenshot_3-5.png)
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
![](https://codebackend.kinsta.cloud/wp-content/uploads/2023/04/Screenshot_4-5.png)
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:
![](https://codebackend.kinsta.cloud/wp-content/uploads/2023/04/Screenshot_5-4.png)
Format Range
Format can be applied on the row headers and on the data cells as below:
![](https://codebackend.kinsta.cloud/wp-content/uploads/2023/04/Screenshot_13-1-1.png)