# Build aggregation on top of doc\_count of date histogram?

**URL:** https://discuss.elastic.co/t/build-aggregation-on-top-of-doc-count-of-date-histogram/132502
**Category:** Elasticsearch
**Created:** [May 18, 2018, 2:27pm UTC](https://discuss.elastic.co/t/build-aggregation-on-top-of-doc-count-of-date-histogram/132502 "2018-05-18T14:27:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander\_Sviridov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander_sviridov/32/31375_2.png) [@Alexander\_Sviridov](https://discuss.elastic.co/u/Alexander_Sviridov)
#### Post date: [May 18, 2018, 2:27pm UTC](https://discuss.elastic.co/t/build-aggregation-on-top-of-doc-count-of-date-histogram/132502/1 "2018-05-18T14:27:16Z")

</div>

Hello!  
I want to implement Control Chart as it described here: [https://www.elastic.co/blog/staying-in-control-with-moving-averages-part-2](https://www.elastic.co/blog/staying-in-control-with-moving-averages-part-2), but I do not have metrics — I have events with timestamps.

So my idea was to make the date histogram, and then use resulting doc\_count as source for moving averages as described in a blog post. But I cannot figure out how to do it.

Is it possible? Thank you!

---

<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: [June 15, 2018, 2:27pm UTC](https://discuss.elastic.co/t/build-aggregation-on-top-of-doc-count-of-date-histogram/132502/2 "2018-06-15T14:27:22Z")

</div>

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