Knowledge Drop

Conditional / Dynamic Value Format value_format

  • 5 April 2021
  • 2 replies
  • 1022 views

Userlevel 5

Last tested: Jan 21, 2019
 

We can't do dynamic formatting using the value_format parameter, but we can using the html parameter! Here is an example that looks at a separate "currency" dimension and puts the proper symbol in front of our measure amount.

 

html:

{% if currency._value == 'EUR' %}

€{{rendered_value}}

{% elsif currency._value == 'USD' %}

${{rendered_value}}

{% else %}

{{rendered_value}}

{% endif %}

;;

 

This content is subject to limited support.                

 

 


2 replies

Userlevel 2

This is great but the issue we’re running into is the currency symbol doesn’t show on axis value labels or series value labels.

This might seem cosmetic, but Looker Team, please don’t underestimate the effects small things like this have for Enterprise customers.

 

I think it’s pretty bad judgement on the business side to not prioritise this issue.

Reply