Avarage without outliers

(liorg2) #1

Is it possible to find the avarage without outliers using elasticsearch query? Im still using elasticsearch 1.7...

Also an option to find the avarage of all the values below the 95th percentile


(Adrien Grand) #2

This is not possible . I guess you could get an approximation of this number by running a histogram aggregation on your field and then computing the weighted average of the bucket keys excluding keys that are above the 95th percentile on client side.

(Adrien Grand) #3

Or you could do it in two search requests: a first one that computes the 95th percentile and a second one that adds a filter so that values are below this 95th percentile and runs an average aggregation.

(liorg2) #4

I saw this great article, but it uses version 2 features


(system) #5