# How to combine first 3 rows in the image and show as single item in Kibana

**URL:** <https://discuss.elastic.co/t/how-to-combine-first-3-rows-in-the-image-and-show-as-single-item-in-kibana/137835>\
**Category:** Kibana\
**Created:** [June 28, 2018, 5:12pm UTC](https://discuss.elastic.co/t/how-to-combine-first-3-rows-in-the-image-and-show-as-single-item-in-kibana/137835 "2018-06-28T17:12:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amruth1](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amruth1](https://discuss.elastic.co/u/amruth1)\
**Post date:** [June 28, 2018, 5:12pm UTC](https://discuss.elastic.co/t/how-to-combine-first-3-rows-in-the-image-and-show-as-single-item-in-kibana/137835/1 "2018-06-28T17:12:50Z")

</div>

![07%20AM](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b7f514d8cbd708823f38ddf1c20e244ca0e830b7.png)

I am trying to group all the rows into two categories called A and B and then tell how much each of them occupy in terms of count.

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [June 28, 2018, 7:36pm UTC](https://discuss.elastic.co/t/how-to-combine-first-3-rows-in-the-image-and-show-as-single-item-in-kibana/137835/2 "2018-06-28T19:36:44Z")

</div>

Hi, instead of a terms aggregation you'll want to do a filter aggregation:

Filter 1:  
getairquotexml OR getcancellationpolicy OR dohotelgdssell

Filter 2:  
NOT (getairquotexml OR getcancellationpolicy OR dohotelgdssell)

---

<div class="post-metadata">

**Author:** ![amruth1](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@amruth1](https://discuss.elastic.co/u/amruth1)\
**Post date:** [June 28, 2018, 8:01pm UTC](https://discuss.elastic.co/t/how-to-combine-first-3-rows-in-the-image-and-show-as-single-item-in-kibana/137835/3 "2018-06-28T20:01:47Z")

</div>

Well, I want to plot both the filter counts in single graph. Like those 10 categories which are displayed over there, I want to add first 5 and last 5 and plot their count in a graph. So the final pie chart will have a single division comprising of 5 fields on one side and 5 on other.

Is it possible to write a program where if cte.subcategory="some value" then display A else display B

---

<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 26, 2018, 8:01pm UTC](https://discuss.elastic.co/t/how-to-combine-first-3-rows-in-the-image-and-show-as-single-item-in-kibana/137835/4 "2018-07-26T20:01:47Z")

</div>

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