I'm trying to run a rather lengthy model (built in ArcGIS 9.3.1) in ArcGIS 10.1 and I'm recieving an error on a Calculate Field tool. The error is – Type mismatch: 'iif'
.
This error is refering to an expression in the tool: iif(IsNull( [PID] ) ,NA,[PID])
.
I tried "if" instead of "iif" but then recieved a generic error.
I never had this issue when running the model in 9.3.1. I'm not sure what to do here. Any suggestions?
Best Answer
You can't use
iif
directly in field calculator expressions, you need to use the code block. There are some examples on the Field Calculator Examples help page.Python:
VBA: