I'm trying to create a custom aggregation for buckets of time (I'm also using the date histogram) on a certain field following the formula:
I is all the values in the bucket of time.
I'm having a hard time calculating the mean of squared of values (
mean(I)^2 is easy to do using the avg. aggregate ES provides already.
Is there any way I could achieve this without doing the aggregation myself?