Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested aggregation issue with top 15 results

Hi All,

I hope you can help me with the following issue.

I am trying to get the max of an average but I am trying to do it on the top 15 results of a count, here is my code:

max(aggr(avg(NUMBER_OF_DAYS),(If(Aggr(Rank(Count(distinct if (STATUS = 'O', ID))),TYPE)<=15,TYPE))))

I tried to get max avg of number_of_days based on the set of type ranked in the top 15 for count of IDs.

Is there someone that can help me?

2 Replies
sunny_talwar

May be this (not 100% sure though):

Max(Aggr(If(Rank(Count(distinct if (STATUS = 'O', ID))),TYPE)<=15, Avg(NUMBER_OF_DAYS)), TYPE))

Not applicable
Author

Hi Sunny,

Thanks for your reply but unfortunately it is not working.