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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

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.

Labels (1)
6 Replies
sunny_talwar
MVP
MVP

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

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

paulwalker
Creator III
Creator III
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
MVP
MVP

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

sunny_talwar
MVP
MVP

May be try this

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

paulwalker
Creator III
Creator III
Author

if i am using this expression not showing Expression Total.

1.PNG

Please can you suggestion ?

sunny_talwar
MVP
MVP

Then do this

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