HOW TO

Create a field on a feature attribute table based on the sum of values from a related table

Last Published: March 11, 2021

Summary

In ArcGIS Pro, new table fields can be created and populated in a feature attribute table based of the sum of data from a related table. This is achieved by joining the feature attribute table to the related table using the ObjectID. The following workflow demonstrates how to create a field on a table based on the sum of values from a related table.

Procedure

  1. Create a field on the related table that shows the score sum in the related table using the Summary Statistics tool.
    1. Navigate to the Geoprocessing pane. Click Toolboxes > Analysis Tools > Statistics > Summary Statistics.
    2. In the Summary Statistics geoprocessing pane, for Input Table, select the related table.
    3. For Output Table, specify a name and save location for the new table.
    4. Under Statistics Field(s), for Field, select the field containing the values used to calculate the sum.
    5. For Statistic Type, select Sum from the the drop-down menu.
    6. Click Run.
The Summary Statistics tool showing the parameters to be filled
  1. Create a new field on the attribute table from the feature to join.
    1. In the Contents pane, right-click the feature and click Attribute Table.
    2. Click Add to open the Fields view.
    3. For Field Name, specify a name for the new field.
    4. For Data Type, select Double.
    5. On the Fields ribbon tab, click Save.
  2. Join the new sum table from Step 1 to the feature in Step 2.
    1. In the Contents pane, right-click the feature, and navigate to Joins and Relates > Add Join.
    2. For Input Table, select the feature.
    3. For Input Join Field, select Object ID.
    4. For Join Table, select the the newly created sum table.
    5. Click Run.
  3. Use the Field Calculator to populate the score values from the main table with a new field in the feature table.
Note:
To populate a field with values from a related table field using the Field Calculator, the related table must not contain null values. 
  1. In the Contents pane, right-click the feature and click Attribute Table.
  2. Click Calculate to open the Calculate Field geoprocessing pane.
  3. For Input Table, select the feature.
  4. For Field Name, select the newly created field from the feature attribute table. In this example, it is 'Network.TotalIncidents'.
  5. For Expression Type, select Python 3.
  6. Under Expression Type, for Fields, double-click the field from the sum table containing the values needed to fill in the new field on the feature attribute table. In this example, it is 'RelatedTable_Statis.SUM_Incidents'.
  7. Click Run.
The Calculate Field geoprocessing pane with the parameters to be filled
  1. In the Contents pane, right-click the feature and navigate to Joins and Relates > Remove All Joins.

Article ID: 000025009

Software:
  • ArcGIS Pro 2 7 x
  • ArcGIS Pro 2 x

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