Variable lists are a specialized type of logic that can be used in your report to change or swap out the list of elements used in the query using a simple switch. The capability allows basic element swap outs as well as swapping out entire lists with other lists (effectively, this a variable list of lists).
A longer, deeper explanation of what variable lists are can be found here.
Variable List Design Options
There are three main techniques for building Variable lists:
- Quick Variable Lists via the right-click context menus on the elements tree in Discover
- The Variable Lists Wizard dialog box from the Query Ribbon in Discover
- The List builder tools in Formulate using the 'Switch' function.
This topic covers the Quick Variable List builder, which can be triggered from the right-click context menu on a visual or element trees (as explained here).
Create a quick variable list by opening the Elements panel of the relevant member hierarchy (right click on the hierarchy and select View Elements). Use the Ctrl key and select the required elements, right click, and under Create List select Create Variable List.
The new variable list will appear under the Elements panel (blue highlight below) - auto-named based on your selections.
Select its checkbox to add it to the query, or right click on it to save it to the CMS.
Editing and Managing Variable Lists
To rename your variable list or give it a meta description, right click on the item and choose 'properties'. To learn more about managing quick variable lists click here.
Variable lists are based on parameters. In general, these parameters can be built in the Formulate parameter tools as sharable, reusable parameters; or they can be built inside the wizard using quick static parameters. Importantly, Quick Variable Lists are always built using quick static parameters created during the process. Once built, its parameter can be accessed from the Internal Parameter dialog.
Open the Design ribbon and click the Internal Parameters button (red highlight below). The parameter will appear in the dialog (green highlight). Under Actions, the parameter can be edited in Formulate, saved to the content system or deleted.
Note: The parameter can only be deleted if the variable list is not being used in the query, and only after the variable list has been deleted.
Highlight the preferred measure values in the measure element tree. Then right click and choose "Create Variable List." This will generate a new variable list (with hidden parameters in the background).
Next, select the new variable list item in the custom measures tree. This will direct the application to load up the measure as a slicer list (in this case buttons), allowing the user to change the visible measure in the query easily using the buttons.
This example requires 2 phases. In the first phase, build 2 simple standard lists using elements from a hierarchy. In this case, we are going to build a standard list of product colors (Black, Blue and Grey). Will then repeat this for another set of colors: red, Silver and White.
You will see the 2 standard lists in the custom calculations tree for the color hierarchy. Highlight both lists, then right click and choose "Create Variable List". This will generate a new variable list (with hidden parameters in the background). Critically, this variable list switches between 2 other lists: effectively a list of lists.
Next, select the new variable list item in the custom members tree. This will direct the application to load up the variable switches as 2 buttons (one for each sub list originally selected) and build a simple button slicer. This will allow the user to easily change which of the 2 product color lists will be shown in the visual.