Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
waleeed_mahmood
Creator
Creator

Rank in proper order

Hello,

 

I have a table where i want to show top 10 sales employees based on Achievement. The issue is i cant seem to sort the Rank in descending order for the life of me. They are placed randomly and i cant figure out why.

Looking at the table below, Rank 1 should be assigned to Top Achievement but its not.

My rank formula is: aggr(RANK(Achievement formula,4,0),Sales Employee)

any idea how to fix that?

Table format is like :

Rank Images Sales Employee Achievement
1 img1 SE1 36.8%
2 img2 SE2 35.7%
3 img3 SE3 18.0%
4 img4 SE4 30.3%
5 img5 SE5 27.2%
6 img6 SE6 27.7%
7 img7 SE7 234.5%
8 img8 SE8 5.5%
9 img9 SE9 68.0%
10 img10 SE10 7.1%

 

Thanks

Labels (1)
1 Solution

Accepted Solutions
waleeed_mahmood
Creator
Creator
Author

Hi Everyone,

 

Thank you for your support.

How i solved this issue was, i put an IF statement inside the aggr() and only showed RANK where RANK() resulted in top 10.

Thanks,

WM

View solution in original post

4 Replies
Anil_Babu_Samineni

@waleeed_mahmood perhaps this,

aggr(RANK(Achievement formula,4,0),

("Sales Employee", (NUMERIC, DESCENDING))) 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Aasir
Creator III
Creator III

Your case may be a cause of default sorting set in data manager. Please amend your formula like this. Hope this helps.

aggr(RANK(Sum({<Achievement={'*'}>} [Achievement]), 4, 0), [Sales Employee])

I just included a set analysis.

waleeed_mahmood
Creator
Creator
Author

Hi Anil,

 

I didnt know you could sort in aggr(). thanks.

waleeed_mahmood
Creator
Creator
Author

Hi Everyone,

 

Thank you for your support.

How i solved this issue was, i put an IF statement inside the aggr() and only showed RANK where RANK() resulted in top 10.

Thanks,

WM