Global variables enable you to model a 'what if?' analysis on the dashboard. With the calculation engine, it is very easy to set up a calculated metric that weighs, changes, or forecasts an existing metric.
Creating a global variable
When you create a new global variable, you must write formulas using Explore's calculation engine. If you are unfamiliar with writing formulas in Explore, see Formula writing rules reference.
After you add the global variable to your query, you can change the numeric value it represents in the Result manipulation menu (). See Changing the global variable value.
- In the Query Builder, click the Calculation engine icon ().
- Select the Global variable option.
- Type a name for your global variable.
- Enter maximum, minimum, and default values. For example values, see Types of global variables.
- Click Save when finished
Note: You will not be able to access your global variable until you add it in a standard calculated metric or attribute.
- In the Calculation engine menu, select any option.
- Select your global variable from the Select a field drop-down list.
- Enter your formula.
- Click Save to finish your calculated metric or attribute.
- Add your calculated metric or attribute to the frame by clicking the + button. Once you add your global variable to the frame, it will automatically be added to the Filters bar.
Changing the global variable value
To set the global variable value
- Click on the global variable filter on the Filters bar. The global variable menu will open automatically.
You can also access the global variable in the Result manipulation menu ().
- Drag the circle across the bar to increase or decrease the default value. You can also type a new value in the box underneath the bar.
- Click Apply when finished.
Your value is now adjusted.
Types of global variables
Global variables can either be a numeric or percentage multiplier. Both types of multipliers serve different purposes when calculating a 'what if' analysis.
A numeric multiplier models actual changes in a metric. For example, what if the number of incidents increases from x to y?
In this case, the default value should be the current result and the minimum and maximum to cover both the worst and best case scenarios.
A percentage multiplier is used to model the percentage change of a metric. For example, what if the number of solved tickets reduces from 90% to 40%?
When using a percentage multiplier, the default value should be one, so the initial number is displayed correctly. The minimum and maximum can be whatever is necessary, as long as the values are integers.