Variable Fields vs. Variable Values
You can use variables to define metrics against generic projects, fields, and values when you don't know what the actual values are.
Field variables and value variables are set at the workbook level. Project variables can be set at the project level.
Variable Field
When defining a metric, if a field to be used in a metric definition is unknown, you can create a field variable. These variables are set at the workbook level. In a similar manner to the variable value, when an analysis is run, the user is prompted for the actual field to be assigned. This is useful when a metric refers to, for example, a user-defined or code field that is not known at the time of creation of the metric.
You can define a metric using variable fields, variable field values, or both.
Variable Value
When defining a metric, instead of setting criteria based on a defined value, you can describe a metric in terms of a variable. An example is a custom metric called High Cost. At the time of the metric being created, you do not know what this value should be. Instead you can create a variable called, for example, High Cost Value and use this in the metric definition. At run-time, when an analysis is run, the user is prompted to enter a value for this variable which will subsequently be used in the calculations.
Referencing Variables when Defining Metrics
After you have defined a variable, you can reference it when defining a metric in the exact same way a normal defined value is referenced.
The screenshot below shows an example of a metric called High Cost being defined using the variable My Unknown Cost.
Using Variable Fields and Variable Values Together
After you have created the variable field and variable value, you can define the metric. At run-time, the user is prompted to define both the Variable field as well as the variable value. For example:
Multiple Variables
You can create multiple variables against a variable field.
For example, you can create a variable field called Acceptable Cost that contains two variables - Low Value and High Value. You then define a metric based on two criteria: The Total Cost being greater than Low Value, and less than or equal to High Value.
At run-time, the user is prompted for the field that is being used in the calculation as well as the two variable costs being used in the metric calculation.
- Related Topics:
- Example of Defining and Referencing Variable Fields
This is an example of defining and referencing variable fields. - Example of an Analysis using Variables
This is an example of an analysis using variables.