5 Replies Latest reply: May 6, 2018 8:32 PM by haifeng zhao RSS

    If statement performance issue

    haifeng zhao

      Dear all,

       

      Now I am having the challenge in Qliksense.

       

      Now we have some filters in the dashboard(A/B/C/D/E etc..), the requirement is that which filters we selected, for example, if field A have value 1/2/3, if we selected 1 and 2 under field A, then the field A as dimension and dimension value are 1 and 2 So we used the IF(GetSelectedCount) statement , but as the too many if statements, the performance is not good. May i know who have any ideas for my challenge? Thanks in advance.

       

      Sameple Script:

       

      IF(GetSelectedCount(A)>0,A,

      IF(GetSelectedCount(B)>0,B,

      IF(GetSelectedCount(C)>0,C,

      IF(GetSelectedCount(D)>0,D,

      IF(GetSelectedCount(E)>0,E,

      IF(GetSelectedCount(F)>0,F,

      IF(GetSelectedCount(G)>0,G,

      IF(GetSelectedCount(H)>0,H,

      IF(GetSelectedCount(I)>0,I,

      IF(GetSelectedCount(J)>0,J,

      IF(GetSelectedCount(K)>0,K,

      IF(GetSelectedCount(S)>0,S,

      IF(GetSelectedCount(M)>0,M,

      IF(GetSelectedCount(N)>0,N,

      IF(GetSelectedCount(Y)>0,Y,

      IF(GetSelectedCount(X)>0,X,

      IF(GetSelectedCount(Z)>0,Z,'')))))))))))))))))

       

      Best Regards,

      Haifeng