# Is there any way to create cumulative Average aggregation similar to cumulative Sum

**URL:** <https://discuss.elastic.co/t/is-there-any-way-to-create-cumulative-average-aggregation-similar-to-cumulative-sum/127566>\
**Category:** Elasticsearch\
**Created:** [April 11, 2018, 4:39am UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-cumulative-average-aggregation-similar-to-cumulative-sum/127566 "2018-04-11T04:39:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinoz1990](https://avatars.discourse-cdn.com/v4/letter/v/ea666f/32.png) [@vinoz1990](https://discuss.elastic.co/u/vinoz1990)\
**Post date:** [April 11, 2018, 4:39am UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-cumulative-average-aggregation-similar-to-cumulative-sum/127566/1 "2018-04-11T04:39:33Z")

</div>

I have tried using bucket script to calculate cumulative average since bucket script cant be used in kibana.  
is there any other way to calculate cumulative Average?

I have a field Defect Density with respect to months.  
now i have to find Cumulative Average and display it in Kibana.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/f/6f19fbfcdeb5f652203fd32061dc47d405ea247e.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/b/2b052424b3a55b9a297bcabf7898066e343f2bcb.png)

---

<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:** [May 9, 2018, 4:39am UTC](https://discuss.elastic.co/t/is-there-any-way-to-create-cumulative-average-aggregation-similar-to-cumulative-sum/127566/2 "2018-05-09T04:39:45Z")

</div>

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