# How to create a table with cummlative sum and display only final value for given data histogram

**URL:** <https://discuss.elastic.co/t/how-to-create-a-table-with-cummlative-sum-and-display-only-final-value-for-given-data-histogram/169336>\
**Category:** Elasticsearch\
**Created:** [February 21, 2019, 6:22am UTC](https://discuss.elastic.co/t/how-to-create-a-table-with-cummlative-sum-and-display-only-final-value-for-given-data-histogram/169336 "2019-02-21T06:22:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![balamurali1](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@balamurali1](https://discuss.elastic.co/u/balamurali1)\
**Post date:** [February 21, 2019, 6:22am UTC](https://discuss.elastic.co/t/how-to-create-a-table-with-cummlative-sum-and-display-only-final-value-for-given-data-histogram/169336/1 "2019-02-21T06:22:35Z")

</div>

Hi ,

I am looking an option how to create a table with cumulative sum displayed over a date histogram but only the final value needs to be displayed

I have used the table visualization and used cumulative sum and used sum bucket of the field with parent as date histogram on time stamp.

However my values are displayed at each day level. I need to get only the final value.

I dont want to use single value visualization as I need to show in table format with two three aggregations and also show the same for previous year.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 21, 2019, 7:45am UTC](https://discuss.elastic.co/t/how-to-create-a-table-with-cummlative-sum-and-display-only-final-value-for-given-data-histogram/169336/2 "2019-02-21T07:45:08Z")

</div>

I'm not sure to understand and a full example could help, but may be you can run a multisearch query with one query filtered on the current year and another on the past year?

Or first use two [filter aggs](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html) one for past year and another for this year, then do inside the other aggs you need.

---

<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:** [March 21, 2019, 7:45am UTC](https://discuss.elastic.co/t/how-to-create-a-table-with-cummlative-sum-and-display-only-final-value-for-given-data-histogram/169336/3 "2019-03-21T07:45:10Z")

</div>

Closed on March 21, 2019, 7:45am UTC

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