0

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?

  • 1
    Uh, 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 Stimson Mar 30 '15 at 22:51
  • 2
    Check 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] – phloem Mar 30 '15 at 22:53
  • 1
    That'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 Stimson Mar 30 '15 at 23:07
  • 2
    While easy to do with a cursor, unless you want to learn some simple ArcPy, the field calculator will be even easier to use. – PolyGeo Mar 30 '15 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. – phloem Mar 31 '15 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.