# Date histogram - count totals of an instance in time

**URL:** <https://discuss.elastic.co/t/date-histogram-count-totals-of-an-instance-in-time/21343>\
**Category:** Elasticsearch\
**Created:** [December 21, 2014, 2:48pm UTC](https://discuss.elastic.co/t/date-histogram-count-totals-of-an-instance-in-time/21343 "2014-12-21T14:48:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyle\_Spearrin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kyle_spearrin/32/1030_2.png) [@Kyle\_Spearrin](https://discuss.elastic.co/u/Kyle_Spearrin)\
**Post date:** [December 21, 2014, 2:48pm UTC](https://discuss.elastic.co/t/date-histogram-count-totals-of-an-instance-in-time/21343/1 "2014-12-21T14:48:24Z")

</div>

I have an index of users with a creation date timestamp. I can use ElasticSearch/Kibana to plot the doc count of users on a daily interval with the date histogram aggregate/chart. This will show me a nice result set/graph of how many new user registrations I get each day. Great!

Now I want to query/plot the total number of users in the index on per day interval -- an instance in time in the past. For example, today being Jan 3, I have a graph plotting that on Jan. 1 there were 20 total registered users, on Jan. 2 there were 100 total registered users, and on Jan. 3, 150 total users. If users cannot be deleted, this number would always be increasing, never decreasing. With the count chart that I have today (mentioned in the first paragraph), the values would be 20, 80, 50 for these days respectively.

I'm not sure what this is called. How is this done? I feel like I will have to compute these totals on a daily basis and store them. Can this result set/chart be derived from the index that I have today somehow?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/73b6d1b1-42dc-41a3-bda3-f877939ce64a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/73b6d1b1-42dc-41a3-bda3-f877939ce64a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Kyle\_Spearrin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kyle_spearrin/32/1030_2.png) [@Kyle\_Spearrin](https://discuss.elastic.co/u/Kyle_Spearrin)\
**Post date:** [December 21, 2014, 2:52pm UTC](https://discuss.elastic.co/t/date-histogram-count-totals-of-an-instance-in-time/21343/2 "2014-12-21T14:52:43Z")

</div>

Also note that this doesn't have to be done in Kibana. I am just using Kibana in this example as I play with data. I am moreso trying to understand the underlying approach to solving the problem. I.e How to store the data and how to query it out to achieve this result.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d2f15655-7a31-4ecb-af77-1129eed2e0ed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d2f15655-7a31-4ecb-af77-1129eed2e0ed%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:42am UTC](https://discuss.elastic.co/t/date-histogram-count-totals-of-an-instance-in-time/21343/3 "2017-07-06T00:42:28Z")

</div>


