Forum Discussion
Anonymous
3 years agoNot applicable
Trying to create a column with multiple arguments
I'm looking to create a new column with several IF and OR arguments but there is only a max of 2 allowed. I have seen that || can be used, but I'm unsure of where to use it. I'm relatively new to Po...
- 3 years ago
hi Anonymous
aha, try like:
column =SWTICH(TRUE(),[NBR] IN {6002, 7102, 7087}, "ON1",[NBR] IN {6063, 7101, 6081, 6080}, "AB",[NBR] IN {7103, 6097, 6098, 6093}, "ON2",[NBR] IN {6072, 6064}, "BC",[NBR]=6083, "SK","unknown")
FreemanZ
Super User
3 years agohi Anonymous
try like:
column =
SWTICH(
[NBR],
6002 || 7102 || 7087, "ON1",
6063 || 7101 || 6081 || 6080, "AB",
7103 || 6097 || 6098 || 6093, "ON2",
6072 || 6064, "BC",
6083, "SK",
"unknown"
)- Anonymous3 years agoNot applicable
I tried inputting a New Column instead of a New Measure and get the following error:
Function 'SWITCH' does not support comparing values of type Integer with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values.
- FreemanZ3 years ago
Super User
hi Anonymous
aha, try like:
column =SWTICH(TRUE(),[NBR] IN {6002, 7102, 7087}, "ON1",[NBR] IN {6063, 7101, 6081, 6080}, "AB",[NBR] IN {7103, 6097, 6098, 6093}, "ON2",[NBR] IN {6072, 6064}, "BC",[NBR]=6083, "SK","unknown")- Anonymous3 years agoNot applicable
Perfect, thank you!!!