Understanding the equal symbol usage in Variable

Thursday, August 15, 2019

The advantage of using the Variable is reuse. The variable defined in qlikview will be the global and they can be static or calculated. The variable created by Variable Overview in front end that starts with the equal symbol will directly calculated by qlikview. An expression that does not start with equal symbol will not be calculated remains static. Here the example which shows the exact difference between two usages. Let say an application has sales data per Region.

RegionSales
Asia120
Asia400
Africa1000
Africa900
North America500
North America600

Variable called vSales that has expression to calculate the sum vSales = (sum(sales)) When using this variable in chart will gives string sum(sales). This expression can be calculated by using $ sign before the variable.

RegionvSales$(vSales)
Asiasum(sales)520
Africasum(sales)1900
North Americasum(sales)1100

The result will be the sum of individual regions. When a variable is defined with equal symbol, vSales1= (=sum(sales)) The result will be the total value of all regions in each row of the table.

RegionvSales$(vSales)$(vSales1)
Asiasum(sales)5203520
Africasum(sales)19003520
North Americasum(sales)11003520

Variable is extremely powerful in developing qlikview applications and should be used with care. By: Sivaraj Seeman

No items found.