MDX script's functionality
You already saw a couple of examples for defining calculated measures in the MDX script found on the Calculations tab within SSDT. Some MDX functionality applies only within the MDX script and not in queries. For example, you could define the calculation scope so that it only applies to certain hierarchy members. You can also use the ROOT
function to refer to the topmost level of the hierarchy. The ROOT
function isn't specific to the MDX script, but it is most commonly used in cube-level calculations.
The MDX script is evaluated when you first deploy the solution and anytime you change calculations; it doesn't require processing any objects (dimensions or partitions), but it could overwrite the existing cube values. Full discussion on how MDX scripts work is beyond the scope of this book. The examples in this section demonstrate how MDX-script-specific functions change the calculated values of the cube.
How to do it...
Let's get started with MDX script's functionality...