Forum Discussion
DRJ1994
4 years agoHelper I
Help with SWITCH Statement
Hi guys, Hope you can help. I am trying to use a switch statement to create categories labeled as "0-7 days" "8-30 days" and"30+ days". However I keep recieving the following error code: "...
- 4 years ago
Hi DRJ1994 ,
Please try this:-
length of sickness = SWITCH ( TRUE (), 'Sheet1 (2)'[Days] <= 7, "0-7 days", 'Sheet1 (2)'[Days] >= 8 && 'Sheet1 (2)'[Days] <= 30, "8-30 days", 'Sheet1 (2)'[Days] > 30, "30+ days" )BR,
Samarth
Samarth_18
4 years agoCommunity Champion
Hi DRJ1994 ,
Please try this:-
length of sickness =
SWITCH (
TRUE (),
'Sheet1 (2)'[Days] <= 7, "0-7 days",
'Sheet1 (2)'[Days] >= 8
&& 'Sheet1 (2)'[Days] <= 30, "8-30 days",
'Sheet1 (2)'[Days] > 30, "30+ days"
)
BR,
Samarth
- DRJ19944 years agoHelper I
Thank you so much! That helped and solved my issue!