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

2nd or 3rd highest value

I have a list of categories each with an average score 'avg(EasyScore)'. I can use the first sorted value to generate the category with the highest average score but is there a way of getting the 2nd, 3rd or nth highest score. Maybe a combination of rank and agrr? The category field is 'SubSubCategory'.

3 Replies
marcus_sommer
MVP
MVP

By firstsortedvalue() and by max() could by using the fourth respectively second parameter any other value be returned.

- Marcus

Anonymous
Not applicable
Author

FirstSortedValue(SubSubCategory, -aggr(avg(EasyScore),SubSubCategory)) would give me the highest SubSubCategory by EasyScore. Where would i use max to give me the second highest?

marcus_sommer
MVP
MVP

The logic is:

firstsortedvalue(ReturnField, LookupExpression, SortField, RankNumber)

max(Field, RankNumber)

- Marcus