Parameters are an advanced feature that allows users to build lists of items that can be used to drive other calculations or logic.
Parameters can be either:
- 'static' - hard coded items simply typed into the system. This includes text or numbers.
- 'dynamic' - derived values from data models found in the system. This is usually a list of hierarchy elements or members.
By using a parameter, the designer can make a visual element pop-up in the UI of the application, allowing the consumer to make a runtime selection, which in turn will change the logic or behavior of a calculation or report.
Global vs Model
There are two main types of parameters:
- Global : these may be used across different data models - and are driven without data. Global parameters are only "static".
- Model : these can be defined for a single data model because they are data driven. Model parameters can be both "static" and "dynamic"
Parameters can be used in:
- Queries built in Discover
- Custom calculations built in Formula
- Custom sets built in List (for example, to build multi-hierarchy cascading slicers)
- Variable lists
- Presentations and publications
Static parameters are useful for changing the operation of logic or formulas, Examples include:
- Custom lists using the Switch node or Variable lists in Discover - using the parameter to allow the user to switch the listing logic
- Numeric Filters in Discover - using the parameter to allow users to change the amounts in the filtering logic
Dynamic parameters are used primarily as data filters to drive the "WHERE" logic in queries. The most obvious example is a slicer (see below for more). However, dynamic parameters can also be used inside formulas and lists to change the way they operate, as well as techniques for showing or hiding data elements in a visual (as opposed to simply filtering the query).
Most dynamic parameters are visualized as a slicer but they can be used to inject dynamic elements into ANY PART of the target query (as opposed to only filtering the query like a regular slicer). Indeed, slicers are a simplistic quick implementation of parameters. This allows users to change complex logic built in queries at runtime, without the need to design any complex artifacts on the server or on the client. Parameters may be used to configure other custom formulations, like custom lists and members, in order to create sophisticated logic. For more on slicers, click here.
Parameters are not the same as 'external parameters' that can be used to change URL-loaded or embedded content from external inputs. However, they are related.
Most parameters are created using the Parameter designer tool in Formulate. The tool offers a way to define the parameter type, its elements (both static and dynamic), default value(s) and visualizations. While its possible to create parameters outside of the designer, it remains the central location for editing all parameters in the application.
From inside the Parameter wizard you can click Quick Discovery to open your saved parameter in Discover immediately.
To add your parameter to a query later on:
- Open a data discovery using the same data model that was used to build the parameter
- In the Dimensions panel, find the hierarchy that your parameter was based on. Right click on the hierarchy and click View Elements
- At the top of the Elements panel, click the Fx button
- Find and select the parameter from the folder tree
To edit a shared parameter, find it in the Content Explorer. click its context menu and choose Open - the parameter will be opened in Formulate, where you can edit it.
You can also edit a parameter from Discover:
- Add the parameter to the query
- Click the context menu (3 ellipses) to open the Slicer Settings dialog, where you can change the title and visualization type