Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dreweezy
Partner - Creator II
Partner - Creator II

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
R_Kaymakchiev
Luminary Alumni
Luminary Alumni

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"}>}    )

Channa
Specialist III
Specialist III

i have similar post answered search for 

 

qsVariable to render chart based on newly created buttons

Channa