Concepts → 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.
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 Dashboard Filters Manager.
- In Dashboard Filters, select Presentation Variables.
- From the Data panel, drag & drop a column or formula to the presentation tray.
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
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 Analyzer 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 filter value for an individual filter, aggregated filter, or measure filter for an Incorta Analyzer 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 below.
The following are the properties of a presentation variable
|Column Label||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 name||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.|
|Field (Optional)||tray and pill||Optional. Drag and drop zero or more columns 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.|
|Field (Optional) → Sort By||tray and pill||Drag and drop zero or more columns from the Data panel to the tray. Select the ascending or descending icon to the left of each pill to change the sort order. You can use only columns from the same physical schema table as the presentation variable.|
|Default Value||text box, calendar, or list selection||Required. Enter a default value for the presentation variable. A default value can be system variable, internal session variable, or external session variables.|
Although it may be possible to specify a presentation variable as a default value or as an assigned value of another presentation variable, this configuration is not supported and may produce unexpected results.
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|
|Date system variable||date||✔||✔|
|External session variable||string||✔||✔|
|Global variable||integer, long, double||✔||✔|
|Filter expression session variable||string||✔||✔|
|Internal session variable||string||✔||✔|
|Miscellaneous system variable||string||✔|
If you have a global variable and a presentation variable that share the same name, the presentation variable will take precedence over the global variable.
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
- 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
A future upgrade may fail without the re-introduction of the original internal session variable.