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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
schmidtj
Creator II
Creator II

Average of data within a range of percentiles

Hi,

i have the following set of data (see attachment):

A dimension '_id' with a value 'durationSeconds'.

Furthermore i calculated the percentile of each row like this:

rank(Total - durationSeconds, 3)/count(Total durationSeconds)

 

My goal is now to:

calculate the average of the values, however only among those rows, where the percentile is <= 0.8.

However, integrating the formular for the average is not allowed

(Rank function is not allowed inside aggregation)

Avg(if(rank(Total - durationSeconds,3)/count(Total durationSeconds) <= 0.8, durationSeconds))

 

Can anybody help me with this problem?

Thanks a lot.

2 Replies
marcus_sommer

The problem isn't the rank() else that you nest aggregations without using aggr(). Take a look here: AGGR.

- Marcus

schmidtj
Creator II
Creator II
Author

Ok ill have a loot at that.

Thanks.