HOW TO

Calculate multiple fields simultaneously in ArcGIS Pro

Last Published: November 1, 2024

Summary

In ArcGIS Pro, calculating multiple fields in a feature layer or table simultaneously is useful when working with large datasets, or when the fields have interrelated calculations as it ensures consistency and accuracy in data transformations.

This article demonstrates two workflows to calculate the fields. In this example, the fields, Area_1, and Perimeter_1 from a feature layer, are calculated using Python scripts.

The attribute table below shows the feature layer containing the Area_1 and Perimeter_1 fields before calculation.

Attribute table displaying field values

Procedure

Note:
In this example, Python expressions are used in the tools. Other expression types can be used depending on the desired outcome.

Use the Calculate Fields (multiple) tool

The Calculate Fields (multiple) tool allows the calculation of multiple fields selected from the same feature layer or table, with the desired expression type and expressions specified for each field. The tool processes the fields in one operation, streamlining the calculation in a single run.

Use ModelBuilder

In this workflow, a model is created in ModelBuilder, and the Calculate Field tool is used twice to calculate half of the values in the Area_1 and Perimeter_1 fields. The Calculate Field tool uses two different Python expressions to calculate these fields.

  1. Open the ArcGIS Pro project.
  2. Navigate to the Analysis tab and click ModelBuilder
  3. Add the feature layer or table to the model. Refer to ArcGIS Pro: Add data for instructions.
  4. Add the Calculate Field tool to the model. Refer to ArcGIS Pro: Add geoprocessing tools for instructions.
  5. Connect the feature layer or table to the Calculate Field tool as an input table. Refer to ArcGIS Pro: Connect data and tools for instructions. 
  6. In the model, double-click the Calculate Field tool. In the Calculate Field window, specify the parameters below.
    1. For Field Name, select the field to be calculated. In this example, Area_1 is selected.
    2. For Expression Type, select Python.
    3. For Expression, specify the expression provided in the first expression box below. Replace <field_name> with the name of the field to be calculated. In this example, Area_1 is used.
<field_name> * 0.5
  1. Click Verify to validate the expression.
  2. Click OK to run the script.
Configuration of the first Calculate Field tool in ModelBuilder
  1. Repeat Steps 4 through 5 to add a new Calculate Field tool to the model.
  2. In the model, double-click the new Calculate Field tool. In the Calculate Field window, specify the parameters below.
    1. For Field Name, select the field to be calculated. In this example, Perimeter_1 is selected.
    2. For Expression Type, select Python.
    3. For Expression, specify the expression provided in the first expression box below. Replace <field_name> with the name of the field to be calculated. In this example, Perimeter_1 is used.
<field_name> / 2
  1. Click Verify to validate the expression.
  2. Click OK to run the script.
Configuration of the second Calculate Field tool in ModelBuilder

The image below depicts the model's calculating process.

ModelBuilder displaying Calculate Field tool used to calculate multiple fields

The attribute table below shows the Area_1 and Perimeter_1 fields post calculation. 

Attribute table containing field values of multiple fields calculated simultaneously.

Article ID: 000033892

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 3
  • ArcGIS Pro 3 2

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options