Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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;

Tags (2)
11 Replies
Highlighted
Partner
Partner

Re: Top 5,10 values in list box

Hi,

Hope the attached file will help.

Highlighted

Re: Top 5,10 values in list box

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

Highlighted
Creator
Creator

Re: Top 5,10 values in list box

Thanks a lot,  it works.

Highlighted
Partner
Partner

Re: Top 5,10 values in list box

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

Highlighted
Partner
Partner

Re: Top 5,10 values in list box

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

Highlighted

Re: Top 5,10 values in list box

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

Highlighted
Creator
Creator

Re: Top 5,10 values in list box

Hi Vikas,

Can you please share an example with above script.

Highlighted
Creator
Creator

Re: Top 5,10 values in list box

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.

Highlighted
Partner
Partner

Re: Top 5,10 values in list box

Hi Vijaya

Can u Please share the DataFile