Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
lockematthewp
Creator II
Creator II

Average Age of top 5

I am currently trying to show the average age of the top 5 oldest cases. I have a few fields including [Case Number] and [Age]. I believe that the result will be similar to:

Avg({<Age = {"=Rank(Age),4)<=5"}>}Age)

But this is not returning any result. I would really appreciate any help with this. Thank you

1 Solution

Accepted Solutions
sunny_talwar

May be the same set expression is needed in the rank function also?

Avg({<Critical = {Yes}, Status = {Active}, Age = {"=Rank(Only({<Critical = {Yes}, Status = {Active}>} Age), 4) <= 5"}>} Age)

View solution in original post

3 Replies
sunny_talwar

Try this... you had an additional parenthesis

Avg({<Age = {"=Rank(Age, 4) <= 5"}>} Age)
lockematthewp
Creator II
Creator II
Author

Thank you Sunny. That did help. I am now adding some set analysis but I am unable to get the result I want. This is what I have so far:

Avg({<Critical = {Yes}, Status = {Active}, Age = {"=Rank(Age, 4) <= 5"}>} Age)

sunny_talwar

May be the same set expression is needed in the rank function also?

Avg({<Critical = {Yes}, Status = {Active}, Age = {"=Rank(Only({<Critical = {Yes}, Status = {Active}>} Age), 4) <= 5"}>} Age)

View solution in original post