# How to sum date values in kibana

**URL:** <https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822>\
**Category:** Kibana\
**Created:** [December 21, 2018, 9:42am UTC](https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822 "2018-12-21T09:42:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![suripaleru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suripaleru/32/32286_2.png) [@suripaleru](https://discuss.elastic.co/u/suripaleru)\
**Post date:** [December 21, 2018, 9:42am UTC](https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822/1 "2018-12-21T09:42:36Z")

</div>

How we can perform sum chart for date values in Kibana ? I have a field with date in the format of HH:MM:SS and type as date in Kibana fields. But this field is not visible under SUM aggregation.

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [December 22, 2018, 12:57am UTC](https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822/2 "2018-12-22T00:57:57Z")

</div>

Sounds like you're actually looking for a "duration" field. I recommend storing your duration in seconds and using an `interger` type field, then you can sum up the seconds and use a "Duration" field formatter for the index pattern to have it formatted as `HH:MM:SS` at display time.

---

<div class="post-metadata">

**Author:** ![suripaleru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suripaleru/32/32286_2.png) [@suripaleru](https://discuss.elastic.co/u/suripaleru)\
**Post date:** [December 22, 2018, 3:00am UTC](https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822/3 "2018-12-22T03:00:40Z")

</div>

Thank you for your response.

I tried this already but in Kibana visualization, sum metric is not working on date fields with duration format as hh:mm:ss

I tried sum bucket but that is also not worked. Could you please correct me where I need to do changes ?

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [December 22, 2018, 3:13am UTC](https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822/4 "2018-12-22T03:13:19Z")

</div>

Right, it shouldn't be a date field. It should be a number feild that stores seconds.

Summing up the seconds works like any other number, but you can **format** the numbers as a duration using the field formatters in your Kibana index pattern.

---

<div class="post-metadata">

**Author:** ![suripaleru](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suripaleru/32/32286_2.png) [@suripaleru](https://discuss.elastic.co/u/suripaleru)\
**Post date:** [December 22, 2018, 4:35pm UTC](https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822/5 "2018-12-22T16:35:55Z")

</div>

Thank you , but still here, format field for number type can be viewed as duration but not in HH:MM:SS format.

Kibana seems showing only hours or minutes or human readable format like 2 month etc.

I would like to view sum of seconds in the format of HH:MM:SS. Could you help me ?

---

<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:** [January 19, 2019, 4:36pm UTC](https://discuss.elastic.co/t/how-to-sum-date-values-in-kibana/161822/6 "2019-01-19T16:36:01Z")

</div>

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