Not all backend databases support emojis in table calculations. These may unexpectedly break if your instance is migrated to a MySQL backend. Consider using conditional formatting for table charts or conditional formatting using HTML instead.
It's valuable to call out rows that meet (or do not meet) certain conditions in some reports. This pattern is often referred to as conditional formatting in Excel or other spreadsheet applications.
Looker supports conditional formatting for fields via the LookML html parameter, which is ideal when the conditions driving the formatting are consistent across analysis for a given field. When the conditions driving the formatting need to be assignable from Looker's Explore UI, table calculations can be leveraged.
This article shows how to get the formatting, using table calculations:
In the example below, a table calculation that uses the
if functions is used to prepend an emoji character, based on
Inventory Items Count thresholds. The measure column is hidden from the visualization, so only the column with the conditionally prepended emoji is visualized:
Similarly, this conditional formatting pattern could be applied to a percent change table calculation to call attention to rows that may warrant additional attention. In the example below, a red icon is prepended for days where
Inventory Items Count has negative growth, compared to the day before:
You can enable the emojis on table calculations by using:
- On a Mac:
CTRL + CMD + SPACEbrings up the emoji keyboard that allows you to select emojis to drop into a table calculation.
- Windows machines: This article goes over how to enable and use emojis.