# Calculation

**URL:** <https://discuss.elastic.co/t/calculation/186783>\
**Category:** Kibana\
**Created:** [June 21, 2019, 1:31am UTC](https://discuss.elastic.co/t/calculation/186783 "2019-06-21T01:31:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![June](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@June](https://discuss.elastic.co/u/June)\
**Post date:** [June 21, 2019, 1:31am UTC](https://discuss.elastic.co/t/calculation/186783/1 "2019-06-21T01:31:12Z")

</div>

Greetings!  
My document consist of the fields: "abc","def" and "xyz".  
I had created a scripted field called ' **adding**' to add the value of the field "abc"and "def" within a document,  
doc['abc'].value+doc['def'].value

I would like to obtain the **sum of the documents**' **adding**', then this value **divide** by **sum of documents** field "xyz". Is there any possibility to do that?  
Thank you.

---

<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:** [July 19, 2019, 1:31am UTC](https://discuss.elastic.co/t/calculation/186783/2 "2019-07-19T01:31:19Z")

</div>

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