Skip To Content

Calculate Field


Creates a layer with calculated field values.


  • Calculate Field will always create a layer. It will not modify the input.

  • You can calculate values for a field that already exists or add a new field by creating a unique field name.

  • Expressions are created using Arcade expressions. See Arcade Expressions in GeoAnalytics Desktop tools for more information.

  • Arcade expressions can be track aware. Track-aware expressions require that data is time enabled of time type instant and that a track field is specified. To learn more about building track-aware expressions, see Track aware examples.

  • Similar analysis can also be completed using the following:

    • ArcGIS Pro Calculate Field geoprocessing tool in the Data Management toolbox.

  • This geoprocessing tool is powered by Spark. Analysis is completed on your desktop machine using multiple cores in parallel.

  • When running GeoAnalytics Desktop Tools, the analysis is completed on your desktop machine. For optimal performance, data should be available on your desktop. If you are using a hosted feature layer, it is recommended that you use GeoAnalytics Server. If your data isn't local, it will take longer to run a tool. If you want to use your GeoAnalytics Server to perform analysis, see GeoAnalytics Server tools.


CalculateField(input_layer, output, field_to_calculate, {field_name}, {existing_field}, {field_type}, expression, {track_aware}, track_fields, {time_boundary_split}, {time_boundary_reference})
ParameterExplanationData Type

The input features that will have a field calculated.

Table View

A new dataset with calculated fields.

Feature Class;Table

Specifies if you would like to create a new field or modify an existing field.

  • NEW_FIELD Create a new field and calculate values.
  • EXISTING_FIELD Calculate values for an existing field.

The new field that will have values calculated.


An existing field that will have values calculated.


Specifies the field type for the calculated field.

  • STRINGThe new field will be of type text.
  • INTEGER The new field will be of type integer.
  • FLOAT The new field will be of type float.
  • DATE The new field will be of type date.

Calculates values in the field. Expressions are written in Arcade and can include operators and multiple fields. Calculated values are applied in the units of the spatial reference of the input, unless a geographic coordinate system is used, in which case they will be in meters.

Calculator Expression

Specifies whether the expression uses a track-aware expression.

  • TRACK_AWAREThe expression uses a track-aware expression, and a track field must be specified.
  • NOT_TRACK_AWAREThe expression does not use a track-aware expression. This is the default.

One or more fields used to identify unique tracks.


A time span to split your input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, and set the time boundary reference to be January 1, 1980 tracks will be will be split at the beginning of every day.

Time Unit

The reference time used to split your input data into for analysis. Time boundaries will be created for the whole span of the data, and the reference time does not need to occur at the start. If no reference time is used, January 1, 1970 is used.


Code sample

Calculate Field example (Python window)

The following Python window script demonstrates how to use the CalculateField tool.

# Name:
# Description: Calculate the mean of the 3 most recent speed measurements in hurricane tracks

# Import system modules
import arcpy

arcpy.env.workspace = "C:/data/Weather.gdb"

# Set local variables
inFeatures = "Hurricanes"
fieldName = "MeanSpeed3"
out = "HurricaneTracks_Mean"
calcExpression = "Date($feature.DateAsString)"
# Execute Calculate Field
arcpy.gapro.CalculateField(inFeatures, out, "NEW_FIELD", fieldName, "", "Date", 

Licensing information

  • Basic: No
  • Standard: No
  • Advanced: Yes

Related topics