Developer features

Variable Support

Variables are an important feature and allow the dashboard developer to create a richer end-user dashboard experience. One way variables can be used is to conditionalize the user interface — hiding and showing different user interface elements or dynamically changing user filters. Another way is in expressions, to make them more dynamic.

Example

Hide and show a chart

Bind an object's visibility to a variable, then change that variable from anywhere — like a button click — to build a dynamic, app-like interface.

Chart visibility expression: the chart's Show condition checks whether OverviewChart equals 2
The chart is only shown when the variable OverviewChart is equal to 2.
Button action configuration that sets the variable OverviewChart to 2 on click
A button action sets the variable OverviewChart to 2 when clicked.
Example

Variables in expressions

There are two ways of referencing a variable: by name and using macro notation. To reference a variable by name, simply type its name and the variable value will be replaced. Macro notation uses the syntax $(variablename) — it replaces the variable with its value before the expression is parsed, allowing you to use variables to contain expression fragments.

ExpressionDescription
Count(Orders.ID, WHERE(Sales.OrderDateYear, CurrentYear)) The variable CurrentYear is replaced with its value after the expression is parsed and is executing.
Count(Orders.ID, $(FilterExpression)) The variable FilterExpression is replaced with its value before the expression is parsed and executed.

FilterExpression = "WHERE(Sales.OrderDateYear, 2010)"
if(GetColumn(1) = CurrentYear, Count(Orders.ID), Count(Orders.ID) * 1000) The variable CurrentYear is replaced with its value. If the chart dimension of the first column is equal to the value of the variable CurrentYear, then count orders — else count orders × 1000.
See it live

Want to see variables in action?

Book a demo and we'll build a dynamic, variable-driven dashboard with your own data.

Request a demo