# Mapped filter

**URL:** <https://discuss.elastic.co/t/mapped-filter/160143>\
**Category:** Kibana\
**Created:** [December 10, 2018, 10:20am UTC](https://discuss.elastic.co/t/mapped-filter/160143 "2018-12-10T10:20:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [December 10, 2018, 10:20am UTC](https://discuss.elastic.co/t/mapped-filter/160143/1 "2018-12-10T10:20:14Z")

</div>

Good morning,  
iwant to do in kibana controls the nest thing.  
I charge a data and one column is like this:  
WANT  
0  
0  
1  
1  
0  
I want to create a filter where i can choose the option yes or NO. Yes is when WANT is \<=1(0,1) and NO is when WANT is 0. Is there any option to do this in kibana controls? thank you

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [December 10, 2018, 10:33pm UTC](https://discuss.elastic.co/t/mapped-filter/160143/2 "2018-12-10T22:33:46Z")

</div>

Kibana doesn't have a way to make one value into another like that. Your best bet would be to add another field to your data that does that mapping for you, and use that new field in Kibana. You can use the re-index API to update existing data if you'd like too.

Alternatively, this is something you _can_ do in Canvas, using either `mapColumn` or `alterColumn` to modify the data you got back from Elasticsearch, then you can visualize that modified form.

---

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [December 11, 2018, 7:50am UTC](https://discuss.elastic.co/t/mapped-filter/160143/3 "2018-12-11T07:50:32Z")

</div>

Hello,  
Sorry but i don't know what si canvas. If I add a new field, is there any option to in control visualization insert a filter "between" or "less than" or something like this? I only wath the option =.  
Thank you

---

<div class="post-metadata">

**Author:** ![ilanas](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ilanas](https://discuss.elastic.co/u/ilanas)\
**Post date:** [December 12, 2018, 3:16pm UTC](https://discuss.elastic.co/t/mapped-filter/160143/4 "2018-12-12T15:16:11Z")

</div>

Hello, i install the last version of kibana and now appear canvas. How can i do?

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [December 14, 2018, 12:40am UTC](https://discuss.elastic.co/t/mapped-filter/160143/5 "2018-12-14T00:40:26Z")

</div>

It'll require getting your hands into the expression editor at the bottom of the app, but the flow is basically something like:

1. Add the datatable element to the workpad
2. Modify the "Data" input from the sidebar (under the Data tab) to point at the data you want (your index and whatever fields you want)
3. Open the expression editor and, after the `esdocs` or `essql` function, add another pipe on modify the data. Something like this is probably close:

```nohighlight
esdocs <whatever is there already>
| mapColumn name=want_text fn={if fn={getCell want | eq 0} then="NO" else="YES"}
| render

```

You're basically adding a new column to your data on the fly, named "want\_text" and the value is calculated off the column named "want".

You can find out a little bit more about Canvas here: [https://www.elastic.co/guide/en/kibana/current/canvas.html](https://www.elastic.co/guide/en/kibana/current/canvas.html)

And if none of this makes any sense to you, you may want to consider re-indexing your data to store both the 0 and 1 value along with the NO and YES value.

---

<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 11, 2019, 12:40am UTC](https://discuss.elastic.co/t/mapped-filter/160143/6 "2019-01-11T00:40:33Z")

</div>

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