Conditional formatting (font size, color) in a table viz

Knowledge Drop

Last tested: March 2021

There are currently options for font size in the table-next visualization.

As of 4.10, we have conditional formatting that can be used in the table visualization. As of 5.2, this can be applied on a per-measure basis. This only affects colors, not font size.

Size customization can be achieved with html in LookML, as in this article:

 dimension: status {  sql: ${TABLE}.status ;;  html: {% if value == 'Paid' %}  <p style="color: black; background-color: lightblue; font-size:100%; text-align:center">{{ rendered_value }}</p>  {% elsif value == 'Shipped' %}  <p style="color: black; background-color: lightgreen; font-size:100%; text-align:center">{{ rendered_value }}</p>  {% else %}  <p style="color: black; background-color: orange; font-size:100%; text-align:center">{{ rendered_value }}</p>  {% endif %};; }

This content is subject to limited support.                

Version history
Last update:
‎04-05-2021 09:00 AM
Updated by: