2 Replies Latest reply: Jan 17, 2018 7:04 AM by Juan Pablo Boschin RSS

    Is it possible to create an if in which a variable is compared with the maximum value that variable can take?

    Juan Pablo Boschin

      I want to create ranges of colors using an expression and I want to do it by dividing the range in equal amplitudes (min-max / 3, max / 3-max * 2/3 and max * 2/3-max)


      The problem I have is that when I want to set the ranges, it puts as if all the values are in the highest range.


      The expression I am using is the following:


      = If ($ (vShareClientsZC) <Max (Aggr (Count (distinct ClientId) / sum (HomesxMzna), AppleKey)) / 3, '# ff0b05',


      If ($ (vShareClientsZC) <Max (Aggr (Count (distinct ClientId) / sum (HomesxMzna), AppleKey)) * 2/3, '# ffff05',


      if (IsNull ($ (vShareClientesZC)), '# ff0b05', '# 40ff00')))



      What I think is happening is that Qlik is comparing each share with the same share value divided 3, etc ... It is not comparing it with the max value of share of all the rows.


      Does anybody know how I can fix it?

      Thank you very much in advance.