Attribute Assistant IIF conditional

1889
3
Jump to solution
08-11-2016 02:46 PM
Labels (1)
JoeBorgione
MVP Emeritus

I don't understand the IIF(condtional) expression syntax and I'm hoping someone can explain it a little better than the example at Attribute Assistant methods - Attribute Assistant | ArcGIS Solutions .

The basic syntax goes IIF(expression, truepart, falsepart).  In my simple mind, I read this as:

If the expression evaluates as true, return the truepart, and if it evaluates as false, return the falsepart.

I guess this isn't correct.

In my case, I am examining the field ROADTYPE to see if it is null.  If it is null, I would like to populate the field FULLNAME with the concatenated values of fields ROADNAME and ROADPOSTDIR.  If ROADTYPE is not null (which indicates it has a value), I want to populate the field FULLNAME with the concatenation of  ROADNAME and the existing value of ROADTYPE.  So in the Value_Info field of my DynamicTable, for the FULLNAME field I have:

IIF(isNull(ROADTYPE),[ROADNAME]&" "&[ROADPOSTDIR],[ROADNAME]&" "&[ROADTYPE]) but doesn't return anything...

Sometimes our streets are named, sometimes they are numeric.  If they are named, they get a type, if they are numbered, they get a post directional:

JOES LN

versus

4104 S

Jeff Ward

That should just about do it....
0 Kudos
1 Solution

Accepted Solutions
AllisonMuise1
Occasional Contributor III

Try this syntax:

IIF(isNull([ROADTYPE]),[ROADNAME]&" "&[ROADPOSTDIR],[ROADNAME]&" "&[ROADTYPE])

(added [] around the field name in the isNull() function)

Also - make sure that the Field Name field int he Dynamic Value Table points to the field where you want the results to be written.

View solution in original post

3 Replies
DanPatterson_Retired
MVP Emeritus

no experience, but I did notice that field names seem to be enclosed in square brackets, except for this part

isNull(ROADTYPE)   did you just try a simple case, assign "null" if true and "not null" if false or whatever the non-python syntax is

AllisonMuise1
Occasional Contributor III

Try this syntax:

IIF(isNull([ROADTYPE]),[ROADNAME]&" "&[ROADPOSTDIR],[ROADNAME]&" "&[ROADTYPE])

(added [] around the field name in the isNull() function)

Also - make sure that the Field Name field int he Dynamic Value Table points to the field where you want the results to be written.

JoeBorgione
MVP Emeritus

Thanks Dan and Allison;  I'll check my brackets in the table; these tired eyes!

moments later-  you guys are both correct.  But since I don't do facial hair, I gave the correct answer to Allison... (Just kidding Dan...)

That should just about do it....