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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rank Over D

I am trying to create two separate rankings in expressions - one that ranks a value across all IDs and another that ranks the same value across a subsection of IDs. This is how I would expect it to display:

IDValueCategoryOverall RankCategory Rank
A110A11
A25A32
A38B21
A43B53
A54B42
A61A63

I can write an expression to get the overall rank, but am having no luck with ranking across a subset of the IDs. Here is the formula I'm using for both:

Overall:

Rank(TOTAL Sum({<Status={'ACTIVE'}>} Value),1, 1)

Aggr(Rank(TOTAL Sum({<Status={'ACTIVE'}>} Value),1, 1), Category)


Anyone have experience with this?

Labels (1)
1 Solution

Accepted Solutions
its_anandrjs
Champion III
Champion III

For OverAll try this

=Aggr(Rank(Sum( {<Status={'ACTIVE'}>} Value)),Category,ID)

For Category Rank

=Aggr(Rank(Sum( {<Status={'ACTIVE'}>} Value), 1, 1), Category, ID)

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

For Category, try this

Aggr(Rank(Sum({<Status={'ACTIVE'}>} Value), 1, 1), Category, ID)

its_anandrjs
Champion III
Champion III

For OverAll try this

=Aggr(Rank(Sum( {<Status={'ACTIVE'}>} Value)),Category,ID)

For Category Rank

=Aggr(Rank(Sum( {<Status={'ACTIVE'}>} Value), 1, 1), Category, ID)

Anonymous
Not applicable
Author

Thank you for the help. I got it to work using the following:

Overall:

=Aggr(Rank(Sum( {<[Status]={'ACTIVE'}>} Value), 1, 1), ID)

Category:

=Aggr(Rank(Sum( {<[Status]={'ACTIVE'}>} Value), 1, 1),Category, ID)