Calculating average of values in a percentile

(Simon Oxwell) #1


I'm reproducing an old client report, and have discovered that what was reported as an average, was in fact the average of 90% of the available data (ie, the top 10% of the count of values was removed)

Is there a way of calculating the average of data that falls within the 90th percentile in Elasticsearch? I'm on Elasticsearch 5.4.0.



(D Pattee) #2

The percentiles aggregation should give you what you want...

You don't have to ask for an array of percentiles, you can ask for just a single one.

(Simon Oxwell) #3

Hi DPattee,

From what I understand that will give me the value of the 90th percentile, but I can't see how to a calculate the average of all the values in my dataset (a bucket?) that are less than or equal to the 90th percentile.



(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.