Attribute Assistant and Expression Value Method

2592
3
Jump to solution
02-12-2013 09:42 AM
Labels (1)
AlisonGaiser
Occasional Contributor
I am looking for some assistance in setting up the following using the Expression Value Method:

If FieldA is null then
     FieldB & FieldC & FieldA
else
     FieldB & FieldC
endif

Basically I am populating an address field with a concatenation of a number of fields,. If the legal unit is populated I need to add it into the address. If not, I don't want to include it.

I have tried a number of IIF statements but keep getting syntax errors. My latest attempt:

IIF (isNull([UNITID]),("[ADDRNUM] & [QUALIFIER] & " " & [FULLNAME]"),("[ADDRNUM] & [QUALIFIER] & " " & [FULLNAME] &"Unit " & [UNITID]"))

Ther error in the logs is "ERROR: evaluating the expression for feature in GISADM.AD_SiteAddressPoint with OID of 362945 Expected ')'

I am using ArcGIS 10.0 SP3.

Any suggestions are appreciated.

Thanks,
    Alison
0 Kudos
1 Solution

Accepted Solutions
MikeMillerGIS
Esri Frequent Contributor
Can you try this?

IIF (isNull([UNITID]),([ADDRNUM] & [QUALIFIER] & " " & [FULLNAME]),([ADDRNUM] & [QUALIFIER] & " " & [FULLNAME] & "Unit " & [UNITID]))

View solution in original post

0 Kudos
3 Replies
PaulHiggins
New Contributor II
Just a quick observation...your parentheses count doesnt match....thats what the error message is complaining about.  You have 3 ( and 4)...try dropping the final )  ... or rexamine your IF syntax as related to number of parentheses...


I am looking for some assistance in setting up the following using the Expression Value Method:

If FieldA is null then
     FieldB & FieldC & FieldA
else
     FieldB & FieldC
endif

Basically I am populating an address field with a concatenation of a number of fields,. If the legal unit is populated I need to add it into the address. If not, I don't want to include it.

I have tried a number of IIF statements but keep getting syntax errors. My latest attempt:

IIF (isNull([UNITID]),("[ADDRNUM] & [QUALIFIER] & " " & [FULLNAME]"),("[ADDRNUM] & [QUALIFIER] & " " & [FULLNAME] &"Unit " & [UNITID]"))

Ther error in the logs is "ERROR: evaluating the expression for feature in GISADM.AD_SiteAddressPoint with OID of 362945 Expected ')'

I am using ArcGIS 10.0 SP3.

Any suggestions are appreciated.

Thanks,
    Alison
0 Kudos
MikeMillerGIS
Esri Frequent Contributor
Can you try this?

IIF (isNull([UNITID]),([ADDRNUM] & [QUALIFIER] & " " & [FULLNAME]),([ADDRNUM] & [QUALIFIER] & " " & [FULLNAME] & "Unit " & [UNITID]))
0 Kudos
AlisonGaiser
Occasional Contributor
Thanks Mike. That works perfectly!
0 Kudos