Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator II
Creator II

Top N Clients

Hi Community,

I have one table       

EmployeeClientRevenue
AABC1000
BABC2500
AABCA2700
BBBCA230
KLBCA890
LOLCCA9000
RRCCA5000
BTKNR25000
RTKNR

3500

I have created one variable vTop, and i have taken one input box.  (these are my listed values 5,10,15 20)

in my straight table, i have 2 dimensions.

Dimensions: Client and Employee

Expression: Sum(Revenue)

IF i select top 5 values, not working properly. if i take one dimension working fine.

My top 5 should be this table.

EmployeeClientRevenue
BTKNR25000
LOLCCA9000
RRCCA5000
RTKNR3500
AABCA2700

Please any one can help me.


Thanks in Advance.

6 Replies
sunny_talwar

May be try like using Rank() function instead of dimension limits

If(Rank(TOTAL Sum(Revenue)) < 6, Sum(Revenue))

paulwalker
Creator II
Creator II
Author

Thanks for Response..

I have to write Dimension level, because i have big expression.

I written dimension level, but it's not working

=Aggr(if(Rank(Sum({<Revenue))<=$(vTop), Employee),Employee)

avinashelite

As you add the Dimensions you need to include them in the AGGR(expression,Dim1,Dim2,Dim3....)

sunny_talwar

May be try this

=Aggr(If(Rank(Sum(Revenue)) <= $(vTop), Employee), Employee)

paulwalker
Creator II
Creator II
Author

if i am using this expression not showing Expression Total.

1.PNG

Please can you suggestion ?

sunny_talwar

Then do this

Sum(Aggr(If(Rank(TOTAL Sum(Revenue)) < 6, Sum(Revenue)), Employee, Client))