Forum Discussion
PBIn00b
9 years agoAdvocate II
Using SWITCH with OR (or Multple Criteria)
Is there a way to add a second columns criteria to a SWITCH function? In short, I would like to make a calculation if the STORE # = one of a list OR if the beginning of the Coupon = a certain...
- 9 years ago
In SWITCH() function, we can only put single column to apply condition. Since you need another column for applying condition, you have to use nested IF() to achieve your goal.
Regards,
- 9 years ago
with the switch statement you can use a test for TRUE() as your evaluation criteria; eg: calc=switch(true(), blah=blah && foo=bar, 1, bar=blah || foo=foo, 2, 3)
v-sihou-msft
9 years agoMicrosoft Employee
In SWITCH() function, we can only put single column to apply condition. Since you need another column for applying condition, you have to use nested IF() to achieve your goal.
Regards,
- richbenmintz9 years agoResident Rockstar
with the switch statement you can use a test for TRUE() as your evaluation criteria; eg: calc=switch(true(), blah=blah && foo=bar, 1, bar=blah || foo=foo, 2, 3)