# Running Total of Living Population

**URL:** <https://discuss.elastic.co/t/running-total-of-living-population/227998>\
**Category:** Kibana\
**Created:** [April 14, 2020, 9:03pm UTC](https://discuss.elastic.co/t/running-total-of-living-population/227998 "2020-04-14T21:03:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sivel/32/66320_2.png) [@sivel](https://discuss.elastic.co/u/sivel)\
**Post date:** [April 14, 2020, 9:03pm UTC](https://discuss.elastic.co/t/running-total-of-living-population/227998/1 "2020-04-14T21:03:38Z")

</div>

Let's assume that I have a data set that includes a single document per person. The data will include a `bornOn` and `diedOn` field. `diedOn` may not have a value.

I was looking at creating a Timelion that shows me a running total of living population. I'm not super knowledgeable about Timelion, and I'm not sure how I can effectively filter per item between `bornOn` and `diedOn` based on the date being rendered.

I get that something like the following is a cumulative sum of people that ever lived, but I need to compare whether that person was actually alive based on the date being rendered:

```auto
.es(index=population, timefield=bornOn).cusum()

```

Any tips?

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [April 14, 2020, 10:19pm UTC](https://discuss.elastic.co/t/running-total-of-living-population/227998/2 "2020-04-14T22:19:56Z")

</div>

Hmm, I can't think of any way to accomplish this at the current time, since there is no way to access the end of the date range when creating a filter or writing a script.

---

<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:** [May 12, 2020, 10:19pm UTC](https://discuss.elastic.co/t/running-total-of-living-population/227998/3 "2020-05-12T22:19:59Z")

</div>

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