Calculate Field

Calculate Field


This tool works with a input layer to calculate values for a new or existing field. Build an Arcade expression to calculate the values to populate features with. If your data is time-enabled and of time type instant, you can optionally build expressions that are track aware.

For example, suppose you want to modify an existing field named TotalSales. 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"]
.

Using another example, suppose you have GPS measurements that record the location, time, bus ID, and speed of the busses in a city. We want to create a new field called SpeedFrom3 that averages the speed of the last 3 recorded GPS measurements for each feature. For this calculation we 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 3 time steps and the current time step is

average($track.field["speed"].history(-4))
.

Choose layer to calculate field values for


The points, lines, areas, or table that will have field values calculated.

In addition to choosing a layer from your map, you can choose Choose Analysis Layer at the bottom of the drop-down list to browse to your contents for a big data file share dataset or feature layer.

Calculate field values for the field


The new or existing field that will have values calculated and the data type of that field. If you are calculating values on a field that already exists, you do not need to match the data type.

Build an expression to calculate the field values


Add an expression using the expression builder to calculate field values.

For example, suppose we want to add the values of a field named income and bonus. To do this, add the expression $feature["income"] + $feature["bonus"] .

The expression is track aware


Specify if your expression is track aware. A track aware expression will include formatting like

$track.field["fieldname"].history(...)
. Track aware expressions require fields to identify individual tracks. Tracks can be composed of points, lines, areas or tables and only require that the input has a track identifier and the data is time-enabled of time type instant.

Analyze data with time intervals


Specify if you want to calculate values for your tracks using time intervals which will segment your inputs for analysis. If you use time intervals you must set the time interval you want to use, and optionally set the reference time. If you don't set a reference time, Jan 1, 1970 will be used.

For example, if you set the time boundary to be 1 day, starting at 9:00 AM on January 1st, 1990, than each track will be truncated at 9:00 am for every day and analyzed within that segment.

Using time intervals is a fast way to accelerate computing time, as it quickly creates smaller tracks for analysis. If splitting by a reoccurring time interval makes sense for your analysis, it is recommend for big data processing.

Result layer name


The name of the layer that will be created. If you are writing to an ArcGIS Data Store, your results will be saved in My Content and added to the map. If you are writing to a big data file share, your results will be stored in the big data file share and added to its manifest. It will not be added to the map. The default name is based on the tool name and the input layer name. If the layer already exists, the tool will fail.

When writing to ArcGIS Data Store (relational or spatiotemporal big data store) using the Save result in drop-down box, you can specify the name of a folder in My Content where the result will be saved.