Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
kevbrown
Creator II
Creator II

Top 10 With Total

I have a straight table with a sum expression. I only want to show the top 10 and need a total on the bottom line for the top 10. I can select the top 10 but it gives me the total for all 100.

Any suggestions?

Kev

1 Solution

Accepted Solutions
Not applicable

Hi Kevin,

PFA. and change as my example shows Top 5.

Thanks

View solution in original post

6 Replies
avinashelite

Hi Kevin,

try with Rank() function.

MK_QSL
MVP
MVP

Consider you have below table

Load * Inline

[

  Customer, Sales

  A, 100

  B, 120

  C, 75

  D, 90

  E, 120

  F, 140

  G, 120

  H, 200

  I, 240

  J, 110

];

Create a Straight Table

Dimension

Customer

Expression

SUM({<Customer = {"=Rank(SUM(Sales),4)<=5"}>}Sales)

This will give you TOP 5... Replace 5 with 10 to get TOP 10 as per your database.

amit_saini
Master III
Master III

Kevin,

Use calculated dimension here like this:

=aggr(if(rank(sum(Data))<=10, User),User)

Thanks,
AS

amit_saini
Master III
Master III

Also this may help you, please see the attachment.

Thanks,
AS

Not applicable

Hi Kevin,

PFA. and change as my example shows Top 5.

Thanks

kevbrown
Creator II
Creator II
Author

That works a treat thanks, however, what if i now want to add a second dimension, so in your example, add office but still show only the top 5 salemen.