I'm using ArcGIS 10.2.2 basic licence, trying to fill a column in an attribute table based on the following argument:
'If field1 is equal to field2, return field3, if not, return 'null''
if ( !Field1! == !Field2!):
Score = calc(!Score!)
It seems that for the Python code block, you have to use the fields as function parameters, e.g.:
def score(f1, f2, f3): if ( f1 == f2): return f3 else: return None
Expression: score(!Field1!, !Field2!, !Field3!)
Whereas for a VB Script code block you can do this:
Dim score if ( [Field1]== [Field2]) then score = [Field3] else score = vbnull end if
Note that a field value can only be set to null if the field is nullable.