# Filtering on the combination of two condition in bucket aggregation

**URL:** <https://discuss.elastic.co/t/filtering-on-the-combination-of-two-condition-in-bucket-aggregation/230224>\
**Category:** Kibana\
**Created:** [April 28, 2020, 5:31pm UTC](https://discuss.elastic.co/t/filtering-on-the-combination-of-two-condition-in-bucket-aggregation/230224 "2020-04-28T17:31:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjilinga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anjilinga/32/86010_2.png) [@anjilinga](https://discuss.elastic.co/u/anjilinga)\
**Post date:** [April 28, 2020, 5:31pm UTC](https://discuss.elastic.co/t/filtering-on-the-combination-of-two-condition-in-bucket-aggregation/230224/1 "2020-04-28T17:31:12Z")

</div>

I have the index with the data for multiple groupids with other fields status and description etc.  
The posible values for status is error, success, inprogress, new.  
Want to display below in datatable

1. the number of groupids which are having status as success with out error.
2. the number of groupids which are having status as success with one error
3. the number of groupids which are having status as success with two error
4. the number of groupids which are having status as success with three error

The sample data is

| Date | Callid | Status |
| --- | --- | --- |
| 28/04/2020 08:10 | callid1 | new |
| 28/04/2020 08:12 | callid1 | error |
| 28/04/2020 08:15 | callid1 | success |
| 28/04/2020 08:18 | callid2 | new |
| 28/04/2020 08:20 | callid2 | error |
| 28/04/2020 08:30 | callid3 | inprogress |
| 28/04/2020 08:40 | callid3 | success |
| 28/04/2020 08:50 | callid4 | error |
| 28/04/2020 08:51 | callid4 | error |
| 28/04/2020 08:52 | callid4 | error |
| 28/04/2020 08:53 | callid4 | success |

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 4, 2020, 8:42pm UTC](https://discuss.elastic.co/t/filtering-on-the-combination-of-two-condition-in-bucket-aggregation/230224/2 "2020-05-04T20:42:18Z")

</div>

I think the easiest way to do this would be with ESQL queries in Canvas. [https://www.elastic.co/blog/getting-started-with-canvas-in-kibana](https://www.elastic.co/blog/getting-started-with-canvas-in-kibana)

---

<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:** [June 1, 2020, 8:42pm UTC](https://discuss.elastic.co/t/filtering-on-the-combination-of-two-condition-in-bucket-aggregation/230224/3 "2020-06-01T20:42:23Z")

</div>

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