Attribute Rules - If

101
1
Jump to solution
01-21-2022 06:00 AM
Labels (3)
Robswann
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"

0 Kudos
1 Solution

Accepted Solutions
Robswann
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"

View solution in original post

0 Kudos
1 Reply
Robswann
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"

0 Kudos