Dashboard table: color boolean cell

Hello,

I have boolean data in my index, that I'm rendering in a dashboard table (currently lens, but I could change to another system, as long as the final rendering looks like a table). I would like to color the boolean table cell (green/red), depending on whether the boolean is true or false.

I know how to color numeric values: metric->appearance->color by value, however it seems this is not available for booleans? I also looked at formulas, to possibly convert the boolean to a number, but I see that formulas don't allow for that for now.

A workaround that I found is to set a format with a static lookup in the index pattern, putting some color emojis for true and false.. That does work, but I'd rather color the cell if at all possible.

Is there a way to achieve that that I'm not seeing? Thank you!

Emmanuel

Hey Emmanuel,

If i understand you correctly, you are making a lens table and have the boolean field as a row (in the layer pane). The coloration we have in lens can only be applied to metrics, so directly what you want is not possible unfortunately. What you could do is add a metric, use a formula and put there count(kql ='BOOLEAN: true')/count(). Where BOOLEAN should be replaced by your boolean field. If the row is for false the number should be equal to 0 and if it is true it should be equal to 1. You can color this metric cell according to that.
I hope that helps,

Tim

1 Like

Hello,

thank you for the answer! I was searching a little around formulas but couldn't find it. In the end for now we decided with the index pattern static lookup "workaround", turns out this will be good enough in this case, but I'll definitely keep your solution in mind next time!

Emmanuel

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