Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Master III
Master III

top 10 values

Hi all,

I have one fields called division it has 15 records now am using that as list box.

My requirement is i want only top 10 records from list box.

How can i achieve it.

Thanks

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

what is logic to define Top 10 in list box? Is it on Sales or on some amount? If it is so you can do something like this

In listbox properties , in drop down select expression and use below expression

=aggr(if( rank(sum(Amount),4)<=10,Division), Division)

Please find the attached

View solution in original post

15 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Hi,

Try like this

=Aggr(If(FieldIndex('division', division) <= 10, division), division)

The best thing is arrive the top 10 fields in script and use that field in listbox

Data:

LOAD

*,

If(RowNo() <= 10, division) AS Top10Div

FROM DataSource;

Now use Top10Div as listbox.

Hope this helps you.

Regards,

jagan.

Highlighted
Champion
Champion

Hi,

you can add a new object and select the type >listbox<. Then you can add formulas (as well as fields) and you can also enter some condition. I haven't found out yet exactly how to do it, but experiment a bit with that (try with the max() function, that lets you specify the top_10).

Alternatively, you could use a straight_table chart for that, with a dimension of '1' (not to be displayed), so only one column will be visible.

HTH

Highlighted
Master III
Master III

Hi Jagan,

=Aggr(If(FieldIndex('division', division) <= 10, division), division)


The above statement is not working.


Thanks

Highlighted
MVP
MVP

what is logic to define Top 10 in list box? Is it on Sales or on some amount? If it is so you can do something like this

In listbox properties , in drop down select expression and use below expression

=aggr(if( rank(sum(Amount),4)<=10,Division), Division)

Please find the attached

View solution in original post

Highlighted
Master III
Master III

Hi Kush,

Can you explain me below statement

=aggr(if( rank(sum(division),4)<=10,Division), Division)

Thanks

Highlighted
Master III
Master III

Hi Kush,

Very sorry I used your expression but value is not coming.

PFA in that i want red mark first top 10.

Highlighted
MVP
MVP

Rank function is checking the Top 10 Values by Division using Rank(sum(Value),4)<=10, and assigning the Division name (if( rank(sum(Value),4)<=10,Division))by aggregating the values by division which is whole statement

Highlighted
MVP
MVP

Please share your sample app

Highlighted
Master III
Master III

PFA.