Liquid Parameters - Output inside IF block

Finally got some time to spend on Liquid and I have this use case, mostly to reduce the SQL.

Right now I have this

dimension: test {
sql: CASE
WHEN {% parameter test %} = 'Day'
-- Something
WHEN {% paramter test %} = 'Week'
-- Something else
ELSE NULL
END ;;
}

But I would like to do this: 

dimension: test {
sql: {% if test._parameter_value == 'Day' %}
1 = 1
{% else %}
CASE
WHEN {% paramter test %} = 'Week'
-- Something else
ELSE NULL
END ;;
{% endif %}
}

The problem is that {% paramter test %} value is not inserted if it’s within IF block. Just wondering if it’s even possible?

0 1 139
1 REPLY 1
Top Labels in this Space
Top Solution Authors