AnsweredAssumed Answered

Calculate field string into int and float => error

Question asked by pan_gis on Oct 6, 2019
Latest reply on Oct 20, 2019 by curtvprice



I am running a model.



1. for field 1(string)  I have "integer numbers" and a value "nan" 

      I use field calc with the expression: !ACmodeString!.replace("nan","<Null>")


2. Once I have the null records I run  again Filed Calc to copy these values from the string field into a integer field with a expression like Field1(string) = Field2(integer)   [ I have tried both VB and Python]


a. with python I get this error:


ERROR 999999: Error executing function.
The value type is incompatible with the field type.


b. with python again



ERROR 000539: Error running expression: int(u"<Null>")
Traceback (most recent call last):
  File "<expression>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '<Null>'


c. with VB I get an alert:



If I click yes it finishes.


the same happens for a filed that needs to be converted in float.


I need to get rid of this alert.


The issue seems to be the null value.