# Sum duration activties

**URL:** <https://discuss.elastic.co/t/sum-duration-activties/40294>\
**Category:** Kibana\
**Created:** [January 27, 2016, 10:22pm UTC](https://discuss.elastic.co/t/sum-duration-activties/40294 "2016-01-27T22:22:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [January 29, 2016, 2:48pm UTC](https://discuss.elastic.co/t/sum-duration-activties/40294/2 "2016-01-29T14:48:21Z")

</div>

If I'm understanding your use case correctly, I think a [scripted field](https://www.elastic.co/guide/en/kibana/current/managing-fields.html#create-scripted-field) would solve the problem.

You could create a scripted field called `time_connected`:

doc.['end\_connection'].value - doc.['begin\_connection'].value

And then you could visualize this field in the Visualize tab. If that's not what you're looking for, please provide more details on what you're trying to achieve.

---

_[View the full topic](https://discuss.elastic.co/t/sum-duration-activties/40294)._
