# Aggregation that multiplies averages

**URL:** <https://discuss.elastic.co/t/aggregation-that-multiplies-averages/220680>\
**Category:** Elasticsearch\
**Created:** [February 24, 2020, 2:53pm UTC](https://discuss.elastic.co/t/aggregation-that-multiplies-averages/220680 "2020-02-24T14:53:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saif3r](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@saif3r](https://discuss.elastic.co/u/saif3r)\
**Post date:** [February 24, 2020, 2:53pm UTC](https://discuss.elastic.co/t/aggregation-that-multiplies-averages/220680/1 "2020-02-24T14:53:24Z")

</div>

Hello,

With following dataset:

```
area	type result
bld1	inspection	1
bld1	inspection	1
bld1	inspection	0
bld1	packing 1
bld1	packing 0
bld1	packing 0
bld1	inspection	1
bld1	packing 0

```

I would like to visualize a metric in Kibana that will show a multiplication of an average for each **type**. So we would calculate it like this  
Inspection avg: (1 + 1 + 0 + 1)/4 = 0,75  
Packing avg: (1 + 0 + 0 + 0)/4 = 0,25  
So the metric in Kibana would show 0,75 \* 0,25 = 0,1875.  
Please note that there might be multiple areas in my index. Also, the number of **types** can be different depending on **area**.  
I guess that Pipeline Aggregation might handle that but i can't wrap my head around it yet.  
I'd appreciate the tips.  
Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 23, 2020, 2:53pm UTC](https://discuss.elastic.co/t/aggregation-that-multiplies-averages/220680/2 "2020-03-23T14:53:28Z")

</div>

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