# Attribute Rules - If

227
1
01-21-2022 06:00 AM
Labels (3)
by
New Contributor III

I am trying to get this rule to work and I am very close, but I think my problem is when both CITY AND ETJ are null it is not giving me the County. Can someone please take a quick look and see what I am doing wrong. Thanks again

VAR CITY = \$feature.CITY
VAR ETJ = \$feature.ETJ
VAR COUNTY = \$feature.COUNTY

IF(CITY == NULL)
RETURN ETJ + " ETJ"

ELSE IF(ETJ == NULL)
RETURN CITY

ELSE IF(CITY == NULL && ETJ == NULL)
RETURN COUNTY

ELSE
RETURN CITY + " & " + ETJ + " ETJ"

1 Solution

Accepted Solutions
by
New Contributor III

I figured it out. Thanks

VAR CITY = \$feature.CITY
VAR ETJ = \$feature.ETJ
VAR COUNTY = \$feature.COUNTY

IF(CITY == NULL && ETJ == NULL)
RETURN COUNTY
IF(CITY == NULL)
RETURN ETJ + " ETJ"

ELSE IF(ETJ == NULL)
RETURN CITY

ELSE IF(CITY == NULL)
RETURN ETJ + " ETJ"

ELSE
RETURN CITY + " & " + ETJ + " ETJ"

by
New Contributor III

I figured it out. Thanks

VAR CITY = \$feature.CITY
VAR ETJ = \$feature.ETJ
VAR COUNTY = \$feature.COUNTY

IF(CITY == NULL && ETJ == NULL)
RETURN COUNTY
IF(CITY == NULL)
RETURN ETJ + " ETJ"

ELSE IF(ETJ == NULL)
RETURN CITY

ELSE IF(CITY == NULL)
RETURN ETJ + " ETJ"

ELSE
RETURN CITY + " & " + ETJ + " ETJ"