# In kibana how to draw a graph which should give me average time given with 2 dates(start date & end date)

**URL:** <https://discuss.elastic.co/t/in-kibana-how-to-draw-a-graph-which-should-give-me-average-time-given-with-2-dates-start-date-end-date/214861>\
**Category:** Kibana\
**Created:** [January 13, 2020, 3:29pm UTC](https://discuss.elastic.co/t/in-kibana-how-to-draw-a-graph-which-should-give-me-average-time-given-with-2-dates-start-date-end-date/214861 "2020-01-13T15:29:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amarsha\_N.G](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amarsha_n.g/32/59635_2.png) [@Amarsha\_N.G](https://discuss.elastic.co/u/Amarsha_N.G)\
**Post date:** [January 13, 2020, 3:29pm UTC](https://discuss.elastic.co/t/in-kibana-how-to-draw-a-graph-which-should-give-me-average-time-given-with-2-dates-start-date-end-date/214861/1 "2020-01-13T15:29:01Z")

</div>

I am having 2 date field one is PR open date other isPR closed date in my ES \_source with PR num, project name, etc.  
Now In kibana I want to draw a graph which should give me average time to close a PR.  
how to achieve this?  
one more doubt how to do mathematical operation on 2 fields of same data type for ex: addition of filed1 + field 2 or subtraction of field1 - field 2

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [January 14, 2020, 4:24am UTC](https://discuss.elastic.co/t/in-kibana-how-to-draw-a-graph-which-should-give-me-average-time-given-with-2-dates-start-date-end-date/214861/2 "2020-01-14T04:24:20Z")

</div>

Hello @Amarsha_N.G - Have you tried using scripted fields? [https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

---

<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:** [February 11, 2020, 4:24am UTC](https://discuss.elastic.co/t/in-kibana-how-to-draw-a-graph-which-should-give-me-average-time-given-with-2-dates-start-date-end-date/214861/3 "2020-02-11T04:24:25Z")

</div>

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