# Kibana Visualize - How to aggregate data with two string field values?

**URL:** <https://discuss.elastic.co/t/kibana-visualize-how-to-aggregate-data-with-two-string-field-values/116947>\
**Category:** Kibana\
**Created:** [January 25, 2018, 1:09am UTC](https://discuss.elastic.co/t/kibana-visualize-how-to-aggregate-data-with-two-string-field-values/116947 "2018-01-25T01:09:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elastic4](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@elastic4](https://discuss.elastic.co/u/elastic4)\
**Post date:** [January 25, 2018, 1:09am UTC](https://discuss.elastic.co/t/kibana-visualize-how-to-aggregate-data-with-two-string-field-values/116947/1 "2018-01-25T01:09:10Z")

</div>

I have data as follows in ElasticSearch. timestamp is a timestamp field and item\_status, item\_id are string fields.

```
timestamp item_id item_status
January 24th 2018, 12:06:34.287 1 Processing
January 24th 2018, 12:10:14.310 1 Completed
January 25th 2018, 07:21:30.876 2 Cancelled
January 26th 2018, 09:11:55.775 3 Completed

```

I want to query this data such that I can get all items that have had both Processing and Completed as their status. In my case, my query result would just be:

```
item_id
1

```

How can I do this with Kibana Visualization? I have been doing something similar to [How can I make visualization with GROUP BY](https://discuss.elastic.co/t/how-can-i-make-visualization-with-group-by/43569/2) and [https://stackoverflow.com/questions/27467180/run-a-simple-sql-group-by-query-in-kibana-4](https://stackoverflow.com/questions/27467180/run-a-simple-sql-group-by-query-in-kibana-4) but it did not really get me what I wanted.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [January 25, 2018, 2:06pm UTC](https://discuss.elastic.co/t/kibana-visualize-how-to-aggregate-data-with-two-string-field-values/116947/2 "2018-01-25T14:06:48Z")

</div>

A boolean query using must combined with a. terms aggregation on item\_id field should get you what you are looking for.

---

<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:** [February 22, 2018, 2:07pm UTC](https://discuss.elastic.co/t/kibana-visualize-how-to-aggregate-data-with-two-string-field-values/116947/3 "2018-02-22T14:07:22Z")

</div>

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