Forum Discussion

v_mark's avatar
v_mark
Icon for Helper V rankHelper V
5 years ago
Solved

Switch Statement for multiple text criteria

I was creating a switch statement for all the states in the US and Group them into per region.  that will be used for a filter   I noticed that I have to declare each state in my switch statement. ...
  • amitchandak's avatar
    5 years ago

    v_mark , I am adding in and Or example , both will work same in this case

     

    State Groups = SWITCH( TRUE(),
    sample[State] in{ "WV", "DE","DC","MD","VA"} "CAPITAL", // how to use in
    sample[State] = "DE" || sample[State] = "DC" || sample[State] = "DE" , "CAPITAL", //how to use OR

    "NA" //deafult va;ue
    )