How to format MDX statements
The bottom section of MDX Rules and Editor window (List Rules) is used to format MDX statements.
You can format the created MDX statement by creating the rules and applying them to different levels and members of the dimensions.
To create a new rule press "Add a new rule" and set the rule name:
Define a condition, to which the rule will be applied:
- Account level stands for dimension level
- Account name stands for dimension member
- Is last item stands for the last item in the list
- Index stands for the serial number of the item in the list
Define an action to be applied to the condition:
- Apply Format - allows to select a specific format to be applied to the condition
- Apply Drill - allows to select a specific drill to be applied to the condition
- Set Custom Description - allows to select a specific description to be applied to the condition
- Set Empty - select this option, if you want to leave the condition empty
- Set Visible - select this option, if you want to make the condition visible
- Apply Header Format - allows to select a specific format, to be applied to the header
- Set Reverse Valuation - makes the negative values positive and vice versa
- Set Reverse Sign - flips the sign
- Set Suppress Value - sets automatic row suppression (e.g. suppresses rows with no data and zeros)
Example:
Let's consider an example of a report, where in the rows we want to include all members from Account dimension.
The MDX statement in this case will look as follows:
Code Block |
---|
[ACC].[ACC].AllMembers |
Then we will set three rules to be applied to different levels of Account dimension:
- Account level equals 01 - apply Default Total format
- Account level equals 02 - apply Base Inclusive Drill
- Account name equals GrossMargin - apply Default Highlighted Header format
As a result we will get the following formatted report: