Skip To Content

Calculate Field

Calculate Field The Calculate Field tool calculates field values on a new or existing field. The output will always be a new layer in your ArcGIS Enterprise portal contents.

Analysis using GeoAnalytics Tools

Analysis using GeoAnalytics Tools is completed using distributed processing across multiple ArcGIS GeoAnalytics Server machines and cores. GeoAnalytics Tools and standard feature analysis tools in ArcGIS Enterprise have different parameters and capabilities. To learn more about the differences between the tools, see Feature analysis tool differences.

Examples

Suppose you have collected sales data for a chain of supermarkets across the country. You currently have values for the total amount of sales by year in an existing field named TotalSales, and you want to calculate the total sales for each location. You want the field to be represented by the sum of the total sales in 2016 and 2017. Using those fields in the expression, you calculate the field value as $feature["Sales2016"] + $feature["Sales2017"].

Suppose you have GPS measurements that record the location, time, bus ID, and speed of the buses in a city. You want to create a new field named SpeedFrom3 that averages the speed of the last three recorded GPS measurements for each feature. For this calculation, you would use a track-aware calculation, where the track is a bus denoted by the bus ID. The calculation to determine the average speed of the previous three time steps and the current time step is average($track.field["speed"].history(-4)).

Usage notes

Calculate Fields is completed on tables, point, line, or area features.

You can only calculate values for a single field at a time.

You can either calculate values in a field that already exists, or create a new field by specifying a new field name.

Expressions are created using Arcade expressions.

Learn more about Arcade expressions in Calculate Field

Your calculation can optionally be track aware. Track-aware equations use Arcade expressions that use track functions.

Learn more about Arcade expressions in Calculate Field

To include a track aware-calculation, you must do the following:

  • Use a layer that is time-enabled and of time type instant.
  • Select The expression is track aware.
  • Select the fields used to identify tracks.

Tracks are represented by the unique combination of one or more track fields. For example, if the fields flightID and Destination are used as track identifiers, the following features [ID007, Solden] and [ID007, Tokyo] would be in two separate tracks, since they have different values for the field Destination.

Output features will return the fields in the input. If you calculated values for a new field, that field will additionally be included.

If Use current map extent is checked, only the features that are visible within the current map extent will be analyzed. If unchecked, all input features in the input layer will be analyzed, even if they are outside the current map extent.

Limitations

Only one field can be modified at a time.

Calculate Field will always produce a new feature layer, and will not edit your input dataset.

Similar tools

Use Calculate Field to calculate values for features in a new or existing field. Other tools may be useful in solving similar but slightly different problems.

Map Viewer analysis tools

If you would like to detect features in a time-enabled layer, use the GeoAnalytics Tools Detect Incidents.

ArcGIS Desktop analysis tools

The GeoAnalytics Tools Calculate Field is also available in ArcGIS Pro.

If you want to calculate values on an input and modify your existing data, use the Calculate Field tool in the Data Management toolbox in ArcGIS Pro.

To run this tool from ArcGIS Pro, your active portal must be Enterprise 10.6 or later. You must sign in using an account that has privileges to perform GeoAnalytics Feature Analysis.