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: 
shekhar_analyti
Specialist
Specialist

What should be Single set expression for showing top 3 country wise ?

Hi All ,

I have written 4 separate set expression for displaying top 3 sales performer country wise .

But can we have a single set expression to achieve same .

Capture.PNG

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi,

see Attachment.

Regards,

Antonio

View solution in original post

4 Replies
antoniotiman
Master III
Master III

Hi,

see Attachment.

Regards,

Antonio

shekhar_analyti
Specialist
Specialist
Author

Thank Antonio for resolution .

But you have used pivot table and i see that some employee even though have highest sales are not on top or 1st record .

I was expecting a set expression producing above result

Sergey_Shuklin
Specialist
Specialist

Hello!

The expression will be:

if(aggr(rank(Sum(Sales)),Country,Emp_Nbr)<4,Sum(Sales))

and remove sorting checks to get correct sorting:

top3.png

antoniotiman
Master III
Master III

See new attachment