# Aggregations: Year over Year, Week over Week

**URL:** <https://discuss.elastic.co/t/aggregations-year-over-year-week-over-week/19800>\
**Category:** Elasticsearch\
**Created:** [September 15, 2014, 9:33pm UTC](https://discuss.elastic.co/t/aggregations-year-over-year-week-over-week/19800 "2014-09-15T21:33:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nascosto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nascosto/32/1284_2.png) [@nascosto](https://discuss.elastic.co/u/nascosto)\
**Post date:** [September 15, 2014, 9:33pm UTC](https://discuss.elastic.co/t/aggregations-year-over-year-week-over-week/19800/1 "2014-09-15T21:33:06Z")

</div>

Assuming I have a date field on a document, I know using the date\_histogram  
aggregation I can get a document count by day, month, year, etc.

What I want to do is get the average document count for January, February,  
March, etc. over several given years. The same goes for Monday, Tuesday,  
Wednesday, etc. over several given weeks. Is there a way to do this having  
just that same date field or what is the best way to accomplish this with  
Elasticsearch?

--  
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/027a9e40-d307-4caa-8482-4830108ad353%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/027a9e40-d307-4caa-8482-4830108ad353%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, 1:02am UTC](https://discuss.elastic.co/t/aggregations-year-over-year-week-over-week/19800/2 "2017-07-06T01:02:08Z")

</div>


