Understanding Dollar-sign Expansion

Dollar-sign Expansion is a process that allows us to replace text in an expression, or line of script, with either the value of a variable or some other calculation.

Suppose that we have a variable with a value of 10 and we write an expression like the following:

Sum(If(Field1=$(vValue), 1, 0))

The Dollar-sign expression, $(vValue), will get expanded to its value (10) and the expression that gets executed will be as follows:

Sum(If(Field1=10, 1, 0))

We can also have a calculation inside the Dollar-sign expression like the following:

If(Year=$(=Year(Today())), LightGreen())

In this case, the function Year(Today()) will be calculated and its value replaced into the main expression in the following manner:

If(Year=2014, ...

Get QlikView: Advanced Data Visualization now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.