I am writing a query that uses a switch statement. Here's my
statement:
Region: Switch([STATE_CODE]="PA" Or
[STATE_CODE]="DE","PennDel" ,[STATE_CODE]="NY" Or
[STATE_CODE]="NJ","Atlantic ")
Basically I have a new field named "Region". If the STATE_CODE value
is PA or DE, then Region="PennDel ". If the STATE_CODE value is NY or
NJ, then Region="Atlanti c".
The query works like a charm right now, but I need to add a piece to my
statement. I need to add a piece that says "If the STATE_CODE value is
not one of: PA, DE, NY or NJ, then Region=Other". Or it could be
similar to an IF...Else statement. Where if the value of STATE_CODE
doesn't fit one of the other options, make it "Other".
Not sure how to write it correctly. Can someone help?
statement:
Region: Switch([STATE_CODE]="PA" Or
[STATE_CODE]="DE","PennDel" ,[STATE_CODE]="NY" Or
[STATE_CODE]="NJ","Atlantic ")
Basically I have a new field named "Region". If the STATE_CODE value
is PA or DE, then Region="PennDel ". If the STATE_CODE value is NY or
NJ, then Region="Atlanti c".
The query works like a charm right now, but I need to add a piece to my
statement. I need to add a piece that says "If the STATE_CODE value is
not one of: PA, DE, NY or NJ, then Region=Other". Or it could be
similar to an IF...Else statement. Where if the value of STATE_CODE
doesn't fit one of the other options, make it "Other".
Not sure how to write it correctly. Can someone help?
Comment