I have a dimension in the view that contains some Liquid. It allows me to parameterise the selection of currency conversion.
It looks like the following:
parameter: conversion_currency {
type: unquoted
default_value: "1"
allowed_value: {
label: "Euro"
value: "EUR"
}
allowed_value: {
label: "US Dollars"
value: "USD"
}
}
dimension:fx_rate {
type: number
hidden: yes
sql: {% if conversion_currency._parameter_value == "EUR" %}
${TABLE}.fx_rate_eur
{% elsif conversion_currency._parameter_value == "USD" %}
${TABLE}.fx_rate_usd
{% else %}
1
{% endif %} ;;
}
In one of the looks I wanted to use the ${fx_rate} to convert a number that isn’t converted by default in the model. In Custom Dimension definition I entered:
${my_view.amount} / ${my_view.fx_rate}
Imagine my surprise when I saw Liquid in my SQL statement
In the end I decided I was going to add my dimension converted to the model but I thought this was an interesting case