Qlik Community

Qlik Sense App Development

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

joshpinfoldold
New 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

Re: 2nd or 3rd highest value

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

- Marcus

joshpinfoldold
New Contributor III

Re: 2nd or 3rd highest value

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?

Re: 2nd or 3rd highest value

The logic is:

firstsortedvalue(ReturnField, LookupExpression, SortField, RankNumber)

max(Field, RankNumber)

- Marcus

Community Browser