Weighted avg aggregation in lens

Hi together,

I currently have an request to implement via lens visualization.
We have a weighted field as runtime field (rate * traffic.count).
We want to use that field to calcuate a weighted rate with the sum of all traffic in a given timeframe.
It seems that this is possible via Elasticsearch itself Weighted avg aggregation | Elasticsearch Guide [8.3] | Elastic but not via Lens visualization.
Or do miss anyhting?
A math formular calculation like sum(rate.weighted) / overall_sum(sum(traffic.count)) does not lead to the expected result.
Any advice on this ?

I assume rate.weighted is the rate * traffic.count runtime field?

In that case, sum(rate.weighted) / sum(traffic.count) should do the trick

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