I have recently been asked by many junior Qlikview developers on how to use variables inside Qlikview set analysis expression. Last week, one of our Qlikview consultant was also struggling with fetching the latest date by using variable. Finally I decided to write a short blog on how to use Qlikview variables inside set analysis

Using variables inside Qlikview is a bit ticky business. We could use equal, $ or simple variable name depending upon the usage of the variable. In this specific case, we have stored the latest date in the loading script and we want to use that variable in a set analysis expressions

Suppose a normal chart with all dates looks something like this



As you can see, it is using a normal expression of sum for the chart. Now if you want to use a variable inside the set analysis to restrict the chart to only the max date, a set analysis expression would become something like this


sum({<Month = {'$(max_date)'}>}Qty)

The resultant chart would look something like this



Please feel free to ask questions in comments if you have any question related to this blog


Published in Qlikview