CASE(billingCity,
("City1" || "City2"), county1,
("City3" || "City4"), county2,
"no match")
This throws an erroe as does the Or() function because they only operate on boolean values. Anysuggestions on how to make this work? I do not want to have to write 100 case statements if I can do it more effeciently.
If you were to use a CASE then you'll need to do it like this -
CASE(
BillingCity,
"City1","County 1",
"City2","County 1",
"City3","County 2",
"City4","County 2",
"No Match"
)
Which means you cannot write write expressions on the CASE branches. These needs to be a finite value.
If you were to use an OR-IFthen you can do this -
IF(
OR(
BillingCity = "City1",
BillingCity = "City2"
),
"County 1",
IF(
OR(
BillingCity = "City3",
BillingCity = "City4"
),
"County 2",
"No Match"
)
)
The syntax for IF is -
IF( expression, value_if_true, value_if_false )
Now, the good thing is that you can nest them like I did -
IF(
expression,
IF(
expression,
value_if_true,
value_if_false
),
IF(
expression,
value_if_true,
value_if_false
)
)
where the value_if_true is just another IF( ... ).