Hello,
I am using ArcGIS Pro Version 2.6 and am trying to convert geoid (11 figures) from a string to numeric through the attribute table and calculate field. I have tried the following methods and it creates a new variable with only 10 figures and null values (when there are 11 figures).
All of these have left me with many null values and only 10 digits in my number.
Is there any way I can go about doing this?
Thank you so much!
Solved! Go to Solution.
Ah! census geographic identifiers, not globe models, right?
I set up a table with the following fields and datatypes
and then wrote an 11 character census tract to geoid_string, 48201223100
Running the field calculation
int(!geoid_string!)
on each of the fields resulted in:
I am guessing you are trying to calculate on a long integer field? Try setting it to double and using the calculation above.
Read more about the limits on datatypes here:
Are you converting a text field to a long integer field? The maximum value of a long field is (2^31)-1, or 2,147,483,647, which is 9 consistent decimal digits, or 10 in some cases. To store numeric versions of larger numbers, use a "double" field, that gives you 15 consistent decimal digits with no precision loss. Here's a quick field calculator example (the long field is null because the value causes the calculation to fail due to size restrictions):
Ah! census geographic identifiers, not globe models, right?
I set up a table with the following fields and datatypes
and then wrote an 11 character census tract to geoid_string, 48201223100
Running the field calculation
int(!geoid_string!)
on each of the fields resulted in:
I am guessing you are trying to calculate on a long integer field? Try setting it to double and using the calculation above.
Read more about the limits on datatypes here:
Could you share screenshot of how the different string values look like, and explain what portion of string you would like to extract?