Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top N Records

Hi,

How to find out Top N Records, customerNo based on sum(Amounts).

I need to display in straight and pivot Table this sum(Amounts) must be in descending/Ascending order.

Could you please give the entire process and set expression.

Thanks,

MLNR

Thanks ,

MLNR

Please give your valuable answers to me

Thanks,

MLNR

9 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

This can be achieved by using Dimension Limits (If you are using Qlikview 11)

Chart Properties -> Dimension Limits -> Select Restrict which values are displayed using the first Expression option->

Select Show Only -> Select Largest  -> Give your N (number) -> Sort Tab -> Select Y Value or Numeric value -> Select Descending option

Or

you can also do the same by using Calculating Dimension

Chart Properties -> Dimension -> Add Calculated Dimension -> Give your expression as

=Aggr(If(Rank(Sum(Sales), 1, 0) <= 10, Customer), Customer)

and select Supress When value is Null option.

Regards,

Jagan.

jzimolong
Creator II
Creator II

Create a variable, then use dimension limit and allow user to enter Top N Value to display for Sum(Sales).

See attached

ecolomer
Master II
Master II

Here you have an example

!

SunilChauhan
Champion II
Champion II

Top 5 analysis using Rank fuction

load you data and change the 5,10,20 etc in qvw as per your need

Sunil Chauhan
Not applicable
Author

Hi,

To control the Top Records to be listed using Input Box. and along with that if user wants to display all the records.

what is process for that,

Thanks,

MLNR

Not applicable
Author

Hi,

To control the Top Records to be listed using Input Box. and along with that if user wants to display all the records.

what is process for that,

Thanks,

MLNR

Not applicable
Author

Hi,

To control the Top Records to be listed using Input Box. and along with that if user wants to display all the records.

what is process for that,

Tahnks,

MLNR

Not applicable
Author

Hi,

To control the Top Records to be listed using Input Box. and along with that if user wants to display all the records.

what is process for that,

Thanks,

MLNR

jagan
Luminary Alumni
Luminary Alumni

Hi,

Create an InputBox and assign a variable to it and try expression below assume that variable is

vTopN

Chart Properties -> Dimension -> Add Calculated Dimension -> Give your expression as

=Aggr(If(Rank(Sum(Sales), 1, 0) <= vTopN, Customer), Customer)

OR specify dynamic value in Dimension Limits by using the variable

=vTopN


Hope this helps you.

Regards,

Jagan.