Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ranking

Good Day Qlik-Nation,

I am trying to rank the attached spreadsheet on my dashboard and I am using the following expression however it does no seem to be ranking correctly if i try to add another dimension...Please help...

(Gender='Male', Div(Index('-' & Concat(DISTINCT TOTAL num(aggr(rank(Score,1,1),Name), '0000'), '-', -Score),num(rank(max(Score),1,1),'0000' ) ),5)+1)

and/or

if(Gender='Male', num(rank(Score)))

6 Replies
datanibbler
Champion
Champion

Hi Sanjeev,

and by what do you want to rank them?

Understanding a formula without knowing what it's supposed to be doing is a bit hard - once you know the desired outcome, thinking out ways how to get there is much easier - likewise for supporters - it's a lot easier to tell why your formula isn't doing what you want when you tell what you actually want your formula to do 😉

Best regards,

DataNibbler

Not applicable
Author

Hi DataNibbler,

I want to rank them by Score, Age, Gender and Area.

Regards,

Sanjeev

datanibbler
Champion
Champion


Hi Sanjeev,

in that order? What keeps you then from just inserting an "ORDER BY" in the script?

<=> That can only be done in a RESIDENT LOAD - but that doesn't add much runtime once your data is loaded.

=> The syntax would then be

LOAD

   ...

   ...

RESIDENT [tablename from first LOAD]

ORDER BY Score, Age, Gender, Area

;

By default, unless you specify it otherwise, all the fields are ordered (first by Score, then by Age etc.) in ascending order - unless you type "desc" behind each field where it's applicable.

HTH

Best regards,

DataNibbler

Not applicable
Author

Thanks DataNibbler. I will try that.

vikasmahajan

Try this you need to use AGGR with Rank

Aggr(num( rank( sum(Score ), 4)), Age, Gender and Area.)

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
vikasmahajan

pfa attached

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.