Calculate field tool only works once.

1435
11
09-14-2019 07:35 AM
ajkelsey
New Contributor III

The calculate field tool only works once for me. I can run another calculation with no errors, but the field does not populate. I have to restart ArcGIS Pro for it to work again. I would appreciate any insight as to why.

The layer is a geodatabase feature class and I am using Python 3 expressions. ArcGIS Pro v2.4.1.

0 Kudos
11 Replies
LanceCole
MVP Regular Contributor

andrew kelsey‌,

Can you provide a little more information, such as the Python field calculation def you are having problems with and the call statement?

0 Kudos
ajkelsey
New Contributor III

I'm not trying to do anything special. I am either multiplying or dividing two columns in the table. If i restart ArcGIS, I can run the calculation and it populates the cells. I just don't understand why I need to restart the application between each calculation.

0 Kudos
LanceCole
MVP Regular Contributor

Andrew‌,

  • You are getting a Calculated Field Competed message?  If you look at the details any additional info?

  • You do not have anything selected the second time that is limiting the data that the calculation is performed on.  Try clicking the "Clear" button on the Map ribbon, unless you are intentionally limiting the data, before running the calculate field.
  • Have your tried creating a new project and add only that feature class to the map and see if it works there? 
0 Kudos
ajkelsey
New Contributor III

Yes. I get the completed message with no errors. No additional info in the details. After restarting, I double checked the attribute table to make sure the cells weren't populated and were not visible prior to the restart. But they were empty.

No selections in the map during calculations. Just a simple Cell1 * Cell2 or Cell1 * 43560.

I have not tried adding the feature class to a new project. I do believe I had this same issue in a previous project. 

0 Kudos
LanceCole
MVP Regular Contributor

andrew kelsey‌,

Got me on this one.  As noted above, try adding the feature class to a new project and/or importing it into a new GDB as well.  Check that all of the fields are numeric.  Post a screen shot of your calculate field for both the first and second attempt, might be a simple overlooked issue.  Try using Arcade in place of Python to calculate the fields.  No joined tables, correct. There was an issue with that a few versions ago in Pro.

0 Kudos
ajkelsey
New Contributor III

Yes. They are joined tables.

0 Kudos
LanceCole
MVP Regular Contributor

Andrew,

Let me see if I can find the info on that previous bug.  I think that was clear back in 2.2 though and has most likely been resolved.  You are not trying to update a joined table field, correct.  You are only using the joined data to update fields in the feature class to which the data is joined.

0 Kudos
LanceCole
MVP Regular Contributor

Andrew,

After thoughts,

How long does the calculate field tool run each time i.e. first time when it works and second time when it does not.  You can view this from the "View Details". 

If the first run you do, say Cell1 * Cell2 and place that in Cell3 works, what happens if you run it again as Cell1 +!Cell2 and place that in Cell3, does it run correctly?

Is it just one particular field you are having issues with?  Have you tried to delete the entire column from the feature class and add it back in and then rerun the calculate field?

And one more, Check if you by chance have any duplicate alias field names in any of your tables or feature classes.

Its late, I am done.  Have a great evening.

0 Kudos
ajkelsey
New Contributor III

I am not trying to update a joined field. I created new fields that are to be populated.

It's hard for me to try these suggestions because the project is done. I would have to recreate the table to do so.

0 Kudos