Mapped filter

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

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.

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

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

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:
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

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.

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