Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
joshpinfoldold
Contributor III
Contributor III

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 & Luminary
MVP & Luminary

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

- Marcus

joshpinfoldold
Contributor III
Contributor III
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 & Luminary
MVP & Luminary

The logic is:

firstsortedvalue(ReturnField, LookupExpression, SortField, RankNumber)

max(Field, RankNumber)

- Marcus