Using Prompts and ApplySimple Statements
Using the ApplySimple function, you can include prompts in your MDX to provide dynamic analysis on your MDX cube data. For basic information and examples of the ApplySimple function, see the Functions Reference.
The example below shows the basic structure of an ApplySimple statement to create metrics with custom MDX:
MDX expression with placeholders for objects
A simple application of this technique is to use a constant value prompt in your project as a multiplier of metric data:
ApplySimple("([Measures].[Total Sales] / #0)" ,?
In the example syntax above,
#0 is a placeholder in the MDX expression for the value prompt. The syntax for including a prompt as an object to replace a placeholder is
You can also use this technique with the conditional metrics techniques. For example, rather than always returning the revenue data for electronics, you can allow users to choose what category to view revenue for. To provide this analysis to users, you can include an element list prompt on the Category attribute of the MDX cube: