Knowledge Drop

Custom liquid formatting isn't displaying in visualization


Userlevel 5

Last Tested: Jan 21, 2019

 

DCL tip: To display custom liquid formatting, use {{ rendered_value }} instead of {{ value}}
  1. {{ value }}
    1. The output displays the standard result from querying your database.
    2. Used when datatypes don't matter

Output of the code below will be only display the raw query data. (ie. 12345)

measure: total_sales {

type: sum

sql: ${TABLE}.Total_Sale ;;

html:<p style="font-size:50px;font-family:monotype;>{{value}}</p>;; value_format_name: usd_0

}

  1. {{ rendered_value }}
    1. Output displays the results from querying your database with formatting applied to it.
    2. Used when datatypes do matter

Output of the code below will display the query data with formatting applied to it. (ie. $12,345) *font size and family change carried to visualization*

measure: total_sales {

type: sum

sql: ${TABLE}.Total_Sale ;;

html:<p style="font-size:50px;font-family:monotype;>{{rendered_value}}</p>;; value_format_name: usd_0 }

 

For more in-depth information about liquid variables check out this doc.

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply