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: 
ananyaghosh
Creator III
Creator III

Need help for creating a set expression


HI,

I have following tables:

Employee:

load * Inline [
Employee ID, Age, Customer Name, Sales
Sandip Ghosh, 34, Customer1, 1000
Ananya Ghosh, 29, Customer2, 1200
Amit Das, 35, Customer3, 3000
Kaushik Dhar, 55, Customer4, 5400
Sudhir Ghosh, 74, Customer5, 5980
Sandip Ghosh, 34, Customer6, 54670
Sandip Ghosh, 34, Customer7, 45675
Kaushik Dhar, 55, Customer8, 15400
Kaushik Dhar, 55, Customer9, 45400
Sudhir Ghosh, 74, Customer10, 6598
Ananya Ghosh, 29, Customer2, 16200
Sudhir Ghosh, 74, Customer5, 5980
Sudhir Ghosh, 74, Customer6, 2980
Ananya Ghosh, 29, Customer2, 12900
Ananya Ghosh, 29, Customer2, 12070

];

Now I have to show top three Employee whose total means sum of sales is highest.

For that I have used the following expression

=Only({$<Sales={"$(=Max(Total Sales,3))"}>}Sales)

But the above expression only display Top three employee whose sales are highest with only highest sales amount. But I want top 3 employee whose sum of sales are highest.

Thanks,

Sandip

1 Solution

Accepted Solutions
Not applicable

Hi Sandip,

please see attached

hope that helps

Joe

View solution in original post

4 Replies
rakesh_kumar
Creator
Creator

Hi Sandip,

This thread could be helpful for you:

Top Performers; Set Analysis and Aggr Question

Regards,

RK

avinashelite

Hi Sandip,

If your using charts, then you can make use of the dimension limits, which will be very help full.

go to chart properties and dimension limits , show top dimension with your desired number ...

if you want it using expression try with Rank function

Not applicable

Hi Sandip,

please see attached

hope that helps

Joe

Anonymous
Not applicable

Hi Sandip

Try this this is semple and easy

=IF (aggr(rank( sum(Sales) ,0) , Sales )<= 3 , sum(Sales) )

Regards

Harsha