Concepts → Presentation variable
About a presentation variable
Defined in Dashboard Filters, a presentation variable is a referenceable and mutable variable of a specific data type with a default value that exists only within the scope of the given dashboard and a user accessing the dashboard.
The definition of a presentation variable overrides the default behavior of a dashboard which is to coalesce a list of dimension columns from all insights on all tabs as filterable columns available in the Filter and Search controls. Once defined and configured, a presentation variable appears in the Columns panel in the Filter dialog and as a filter bar pill. A dashboard consumer can assign a new value to a presentation variable in the Filter dialog.
Unlike a prompt, applied filter, or filter option, a presentation variable is not in itself a filter expression.
A dashboard developer defines zero or more presentation variables for a given dashboard.
Often, a dashboard developer references a presentation variable as a filter value in a filter expression or as a part of formula in a formula expression.
A dashboard consumer can assign a new value to a presentation variable in the Filter dialog. Unlike a session variable, the new value is immediately accessible to the dashboard itself. This means that any affected formula expressions or filter expressions will immediately be recalculated and reapplied.
A dashboard developer with Edit access rights to a dashboard can create and edit one or more presentation variables. Here's how:
- In the Action bar of a dashboard, select More Options (⋮ vertical ellipsis icon).
- In the More Options menu, select Manage Filter & Prompts.
- In Dashboard Filters, select Presentation Variables.
- From the Data panel, drag & drop a column or formula to the presentation tray.
Supported usage
Because a presentation variable is a mutable, referenceable object, a dashboard developer can utilize a presentation variable in a variety of ways:
- as a filter value in the filter expression of a dashboard filter or as any part of a formula that is a filter expression of a dashboard filter
- an applied filter
- a filter option
- as a filter value in the filter expression of an insight on a dashboard or as any part of a formula that is a filter expression of an insight on a dashboard
- an individual filter
- an aggregated filter
- a measure filter
- as any part of a formula expression for a formula pill in an insight on a dashboard for
- a grouping dimension
- a coloring dimension
- a measure
Unsupported usage
There are some unsupported uses of a presentation variable which may result in an error or unexpected behavior:
- as part of a formula expression for a formula column in a physical schema table or materialized view
- as part of a formula expression for a formula pill in an Incorta View or Incorta Analyzer Table
- as part of the expression in a filter expression session variable
- as part of an internal query expression for an internal session variable
- as a default value for a global variable
- as filter value for an individual filter, aggregated filter, or measure filter for an Incorta View or Incorta Analyzer Table
- as a default filter value for a prompt
- as part of a formula expression for a formula column in a runtime business view
To learn more about referencing a presentation variable as part of a formula expression for a formula column in a runtime business view, see Additional considerations for a presentation variable.
Properties for a presentation variable pill
The following are the properties of a presentation variable
Property | Control | Description |
---|---|---|
Variable name | label | Displays the variable display name. |
Display Name | text box | Required. Enter the display name for the presentation variable. This name will appear as the name as a filterable column in the Filter dialog and as the filter bar pill name. |
Variable | text box | Required. This is the variable name. |
Data Type | drop down list | Required. Set the data type for the variable as string, double, long, integer, or date. |
Default Value | text box | Required. Enter a default value for the variable. This can be system variable, internal session variable, or external session variables. |
Default Value → Variable | checkbox | Optional. Only available for variables that are a date system variable, internal session variable, or external session variable. |
Field (Optional) | tray and pill | Optional. Drag and drop a column from the Data panel to the tray. The pill populates the available values that appear in the Values panel of the Filter dialog for the presentation variable. |
Done | link | Saves changes you made to the presentation variable. However, to commit these changes, you must select Done in the Action bar of the Dashboard Filters Manager. |
Delete | link | Deletes the presentation variable. To commit these changes, you must select Done in the Action bar of the Dashboard Filters Manager. |
A variable as a default value or assigned value
As a dashboard developer, it is important to understand that a presentation variable has a data type and default value. It is possible to define a default value using another variable. Similarly, it also possible specify as variable as an assigned value for a presentation variable in the filter dialog.
All three types of session variables store values as a string. If a presentation variable is not of the type string, do not use a session variable for a default value or as an assigned value of a presentation variable.
The following table describes the supported variable and data types for a the value of presentation variable.
Variable type | Presentation variable data type | Default value | Assigned value |
---|---|---|---|
Date system variable | date | ✔ | ✔ |
External session variable | string | ✔ | ✔ |
Global variable | |||
Filter expression session variable | string | ✔ | ✔ |
Internal session variable | string | ✔ | ✔ |
Miscellaneous system variable | string | ✔ | |
Presentation variable |
Although it may be possible to specify a presentation variable or a global variable as a default value or as an assigned value of a presentation variable, this configuration is not supported and may produce unexpected results.
Additional considerations for a presentation variable
If you have a session variable and a presentation variable with the same name, the global session variable will have a type of string and take precedence over any presentation variable you define in a dashboard.
A schema developer and dashboard developer may implement the usage of a presentation variable in a formula column for a runtime business view. The practice consists of the following steps:
- First, create an internal session variable with a specific name such as
pv_example
. - Create a formula column in a business schema view or Incorta view with a formula expression that references the internal session variable. AS a valid expression for the Formula Builder, this expression will pass formula validation.
- Save the changes to the runtime business view.
- Delete the internal session variable.
- For a given dashboard, create a presentation variable with the same name as the deleted internal session variable such as
pv_example
.
A future upgrade may fail without the re-introduction of the original internal session variable.