Change Header Background fill/color selectively?

hwimoon
Participant II

Hi,

I have a pivot tables with different levels of dimensions. I was wondering if there is a way we can selectively change columns’ backgrounds. For example, we would like to change the header called “Cumul. Rtn” to light green. Is this possible at all?

15e43482-033a-49d5-8324-9aee000394d6.jpg
0 2 2,295
2 REPLIES 2

Hi Hwi, 

I’m thinking we could use the the html parameter in your lookml dimension in order to change the background color based on your values (as mentioned in this help article). For example, if I have a field called Status I can conditionally change the background color of its values : 

 dimension: status{

    description: "this is my description"

    type:string

    sql:${TABLE}.status;;

      html:{% if value == 'cancelled' %}

      <p style="color: black; background-color: lightblue; font-size:100%; text-align:center">{{ rendered_value }}</p>

    {% elsif value == 'pending' %}

      <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 %}

    ;;

  }

8c455c65-05ca-439d-b57f-2d7cb37affd1.png

hwimoon
Participant II
34504f4d-cf11-4418-809d-d05c9815830a.png

This is the best I could do. Is there a way we can get rid of the margin in between the headers? 

Top Labels in this Space
Top Solution Authors