Hi, I’m trying to create a simple parameter to choose between 2 dimensions to breakdown a view. I’ve copied the syntax exactly from the Looker docs, but keep getting an error saying that the “parameter’ needs a field name:
dimension: geo_breakdown {
type: string
label_from_parameter: regiondrilldown
sql:
case
when {% parameter ${regiondrilldown} %} = ‘Country’ Then ${country}
when {% parameter ${regiondrilldown} %} = ‘State’ then ${state}
when {% parameter ${regiondrilldown} %} = ‘City’ then ${city}
end ;;
}
The above is better because the conditional logic is within Liquid, so parameter can be unquoted but you make the paramter’s output to be used in conditional logic in SQL