I have a yesno dimension that I need to read as a string. ex. case when x = “no” then “send” when x = "yes then “keep”
if I create a string dimension with case statement, it will not work in user_details drill down. Do I need to Cast something to make this work?
setting Case statement on yesno dimension that will work in user_details drill down
Hello
From what I gather you have two options
- If you’re using the LookML substitution syntax (preferred)
dimension: your_yesno_dimension {
type: yesno
sql: ${TABLE}.your_yesno_column ;;
}
dimension: yesno_string {
type: string
sql:
case
when ${your_yesno_dimension} then 'send'
else 'keep'
end
;;
}
- If you’re using the raw column name
dimension: yesno_string {
type: string
sql:
case
when ${TABLE}.your_yesno_column then 'send'
else 'keep'
end
;;
}
this worked, thank you!
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.