8 Replies Latest reply: Jun 6, 2017 7:16 AM by Francesco Gregori RSS

    Variables in Qlik Sense Set Analysis

    Francesco Gregori

      Hi all


      I'm having a problem using variables in Qlik Sense Set Analysis.

      I searched for similar questions but I couldn't find what I'm looking for.


      I defined the following variables:

      max_TIME as: Max(TIME)    (it returns max year)

      maxval as: sum({$<TIME = {$(max_TIME)}>} Value)    (it should return the aggregated value of "Value" measure corresponding to max year)


      I tested the first one (max_TIME) and it's working fine.

      The issue is with the second one (maxval), since it's not returning the right value (it always returns the wrong value 0, no matter what's the TIME I select).

      If I change maxval this way


      sum({$<TIME = {2007}>} Value)


      it works fine, so I guess the problem is with the evaluation of variable max_TIME within variable maxval.


      Should I use a different syntax?

      Is there some kind of limitation in Qlik Sense when it comes to this feature?


      Any help would be highly appreciated!