# Timelion- aggreation on aggregation (max (avg) )

**URL:** https://discuss.elastic.co/t/timelion-aggreation-on-aggregation-max-avg/113657
**Category:** Kibana
**Tags:** timelion
**Created:** [December 31, 2017, 1:09pm UTC](https://discuss.elastic.co/t/timelion-aggreation-on-aggregation-max-avg/113657 "2017-12-31T13:09:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yoavsradware](https://avatars.discourse-cdn.com/v4/letter/y/e9c0ed/32.png) [@yoavsradware](https://discuss.elastic.co/u/yoavsradware)
#### Post date: [December 31, 2017, 1:09pm UTC](https://discuss.elastic.co/t/timelion-aggreation-on-aggregation-max-avg/113657/1 "2017-12-31T13:09:38Z")

</div>

I am using kibana 5.6.3  
I am getting x events every minute  
I would like to take an interval (according to my bucket size ) and do :

> max((event1.value+event2.value ...+eventN.value)/N) =x

one thing I ca do is

> max (sum(event1.value,event2.value.,eventN.value)/N) = x

and in the end :

> max(AVG(event1.value....eventN.value))=x

which means max (avg) , how can I do it using timelion ?

how can I do it

UPDATE  
managed to do it by doing .max(term\_which return\_time\_series)

---

<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: [January 28, 2018, 1:09pm UTC](https://discuss.elastic.co/t/timelion-aggreation-on-aggregation-max-avg/113657/2 "2018-01-28T13:09:53Z")

</div>

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