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

Top 5,10 values in list box

Hi,

I want to create a list box which gives an option of selecting Top 5,Top 10 and All values.

Can someone help me what the logic to create.

My data is in below format:

Load

Country,

State,

Sales

from

abc .table;

11 Replies
krishnacbe
Partner - Specialist III
Partner - Specialist III

Hi,

Hope the attached file will help.

its_anandrjs

In any single chart create the three variables

For Top 10

=if(aggr(rank(sum(Sales)),States)<=10,sum(Sales))

For Top 5

=if(aggr(rank(sum(Sales)),States)<=5,sum(Sales))


all Values

Sum(Sales)


and one inline table for selection, after all this conditionally load the expressions for more see the sttached

kvr9
Creator
Creator
Author

Thanks a lot,  it works.

vikasdesai
Partner - Contributor III
Partner - Contributor III

Hello Vijaya ,

First Create buckets of Top 10 ,Top 5 and All value in Backend Script by Using nested If

i.e  If(aggr(rank(sum(Sales)),State)<=10,'TOP-10',

     if(aggr(rank(sum(Sales)),State)<=5,'TOP-5',

     if(aggr(rank(sum(Sales)),State)>10,'ALL-Value'))) as TOP

Then take TOP Field as FilterPlane / ListBox

krishnacbe
Partner - Specialist III
Partner - Specialist III

Good to hear. Please close the thread by marking the helpful/ Correct answer.

its_anandrjs

It seems you got the answers from the thread may be close the thread with appropriate answers.

kvr9
Creator
Creator
Author

Hi Vikas,

Can you please share an example with above script.

kvr9
Creator
Creator
Author

Hi Anand,

It works for single table,but I want this to be applicable for all charts and tables in my dashboard.

So should I write this expression in all charts?

Could please advice me how to work on it.

vikasdesai
Partner - Contributor III
Partner - Contributor III

Hi Vijaya

Can u Please share the DataFile