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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rank, Aggr to sort expression values in a descending order?

I'm working on a dashboard for a client, hence why I cannot post examples.

I have table boxes displaying Revenue for Top 5 courses, when I select a country/region, the courses are displayed in a rank from highest to lowest revenue. When I make a data range selection, the rank does not apply any longer, instead the names of the courses remain in the same, but the revenue changes, meaning course 2 has lower revenue than course 5, meaning these two courses should swap places.

Example:

1.JPG.jpg

Now when I select a month, this happens:

2.JPG.jpg

you can see how course 3 had a higher revenue than course 2. Any idea how I can get QlikView to sort the courses when I make a date selection?

This is what I use to calculate the top revenue courses:

Aggr(NODISTINCT Rank(Sum({$<Year=, Month=, YearMonth=,

CourseGroupName-={'Expense', 'Other'}, CourseCode-={'Company Course'}>} $(Revenue))), CourseCode)

any ideas?

2 Replies
Not applicable
Author

Hello,

Maybe you can change the presentation using a bar char and present top 5 or top3 Courses and just display revenue order by Y Value.

Best regards.

Top.png

maxgro
MVP
MVP

just an idea, what about something like

AGGR(nodistinct if(Rank(sum(Expression1))=N,sum(Expression1)),  Product)

where N = 1, 2, 3, 4, 5