I want to do calculate with script, field - field.next () with incrementation of 2 rows
closed as unclear what you're asking by user30184, John Powell, Brad Nesom, Mapperz♦ Jun 3 '15 at 13:34
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
there is a simple workaround :
1) create a new field with the FID - 2
2) make a copy of the attribute table
3) join the table based on FID and "FID-2"
4) compute oldtable.field - newtable.field
here is the skeletton of the script in Python (to be checked, and you need to replace with your real names when appropriate):
arcpy.AddField_management(inFeatures, "FID_next", "LONG") arcpy.CalculateField_management(inFeatures, "FID_next", '!FID!-2', "PYTHON") arcpy.TableToTable_conversion(inFeatures, "C:/temp", "newtable.dbf") arcpy.MakeFeatureLayer_management(inFeatures, "inTable") arcpy.AddJoin_management( "inTable", "FID", "newtable.dbf", "FID_next") arcpy.CalculateField_management("inTable", "inTable.afield", '!inTable.field!-!newTable.field!', "PYTHON")