# About a moving average bucket, as input for another aggregation

**URL:** <https://discuss.elastic.co/t/about-a-moving-average-bucket-as-input-for-another-aggregation/138135>\
**Category:** Elasticsearch\
**Created:** [July 2, 2018, 7:32am UTC](https://discuss.elastic.co/t/about-a-moving-average-bucket-as-input-for-another-aggregation/138135 "2018-07-02T07:32:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olc-olivier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olc-olivier/32/21845_2.png) [@olc-olivier](https://discuss.elastic.co/u/olc-olivier)\
**Post date:** [July 2, 2018, 7:32am UTC](https://discuss.elastic.co/t/about-a-moving-average-bucket-as-input-for-another-aggregation/138135/1 "2018-07-02T07:32:19Z")

</div>

Hi,

I asked a question on Stackoverflow but nobody seems to have a solution for my request.

> <https://stackoverflow.com/questions/51025822/on-elasticsearch-define-sub-aggregations-after-a-moving-average-aggregation>

I would like to use the moving average bucket as input source for a another aggregation.  
ex: Max by day on the moving average (4 hours)  
Document (timestamp, value)

How can I do it ?

Thx.

---

<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 30, 2018, 7:43am UTC](https://discuss.elastic.co/t/about-a-moving-average-bucket-as-input-for-another-aggregation/138135/2 "2018-07-30T07:43:59Z")

</div>

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