Using Variables in Conditions

A query whose WHERE clause conditions are specified using variables is known as a parameterized query. Parameterized queries enable Dashboard users to enter values that filter chart data.

When you define a query, prefix the variable name with a dollar sign ($), as follows:

$variable_name

For example, the following data source queries the metric M_DailyCurrAccountsByStatus:

select * from /Dashboards/M_DailyCurrAccountsByStatus where TrackingDate = $trackingDate and AccntStatus = $status;

In this case, the Dashboard user would filter results by specifying a tracking date and a status value, using the Quick Edit menu option to display the chart’s Filter editor.

Default Variable (Parameter) Values

You can provide default values for variables in the Chart editor (see Data Settings).

If you do not provide default values, then the empty chart displays on the dashboard, which alerts Dashboard users to provide variable values that filter the results.

If you provide default values, the chart results are filtered using those values and display accordingly. The Dashboard user can still specify different values for some or all of the variables, using the Quick Edit menu option to display the chart’s Filter editor.