Lens - If Statements with color

Hello,
is it possible to add a condition in Lens?
I am trying to create a visualization that will turn "red" or "green" based on the value of a keyword.

So for example, task: "running" = green , and it will show the value of "running"
and it will change dynamically so if the value changes to "stopping", the visualization will turn red and display the value of "stopping"

Not sure that exactly answers but @VinceDS wrote a great article recently:

1 Like

Thanks @dadoonet !
I am currently working on part 2 which will be about ifelse() introduced in v 8.6.
ifelse() simplifies how to build a red/green visualisation.
@erikg , here is an example taken from the future part2 article :

Layer 1 (% of difference with yesterday - red - decreasing):

ifelse(
 (average(taxful_total_price) - average(taxful_total_price,shift='1d'))/ average(taxful_total_price,shift='1d') >0,
 0,
  (average(taxful_total_price) - average(taxful_total_price,shift='1d'))/ average(taxful_total_price,shift='1d') 
)

Layer 2:

ifelse(
    (average(taxful_total_price) - average(taxful_total_price,shift='1d'))/ average(taxful_total_price,shift='1d') >0,
  (average(taxful_total_price) - average(taxful_total_price,shift='1d'))/ average(taxful_total_price,shift='1d'),
0 )
1 Like

Since stack version 8.11 it is available the tech preview of the new Color Mapping, available on few visualizations: [Lens] Color mapping for categorical dimensions by markov00 · Pull Request #162389 · elastic/kibana · GitHub

3 Likes