
Creator II
2019-08-29
07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
533 Views
2 Replies


MVP
2019-08-29
10:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem isn't the rank() else that you nest aggregations without using aggr(). Take a look here: AGGR.
- Marcus
510 Views

Creator II
2019-09-02
07:02 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok ill have a loot at that.
Thanks.
493 Views
