# Metrics aggregation of a sub metrics aggregation

**URL:** <https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053>\
**Category:** Kibana\
**Created:** [March 10, 2016, 4:23pm UTC](https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053 "2016-03-10T16:23:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![benBA](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@benBA](https://discuss.elastic.co/u/benBA)\
**Post date:** [March 10, 2016, 4:23pm UTC](https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053/1 "2016-03-10T16:23:40Z")

</div>

Hi All,

I require a data visualisation (line chart/vertical bar chart/etc...) that displays something like the following:

X axis should group documents (i.e. top-level buckets) in months over some given time period (lets say "this year" for simplicity)

Y axis should display the average of , the counts of documents of each day , for given top-level bucket (i.e. month)

Is this possible to do in Kibana?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 12, 2016, 9:10am UTC](https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053/2 "2016-03-12T09:10:22Z")

</div>

I've moved this to the KB area (it was in ES).

Have you tried anything yet?

---

<div class="post-metadata">

**Author:** ![benBA](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@benBA](https://discuss.elastic.co/u/benBA)\
**Post date:** [March 14, 2016, 10:17am UTC](https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053/3 "2016-03-14T10:17:46Z")

</div>

I'm pretty sure this should be in the Elasticsearch area as this is a question about whether this type of search is possible... Kibana only presents what Elasticsearch returns & has nothing to do with the actual analysis / retrieval of data.

I have a meeting set up with someone from Elasticsearch this week to discuss this. The meeting is to discuss 'how to show for each top-level bucket, a metric whose value is dependent on the metrics of the sub-buckets'. I'll be sure to update this topic with any findings.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 15, 2016, 12:14am UTC](https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053/4 "2016-03-15T00:14:22Z")

</div>

Yes this is totally possible.  
It's just an average with a date histogram on the X axis.

> [@benBA](#):
>
> I'm pretty sure this should be in the Elasticsearch area as this is a question about whether this type of search is possible... Kibana only presents what Elasticsearch returns & has nothing to do with the actual analysis / retrieval of data.

Yeah but you are asking how to do it in Kibana 😉

---

<div class="post-metadata">

**Author:** ![benBA](https://avatars.discourse-cdn.com/v4/letter/b/b5a626/32.png) [@benBA](https://discuss.elastic.co/u/benBA)\
**Post date:** [March 15, 2016, 7:09pm UTC](https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053/5 "2016-03-15T19:09:06Z")

</div>

When I choose "average" aggregation for Y-Axis, there is then a drop down box that shows numeric fields. I can only take the average of these numeric fields - there is no option to choose counts of sub-buckets

---

<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:59pm UTC](https://discuss.elastic.co/t/metrics-aggregation-of-a-sub-metrics-aggregation/44053/6 "2017-07-06T13:59:02Z")

</div>


