# How to do multiple aggregations in kibana?

**URL:** <https://discuss.elastic.co/t/how-to-do-multiple-aggregations-in-kibana/68343>\
**Category:** Kibana\
**Created:** [December 7, 2016, 6:13pm UTC](https://discuss.elastic.co/t/how-to-do-multiple-aggregations-in-kibana/68343 "2016-12-07T18:13:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sabyasachi\_mallick](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@sabyasachi\_mallick](https://discuss.elastic.co/u/sabyasachi_mallick)\
**Post date:** [December 7, 2016, 6:13pm UTC](https://discuss.elastic.co/t/how-to-do-multiple-aggregations-in-kibana/68343/1 "2016-12-07T18:13:32Z")

</div>

I have multiple date fileds in my kibana index. of which i want to plot my data over two date histogram fields independently to show a trend . i want to do it in a single graph. But kibana does not have option to do more than one aggregation in a single visualization.  
Is there any way to do ?

Problem specific Description:  
i have bugs as data in my elastic index. in each row there is a filed 'big creation date' and another date field is also there named 'resolved date' .  
if bug is not resolved then resolved date is null  
i want to plot trend of bugs ,created and resolved over monthly in a single graph.  
problem is , if i am choosing creation date as aggregation then it is taking those rows corresponds to creation date , it is not taking resolved date as independent aggregation.  
Any other way to solve this problem?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [December 7, 2016, 10:16pm UTC](https://discuss.elastic.co/t/how-to-do-multiple-aggregations-in-kibana/68343/2 "2016-12-07T22:16:53Z")

</div>

There's a way to get the data into a single graph in Timelion, you can just do an expression like:

```auto
.es(timefield=creation_date) .es(timefield=resolved_date)

```

That will get you 2 lines, where one has the count of bugs created per date, and the other line has the count of bugs resolved per date.

> if bug is not resolved then resolved date is null

Maybe you'll want a 3rd line that queries for the count of open bugs, using

```auto
.es(q='NOT _exists_:resolved_date')

```

Make sure to read the Docs that are in the Timelion app. The `.es` function has a lot of options that can help your query.

---

<div class="post-metadata">

**Author:** ![sabyasachi\_mallick](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@sabyasachi\_mallick](https://discuss.elastic.co/u/sabyasachi_mallick)\
**Post date:** [December 8, 2016, 6:37am UTC](https://discuss.elastic.co/t/how-to-do-multiple-aggregations-in-kibana/68343/3 "2016-12-08T06:37:03Z")

</div>

yes yes!! That helped..Thanks a lot ..i'll explore more about timelion. @tsullivan

---

<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 5, 2017, 6:37am UTC](https://discuss.elastic.co/t/how-to-do-multiple-aggregations-in-kibana/68343/4 "2017-01-05T06:37:13Z")

</div>

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