Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Show top 10 values for each group?

Hi,

i have 3 fields

manager ,employee, salar


for under each manger  i want show top 10  salryed employess in in straight or pivot table

Please help me on

Thanks,

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

For a straight table try this as the expression to show top 10 Salaries for each manager

if( aggr( rank(  sum(  Salary)),Manager,Employee) <=10, sum(Salary))

to actually show the rank as well

if( aggr( rank(  sum(  Salary)),Manager,Employee) <=10, aggr( rank(  sum(  Salary)),Manager,Employee))

View solution in original post

3 Replies
JonnyPoole
Former Employee
Former Employee

For a straight table try this as the expression to show top 10 Salaries for each manager

if( aggr( rank(  sum(  Salary)),Manager,Employee) <=10, sum(Salary))

to actually show the rank as well

if( aggr( rank(  sum(  Salary)),Manager,Employee) <=10, aggr( rank(  sum(  Salary)),Manager,Employee))

MK_QSL
MVP
MVP

Dimension

1) Manager

2) IF(Aggr(Rank(SUM(Salary),4),Manager,Employee)<=10,Employee)

Expression

SUM(Salary)

maxgro
MVP
MVP

in a straight table you can also use dimension limit (in dimension limits tab)