Dynamic Captions
By default, when custom members are added to a query, their column or row header (caption) is the name the member was saved with. When working with MS OLAP models, users can configure dynamic custom member captions; these captions will be 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.
Custom Member Caption
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 drives 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.
Configuring Dynamic Captions
- Create your custom member as usual.
- Add the script to the Dynamic Caption field in the Properties panel, following one of these processes:
- Type or paste your script into the field directly.
- Click the Advanced Script icon to open the Script Editor, where you can create your script using the editor's drag and drop functionality. (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 Fx 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 Fx 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.