[GIS] Simple field calculator equation in ArcGIS 10 not working

arcgis-10.0arcgis-desktopfield-calculator

I'm new to ArcGIS 10 and am trying to do a really simple field calculator equation and it is not working. I'm just trying to find the percentage of a certain demographic trait by doing:

[asian]/[total]*100

It is populating about 10% of the column correctly and then I get an error:

There was a failure during processing, check the Geoprocessing Results
window for details

Obviously my syntax is not incorrect or else it wouldn't start populating the field correctly.

Does anyone have any idea why this is happening?

Best Answer

You probably have a divide-by-zero error. Field Calculator definitely cannot divide when zero is the denominator, and sometimes will even throw errors with zero as the numerator. To get around this, click the "Select by attributes" button in the Attribute Table (top left corner, third from the left). Then type in this formula:

"Asian" <> 0 AND "Total" <> 0

This will select only records with no zeroes. When you use field calculator, it will only process these records. You can play around with other selections to get it right.

Related Question