Display growing count of objects

I am registering subscribers in my Elasticsearch database. Each subscriber has a CREATED_AT timestamp field. And I can create a chart that shows how many new subscribers I get each day. This is easily done just by grouping the documents into timestamp buckets.

But what if I need to show an ever-growing amount of users each day? For example:

  • on June 1st I had total 15 users (counting all objects with CREATED_AT <= June 1st)
  • on June 2nd I had 4 new users and a total of 19 users (counting all objects with CREATED_AT <= June 2nd)
  • on June 3rd I had 10 new users and a total of 29 users (counting all objects with CREATED_AT <= June 3rd)
  • etc

And this should result in a timeseries data like this:


June 1st: 15
June 2nd: 19
June 3rd: 29
...

What aggregation should I pick for this?

Just plot the numbers of documents (aka users) by timestamp (bar chart or plot or whatever) and set minimum interval to daily in the x-axis date histogram specifications.
It will show how many documents (filtered if necessary to get only new users) indexed each days.

thanks, but which one of these aggregations is the number of documents by timestamp? I only see count, and this count is separate for each day, it does not include counts for all previous timestamps.

Count, as described here.

Count does not work for me, because In my case, the count will show:

June 1st: 15
June 2nd: 4
June 3rd: 10
...

but I need something that would show an ever-incrementing value:

June 1st: 15
June 2nd: 19
June 3rd: 29
...

where each bucket includes counts for all previous days + its own count.

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