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
- Create a field on the related table that shows the score sum in the related table using the Summary Statistics tool.
- Navigate to the Geoprocessing pane. Click Toolboxes > Analysis Tools > Statistics > Summary Statistics.
- In the Summary Statistics geoprocessing pane, for Input Table, select the related table.
- For Output Table, specify a name and save location for the new table.
- Under Statistics Field(s), for Field, select the field containing the values used to calculate the sum.
- For Statistic Type, select Sum from the the drop-down menu.
- Click Run.
- Create a new field on the attribute table from the feature to join.
- In the Contents pane, right-click the feature and click Attribute Table.
- Click Add to open the Fields view.
- For Field Name, specify a name for the new field.
- For Data Type, select Double.
- On the Fields ribbon tab, click Save.
- Join the new sum table from Step 1 to the feature in Step 2.
- In the Contents pane, right-click the feature, and navigate to Joins and Relates > Add Join.
- For Input Table, select the feature.
- For Input Join Field, select Object ID.
- For Join Table, select the the newly created sum table.
- Click Run.
- 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.
- In the Contents pane, right-click the feature and click Attribute Table.
- Click Calculate to open the Calculate Field geoprocessing pane.
- For Input Table, select the feature.
- For Field Name, select the newly created field from the feature attribute table. In this example, it is 'Network.TotalIncidents'.
- For Expression Type, select Python 3.
- 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'.
- Click Run.
- In the Contents pane, right-click the feature and navigate to Joins and Relates > Remove All Joins.