Mar
24
Creating Global Variables in Tableau
The feature described in this article applies in Tableau version 2020.1 and later.
In Tableau, when designing charts, the value of a measure is subject to the context such as filters and dimensions. Sometimes we need to have values that are constant across the board. This value is constant for a given data set. When data set changes, the value changes accordingly. For example, the max date in data record timestamps. Global variables come to the rescue.
Global variables are defined out of context or regardless of context. The concept originates from general programming. We can use them anywhere we wish without concern about filters and dimensions in view (that's specifically the context of creating charts in Tableau).
In Tableau, when designing charts, the value of a measure is subject to the context such as filters and dimensions. Sometimes we need to have values that are constant across the board. This value is constant for a given data set. When data set changes, the value changes accordingly. For example, the max date in data record timestamps. Global variables come to the rescue.
Global variables are defined out of context or regardless of context. The concept originates from general programming. We can use them anywhere we wish without concern about filters and dimensions in view (that's specifically the context of creating charts in Tableau).