Forum Discussion
SWITCH TRUE with multiple conditions
Hi,
Would someone be able to tell me why my SWITCH(TRUE() function with multiple conditions is returing wrong anwers? Just look at row 2 in of the attached screenshot - it should return "Group 4", instead it's returning "Group 2".
Thank you for your help,
Giac
Anonymous , use the brackets (condition || condition) && (condition || condition).
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
2 Replies
- ERD
Community Champion
Anonymous , use the brackets (condition || condition) && (condition || condition).
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
- AlexisOlson
Super User
Yep, in logical statements && comes first in order of operations before ||, like multiplication comes before addition.
A && B || C = ( A && B ) || C just like A * B + C = ( A * B ) + C.