# Can we calculate in Kibana?

**URL:** <https://discuss.elastic.co/t/can-we-calculate-in-kibana/36007>\
**Category:** Kibana\
**Created:** [December 1, 2015, 8:55am UTC](https://discuss.elastic.co/t/can-we-calculate-in-kibana/36007 "2015-12-01T08:55:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit2015](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@Amit2015](https://discuss.elastic.co/u/Amit2015)\
**Post date:** [December 1, 2015, 8:55am UTC](https://discuss.elastic.co/t/can-we-calculate-in-kibana/36007/1 "2015-12-01T08:55:51Z")

</div>

Hi Guys,

I want to calculate field to get average time. Requirement is like I have request time and submitted time, two different field. I want to know how much it will take time, how can I calculate that average???

---

<div class="post-metadata">

**Author:** ![NilsBecker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nilsbecker/32/6243_2.png) [@NilsBecker](https://discuss.elastic.co/u/NilsBecker)\
**Post date:** [December 1, 2015, 9:21am UTC](https://discuss.elastic.co/t/can-we-calculate-in-kibana/36007/2 "2015-12-01T09:21:22Z")

</div>

I think you could make this with a [" **Scripted Field**"](https://www.elastic.co/guide/en/kibana/current/managing-fields.html#create-scripted-field).

---

<div class="post-metadata">

**Author:** ![Amit2015](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@Amit2015](https://discuss.elastic.co/u/Amit2015)\
**Post date:** [December 2, 2015, 4:56am UTC](https://discuss.elastic.co/t/can-we-calculate-in-kibana/36007/3 "2015-12-02T04:56:59Z")

</div>

Hey, do you have any sample or tutorial for that???? In other tools like IBM Cognos, SAP BO we can do that directly. In Kibana how can we calculate???

---

<div class="post-metadata">

**Author:** ![Pieter\_Agenbag](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pieter_agenbag/32/4562_2.png) [@Pieter\_Agenbag](https://discuss.elastic.co/u/Pieter_Agenbag)\
**Post date:** [December 2, 2015, 7:21am UTC](https://discuss.elastic.co/t/can-we-calculate-in-kibana/36007/4 "2015-12-02T07:21:11Z")

</div>

Just add a scripted field that subtracts the two values from each other and then plot an average of that value.

> [@Manually Calculate Terms within a bar chart](https://discuss.elastic.co/t/manually-calculate-terms-within-a-bar-chart/35745/4):
>
> Yup - that should be simple enough with a scripted field. Simply go to Settings choose your index and click on Scripted fields. Click "Add scripted field" and enter a name for the field Define your script , which should be "doc['status1'].value - doc['status2'].value" Done - you should now have a status3 field to use.

---

<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 6, 2017, 2:07pm UTC](https://discuss.elastic.co/t/can-we-calculate-in-kibana/36007/5 "2017-07-06T14:07:42Z")

</div>


