# Cusum() with date range (Timelion)

**URL:** <https://discuss.elastic.co/t/cusum-with-date-range-timelion/185153>\
**Category:** Kibana\
**Created:** [June 11, 2019, 9:59am UTC](https://discuss.elastic.co/t/cusum-with-date-range-timelion/185153 "2019-06-11T09:59:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_d/32/47351_2.png) [@Thomas\_D](https://discuss.elastic.co/u/Thomas_D)\
**Post date:** [June 11, 2019, 9:59am UTC](https://discuss.elastic.co/t/cusum-with-date-range-timelion/185153/1 "2019-06-11T09:59:13Z")

</div>

Hi,

I wanted to know if it's possible to do a cusum() who decrease or increase according to dates range.

For example if I have 2 data like these : { amount : 300, beginning\_date: "2019-06-01T00:00:00Z", ending\_date : "2019-06-30T00:00:00Z" }  
{ amount :200, beginning\_date: "2019-06-15T00:00:00Z", ending\_date : "2019-07-15T00:00:00Z" }

Can i have an amount of 300 at June 1st, 500 at 15th June and 200 at July 1st?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![christophilus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christophilus/32/42991_2.png) [@christophilus](https://discuss.elastic.co/u/christophilus)\
**Post date:** [July 2, 2019, 7:06pm UTC](https://discuss.elastic.co/t/cusum-with-date-range-timelion/185153/2 "2019-07-02T19:06:51Z")

</div>

Cusum is cumulative, so, if I'm understanding your question, the answer is no. What exactly are you trying to do? Maybe there's another way?

---

<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:** [July 30, 2019, 7:06pm UTC](https://discuss.elastic.co/t/cusum-with-date-range-timelion/185153/3 "2019-07-30T19:06:54Z")

</div>

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