AnsweredAssumed Answered

How to write the product of two field value

Question asked by xiaohuiliugis on Oct 16, 2012
Latest reply on Oct 17, 2012 by xiaohuiliugis
I am using the arcpy module to assign a value for a vector file's attribute field, the value will be derived from three different files' attribute table, their relationship can be expressed as:

TOTAL= SOILRATE*0.6+LURATE*0.2+DEPRATE*0.2

(SOILRATE,LURATE,DEPRATE are from soil, landuse, depwater respectively, the values of each field are float numbers).

I wrote the following code in Python from ArcGIS tool bar,

arcpy.CalculateField_management("vulner","TOTAL",!soil_SOILRATE!*0.6+!landuse_LURATE!*0.2+!depwater_DEPRATE!*0.2)


I tried many times, but there is always a syntax error, could expert give me some advice on how to correct the syntax error? Thanks very much!

Outcomes