Using the Variables Tab


The Variables tab contains a set of predefined parameters that you can use to add information to the chart header or footer, build dynamic calculated fields, or quickly create filters based on conditions defined in the data source.

The available variables are divided into two sections, System Variables and Query Variables, as shown in the following image.

Variables tab

System Variables are predefined variables that are always available for use. These are:

  • Today's date (default format)
  • Today's date (mm/dd/yyyy)
  • Today's date (yyyy/mm/dd)
  • Today's date (dd/mm/yyyy)
  • Time of Day (hh:mm:ss)

These values are dynamic, and are set when your content is run. That means that if you use a system variable to show the current date, it will display the date that the chart was run, regardless of when the chart was created.

You can use a system variable in two ways. You can drag a system variable to the chart header or chart footer to create a dynamic label that shows when the chart was run. If you run a chart multiple times as your data updates, adding the date and time of day when the chart was executed to the header or footer can tell you when it was generated, differentiating between multiple executions of the same procedure.

You can also add a system variable to a calculated field. For example, you could create a calculated field that uses a date function like DTADD to subtract 7 days from the date indicated by a system variable. You could then filter by this calculated field to create a chart that always only shows the last week of data.

The Variables tab also contains Query Variables. Query variables are preset filters that are defined in the data source. You can use one by dragging it to the Filter toolbar.

For example, the following image shows a query variable called Store Front that has been added as a filter in the chart.

Store Front filter

This filter has already been set in the data source to exclude sales made online. When you drag it to the Filter toolbar, you can choose whether the filter is set to True or False. When set to True, the filter is applied. Only brick and mortar stores are included in the chart. When set to False, the filter is excluded. Brick and mortar stores are excluded from the chart, so only online sales are included. When the filter is set to All, it has no effect on the chart.

When you right-click a query variable, you can add it to the Filter toolbar or create a new calculation using the filter.