# Datatable config case help, sum from start to today

**URL:** https://discuss.elastic.co/t/datatable-config-case-help-sum-from-start-to-today/68316
**Category:** Kibana
**Created:** [December 7, 2016, 3:01pm UTC](https://discuss.elastic.co/t/datatable-config-case-help-sum-from-start-to-today/68316 "2016-12-07T15:01:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![joodies](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joodies/32/13630_2.png) [@joodies](https://discuss.elastic.co/u/joodies)
#### Post date: [December 7, 2016, 3:01pm UTC](https://discuss.elastic.co/t/datatable-config-case-help-sum-from-start-to-today/68316/1 "2016-12-07T15:01:03Z")

</div>

Assuming i have data as follow in ES,  
Date Qty  
2016-12-01 1  
2016-12-01 1  
2016-12-02 1  
2016-12-04 1

then i need a data-table in Kibana 5.0, sum Qty from the very start to end of today  
Date Qty  
2016-12-01 2  
2016-12-02 3  
2016-12-03 3  
2016-12-04 4

any suggestion would be appreciate. 🙂

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [December 7, 2016, 8:20pm UTC](https://discuss.elastic.co/t/datatable-config-case-help-sum-from-start-to-today/68316/2 "2016-12-07T20:20:24Z")

</div>

You can't do this with a data table with Kibana, but you could set this up in Timelion and use the cumulative sum function.

---

<div class="post-metadata">

### Author: ![joodies](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joodies/32/13630_2.png) [@joodies](https://discuss.elastic.co/u/joodies)
#### Post date: [December 8, 2016, 5:56am UTC](https://discuss.elastic.co/t/datatable-config-case-help-sum-from-start-to-today/68316/3 "2016-12-08T05:56:57Z")

</div>

hi, can i cusum a field value? seem the default is counting row count

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [December 8, 2016, 10:20pm UTC](https://discuss.elastic.co/t/datatable-config-case-help-sum-from-start-to-today/68316/4 "2016-12-08T22:20:05Z")

</div>

You need to specify the sum aggregation for your metric in the `.es()` function. Try something like:

```auto
.es(index=my_quantities_index, timefield=my_date_field, metric=sum:my_quantity_field).cusum()

```

---

<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 5, 2017, 10:20pm UTC](https://discuss.elastic.co/t/datatable-config-case-help-sum-from-start-to-today/68316/5 "2017-01-05T22:20:23Z")

</div>

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