Calculating Proportion (& other simple calculations)

Included in this tutorial

  • Using the Calculate Field tool to calculate proportion (as an example of a simple calculation) in ArcGIS Pro.

  • Using selections to prevent dividing by zero

Software version in examples: ArcGIS Pro 2.8.2

Tutorial Data: The tutorial includes demonstration with sample data available here.

Credits: L. Meisterlin with Moses Levich, Thiago Lee, and Erik Strand (2021). Updated L. Meisterlin (2024).

 

A simple calculation using the built-in operator buttons

First, access the Calculate Field dialogue box or tool. Then, specify the table, field, and data type.

To calculate proportion between numerical fields, double-click the field containing the numerator values, then the / symbol, and finally the field containing the denominator values.

Note the other standard operator buttons available including + addition, - subtraction, and * multiplication.

This example (below) demonstrates calculating the proportion represented by the ratio between two fields: Int_lrg/Int_sm. To do this, we…

  • Choose Tracts_wTable under Input Table.

  • Choose the field to be (re-)calculated under Field Name. In this example we are calculating values in NewDbl, an empty (null) field with double data type.

  • For the Expression Type, ensure Python 3 is selected.

  • Scroll down the Fields list and double-click the relevant field names and operators (in the appropriate order) to population the Expression text box. In our example, the expression reads !Int_lrg! / !Int_sm!.

calculating the proportion of two numerical fields

Isolating certain records for a field calculation

REMINDER: You cannot divide by zero.

The example above does not confirm that the field representing the denominator in our calculated ratio does not include zero values. (Because we knew it does not.)

Whether you need to isolate features with non-zero values or want to isolate certain features for the field calculation, you can use Select by Attributes prior to accessing the Calculate Field tool. The Calculate Field tool’s outputs will be limited to the selected features.

 
Previous
Previous

Adding & Calculating Fields in an Attribute Table

Next
Next

Copying Values to a New Field