Using variables in expressions

A variable in Qlik Sense is a container storing a static value or a calculation, for example a numeric or alphanumeric value. When you use the variable in the app, any change made to the variable is applied everywhere the variable is used. You can define variables in the variables overview, or in the script using the data load editor. You set the value of a variable using Let or Set statements in the data load script.

Tip: When using variables in expressions, you can change the expression used in a range of charts simultaneously simply by editing the variable.

You open the Variables overview by clicking Variables in the edit bar when editing a sheet.

The following actions are available in the variables overview:

  • Create a new variable.
  • Edit the selected variable.

  • Delete the selected variable.
Note: If you want to edit or delete a variable that is defined in the script, you must edit the script.

Getting an overview of all variables in an app

You can get an overview of all variables in an unpublished app.

Do the following:

  1. When editing a sheet, click Ò in the edit bar on the sheet to open the variables overview.

    The variables overview opens and displays a list of all variables in the app and their definitions (if any).

  2. Select a variable in the list that you want to view details of.

    The variable expands and displays detailed information about the variable, if any: definition, description and tags.

    Note: When a variable is created or edited, all fields except the name field can be left empty.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?