Announcements
cancel
Showing results for
Did you mean:
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
MVP

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)`
3 Replies
MVP

`Avg({<Age = {"=Rank(Age, 4) <= 5"}>} Age)`
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)

MVP

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)`
Community Browser