Hi,
How to create Custom Fields Dimension with Case when conditions
i have custom fields dimension
and the result is age list,
and i want to group the age list in custom fields dimension too
like
case
when ${age}>0 and ${age} < 21 then '0-20'
when ${age}>=21 and ${age} < 31 then '20-30'
when ${age}>=31 and ${age} < 41 then '30-40'
when ${age}>=41 and ${age} < 51 then '40-50'
when ${age}>=51 and ${age} < 61 then '50-60'
when ${age}>=61 and ${age} < 66 then '61-65'
when ${age} >=66 and ${age} < 71 then '66-70'
when ${age} >70 then '>70'
else '<60'
end
but error showen
Solved! Go to Solution.
Hiya!
You can use custom grouping for quick tiers creation: https://docs.looker.com/exploring-data/adding-fields/custom-measure#custom_grouping
Or you can use this syntax for CASE function: https://docs.looker.com/exploring-data/creating-looker-expressions/looker-functions-and-operators#lo...
case(when(yesno_arg, value_if_yes), when(yesno_arg, value_if_yes), ..., else_value)