Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

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

The logic is:

firstsortedvalue(ReturnField, LookupExpression, SortField, RankNumber)

max(Field, RankNumber)

- Marcus