Is it possible to preform multiplication on several fields of an attribute table together and then use an update cursor to assign the resulting value to a specific field?
-
1Uh, yes, but do you have any code that you can post in your question? What calculation is it you're trying to perform? Is it like A = B * C? A = B * Constant?..– Michael StimsonCommented Mar 30, 2015 at 22:51
-
2Check the documentation here: resources.arcgis.com/en/help/main/10.1/index.html#//…. It would be along the lines of row[3] = row[0] * row[1] * row[2]– phloemCommented Mar 30, 2015 at 22:53
-
1That's it @phloem, but make sure your data is numeric type. Bad things happen if the numbers are stored in a TEXT or DATE field. In these instances the values need to be cast to a number, multiplied and then stored.– Michael StimsonCommented Mar 30, 2015 at 23:07
-
2While easy to do with a cursor, unless you want to learn some simple ArcPy, the field calculator will be even easier to use.– PolyGeo ♦Commented Mar 30, 2015 at 23:32
-
Yes, @MichaelMiles-Stimson, you are correct that results may differ based on data type, but that's really an answer to an unasked question.– phloemCommented Mar 31, 2015 at 21:00
|
Show 1 more comment