Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This is a follow up from my previous thread. I now fully understand how the qsVariable works and now have it set up so that I want to show the Top 10 and Bottom 10 values in a bar chart given my dimension. I also found the Qlik community refers this to as Cyclic Dimension, but please correct me if I am wrong. My syntax is not working although I feel that it is very close.
Dimension: ACCOUNT
Value: SALES
Variable: vTopBot (1 = top 10, 2 = bottom 10)
Syntax under measure is:
if('$(vTopBot)'=1,Sum({<ACCOUNT={"=Rank(-Sum(SALES))<=10"}>},
if('$(vTopBot)'=2,Sum({<ACCOUNT={"=Rank(-Sum(SALES))<=10"}>})
))
Any help would be greatly appreciated.
=If(Aggr(Rank(Sum(SALES)),Account)<=10,Account)
for top 10 it is ur dimension
=If(Aggr(Rank(-Sum(SALES)),Account)<=10,Account)
bottom 10
if($(vTopBot)=1,Sum({<ACCOUNT={"=Rank(-Sum(SALES))<=10"}>}, if($(vTopBot)=2,Sum({<ACCOUNT={"=Rank(-Sum(SALES))<=10"}>}) ))
or
if($(vTopBot)=1,Sum({<ACCOUNT={"=$(=Rank(-Sum(SALES)))<=10"}>}, if($(vTopBot)=2,Sum({<ACCOUNT={"=$(=Rank(-Sum(SALES)))<=10"}>}) ))
You need to check what your dimension are if the dimensions for the measures are different then the chart dimensions