# Report query results back to elastic for weekly/monthly/yearly aggregations?

**URL:** <https://discuss.elastic.co/t/report-query-results-back-to-elastic-for-weekly-monthly-yearly-aggregations/64375>\
**Category:** Elasticsearch\
**Created:** [October 30, 2016, 2:32pm UTC](https://discuss.elastic.co/t/report-query-results-back-to-elastic-for-weekly-monthly-yearly-aggregations/64375 "2016-10-30T14:32:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shirly\_Radco](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Shirly\_Radco](https://discuss.elastic.co/u/Shirly_Radco)\
**Post date:** [October 30, 2016, 2:32pm UTC](https://discuss.elastic.co/t/report-query-results-back-to-elastic-for-weekly-monthly-yearly-aggregations/64375/1 "2016-10-30T14:32:04Z")

</div>

Hi,

Is there a good way to report query results back to elastic for weekly/monthly/yearly aggregations ?

Best regards,  
Shirly Radco

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [October 31, 2016, 10:50am UTC](https://discuss.elastic.co/t/report-query-results-back-to-elastic-for-weekly-monthly-yearly-aggregations/64375/2 "2016-10-31T10:50:57Z")

</div>

You can use a `date_histogram` aggregation [1] on order to group the data based on time intervals and then as a child aggregation you can then add another aggregation (for example max, min etc.) that then computes statistics per interval.

1: [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-aggregations-bucket-datehistogram-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-aggregations-bucket-datehistogram-aggregation.html)

---

<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 5, 2017, 10:08pm UTC](https://discuss.elastic.co/t/report-query-results-back-to-elastic-for-weekly-monthly-yearly-aggregations/64375/3 "2017-07-05T22:08:19Z")

</div>


