Dynamic Captions
By default, when custom members are added to a query, their column or row header (caption) is the name by which the member was saved. When working with MS OLAP models, users can configure dynamic custom member captions; these captions will displayed in the visual instead of the custom member name. By configuring a script in the Dynamic Caption field, the user can change the custom member caption in the visual based on the context of the query.
For instance, you may want to change the custom member caption according to a parameter selection. Or you might want to display dynamic captions for time intelligence slicers (watch the video below for details). In this case, the slicer selection will drive the corresponding caption:
This differs from the default behavior, where the name of the custom member drives the caption in the visual:
To learn more about configuring dynamic captions, continue reading. To review a step by step example, click here.
How to Configure Dynamic Captions
- Create your custom member as usual.
- Add the script to the Dynamic Caption field in the Properties panel.
- Write or paste your script, or click the Advanced Script icon to open the script editor
- From the script editor, use drag and drop functionality to build your script; add the required MDX functions, model hierarchies, member elements, and existing custom business logic.
- Save your custom member.
Adding Business Logic
Custom members: existing custom members will be displayed in the Measures panel; select Measures from the Hierarchies panel, then click the Fx button from the Measures panel; select the custom member from the content tree in the Measures panel.
Custom Lists: existing custom lists can be accessed from the hierarchy where they are saved; select the relevant hierarchy from the Hierarchies panel, then click the Fx button from the Elements panel; find and select the list from the content tree,
Global parameters: global numeric and text parameters are displayed in the Global Parameter panel; navigate the content tree to find and select the required global parameters. Model parameters cannot be used to create dynamic captions.