# Display multiple values as one

**URL:** https://discuss.elastic.co/t/display-multiple-values-as-one/257993
**Category:** Kibana
**Created:** [December 8, 2020, 12:37pm UTC](https://discuss.elastic.co/t/display-multiple-values-as-one/257993 "2020-12-08T12:37:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Shay\_Levy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shay_levy/32/80424_2.png) [@Shay\_Levy](https://discuss.elastic.co/u/Shay_Levy)
#### Post date: [December 8, 2020, 12:37pm UTC](https://discuss.elastic.co/t/display-multiple-values-as-one/257993/1 "2020-12-08T12:37:47Z")

</div>

I'm indexing computer hardware related info, one of the fields is called Vendor.  
Example values of Vendor:

Intel  
INTEL\_  
HP  
Hewlett Packard  
Microsoft  
Microsoft Corporation

And so on...

I want to unify and display all values that contain the word 'Microsoft' and display them as **one** pie bucket. In a similar fashion, the values HP and 'Hewlett Packard' should be unified as HP, and so on.

I'm aware of the Include/Exclude options in a given visualization but using those return all matching values (not grouped)

What are my options?

Thanks!

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [December 9, 2020, 6:10pm UTC](https://discuss.elastic.co/t/display-multiple-values-as-one/257993/2 "2020-12-09T18:10:38Z")

</div>

If the total list of vendors is known, by using the "filters" aggregation you can specify KQL or Lucene queries for each of the different "groups":

- query: `vendor:HP OR vendor:"Hewlett Packard" ` label: HP
- query: `vendor:Intel OR vendor:INTEL_ ` label: Intel

and so on.

Another option is to use a [scripted field](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html). It allows you to specify a painless script turning all of the different ways of specifying the vendor into a normalized value you can use in aggregations. For performance, it would be even better to do this step prior to ingesting the data (e.g. in an ingest pipeline or using logstash)

---

<div class="post-metadata">

### Author: ![Shay\_Levy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shay_levy/32/80424_2.png) [@Shay\_Levy](https://discuss.elastic.co/u/Shay_Levy)
#### Post date: [December 10, 2020, 7:04am UTC](https://discuss.elastic.co/t/display-multiple-values-as-one/257993/3 "2020-12-10T07:04:55Z")

</div>

Thanks Joe!

I'm getting an error when I query this using the search field (I'm using v7.6.0):

[esaggs] \> Expected end of input, whitespace but "l" found.  
Vendor.keyword :"HP" OR Vendor.keyword :"Hewlett-Packard" label: "HP"  
----------------------------------------------------------^

One thing I forgot to mention is that I want to use this in a Visualization such as a Pie chart  
IS this only a matter of putting the query in the search field?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [December 10, 2020, 10:29am UTC](https://discuss.elastic.co/t/display-multiple-values-as-one/257993/4 "2020-12-10T10:29:06Z")

</div>

I think we misunderstood each other, I'm talking about the "Filters" aggregation in the "Buckets" section of pie chart:

 ![Screenshot 2020-12-10 at 11.28.29](https://us1.discourse-cdn.com/elastic/original/3X/1/9/198f5c1f54ecce1f1dc9bf1d12f10e9958a20530.png)

---

<div class="post-metadata">

### Author: ![Shay\_Levy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shay_levy/32/80424_2.png) [@Shay\_Levy](https://discuss.elastic.co/u/Shay_Levy)
#### Post date: [December 10, 2020, 12:30pm UTC](https://discuss.elastic.co/t/display-multiple-values-as-one/257993/5 "2020-12-10T12:30:23Z")

</div>

Gotcha! Thanks for your help!

-shay

---

<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 7, 2021, 12:30pm UTC](https://discuss.elastic.co/t/display-multiple-values-as-one/257993/6 "2021-01-07T12:30:27Z")

</div>

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