Hello,
I have numeric columns in my data and would like to replace those values in my look. Is this supported or is there additional documentation where this is outlined?
1 = Sunday
2 = Monday
3 = Tuesday etc.

Hello,
I have numeric columns in my data and would like to replace those values in my look. Is this supported or is there additional documentation where this is outlined?
1 = Sunday
2 = Monday
3 = Tuesday etc.
So I found the docs on time formatting which should help with this.
On the front end, you could achieve this with nested if statements in a table calculation.
Something like:
if(${day_of_week}=1,"Monday" ,if(${day_of_week}=2,"Tuesday" ,if(${day_of_week}=3,"Wednesday" ,"etc.")))
All of the functions we can use within table calcs are documented here. With the above table calc we would need to hide the orginal dimension from the vis.
If we want to do it in LookML we can use a case statement (documented here).
For your example it would be something like:
case: {
when: {
sql: ${TABLE}.week_day = 1 ;;
label: "Monday"
}
when: {
sql: ${TABLE}.week_day = 2 ;;
label: "Tuesday"
}
when: {
sql: ${TABLE}.week_day = 3 ;;
label: "Wednesday"
}
else: "etc."
}
}
Feel free to visit us at help.looker.com if you’re running into any issues implementing a specific solution.
We can now use this nested if statement from
Unlike a table calculation we can refer to a field from the explore in a custom dimension whether or not it is included in the query’s result set.
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.