6 Replies Latest reply: Jan 26, 2018 2:43 PM by Stefan Wühl RSS

    Variable in set analysis not working

    Stephen Parker

      Hi Everyone,

       

      I am trying to get a kpi working using set analysis with a variable in Qlik Sense. The variable is defined as follows:

       

      if(IsNull(Value1) OR IsNull(Value2) OR IsNull(Value3), Null(), Dimension1)

       

      When I use this variable in a table next to value1, value 2 value3 and Dimension1 it works fine. Here is an example

                  

      Dimension1vVariableValue1Value2Value3
      AAAAAAXXXYYYZZZ
      BBB--YYYZZZ
      CCC-XXX-ZZZ
      DDD-XXXYYY-
      EEEEEEXXXYYYZZZ
      FFF---ZZZ
      GGG-XXX--
      HHH----

       

      As you can see, as long as Value1, Value2 or Value3 are not null, Dimension1 matches the variable. However, when I use this in a KPI chart object to count the non-null variables, I get no results. Here is my Set expression:

       

      Count({$<Dimension1 = $(vVariable)>} DISTINCT(Dimension1))

       

      Is there a clear reason why this is not working for me? It seems that if the table interprets the variable correctly, the set analysis should too.

       

      I appreciate the help.

       

      Stephen