Knowledge Drop

Liquid version of a "case when"


Userlevel 1

Last tested: Mar 30, 2020
 

If you want to implement a liquid {% if %} version of a case when statement?

You can do that in the html parameter like this -

 

dimension: item_name {

type: string

sql: ${TABLE}.item_name ;;

html: {% if value == "Sarah" %}

Sarah_2

{% else %}

{{ value }}

{% endif %} ;;

}

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply