Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

Syntax for using qsVariable to render chart based on button

Hi, I believe my previous thread was never uploaded. I am trying to grab the top 10 and bottom 10 values using the qsVariable.

Capture23.PNG

Inside my variable for the top and bottom 10 I have:

Capture.PNG

I am trying to enter a syntax (using probably if statement) so that my bar chart will render based on when a user selects one of the buttons. 

I have something like but doesn't seem to work. 

if('$(vTopBot)'=1,num Sum({<ACCOUNT={"=Rank(Sum(SALES))<=10"}>},
if('$(vTopBot)'=2,num Sum({<ACCOUNT={"=Rank(-Sum(SALES))<=10"}>})
))

2 Replies
Luminary
Luminary

Hi,

have you tried instead  of doing nested if statement, just a single one ?

The code should be something like this:

if(' $(vTopBot)'=1 ,num Sum({<ACCOUNT={"=Rank(Sum(SALES))<=10"}>} ,
    num Sum({<ACCOUNT={"=Rank(-Sum(SALES))<=10"}>}    )

Specialist III
Specialist III

i have similar post answered search for 

 

qsVariable to render chart based on newly created buttons

Channa