Aggregate Field

Defines an aggregate field for use in FeatureReductionBinning or FeatureReductionCluster.

Referenced by: Feature Reduction Binning, Feature Reduction Cluster

Properties

Property Details
alias The alias or text used to describe the aggregate field in the legend and popup.
isAutoGenerated Only applicable to cluster renderers. A Boolean indicating whether the field was automatically created internally by the JS API's rendering engine for use by an inferred cluster renderer. Set it to false for fields manually created by the user. Default is false.
name A unique name identifying the aggregate field. For clarity, this name could include the layer's field being aggregated as defined in onStatisticField along with the statisticType. For example, when creating a field aggregating the values from a layer's 'population' field, you could name the field 'population_sum'.
onStatisticExpression Defines an Arcade expression evaluating to either a string or a number. This expression typically originates from the source layer's renderer. A string may be returned when calculating 'mode', but a number must be returned for all other statistic types. The returnType and expression properties in this object are required, but title is optional. This may be used as an alternative to onStatisticField for aggregating data.
onStatisticField A field from the source layer to aggregate based on a given statistic type. Alternatively, you can aggregate data based on an Arcade expression in onStatisticExpression. If present, this value always takes precedent over onStatisticExpression.
statisticType Defines the statistic method for aggregating data in the onStatisticField or onStatisticExpression returned from features in a cluster or bin.
Valid values: avg, count, max, min, mode, stddev, sum, var

Explicitly defined field based on the sum of the population in a cluster or bin. Example

{
  "name": "population_sum",
  "alias": "Total population",
  "isAutoGenerated": false,
  "onStatisticField": "population",
  "statisticType": "sum"
}

Automatically generated field based on the population density in a cluster using Arcade. Example

{
  "name": "population_density_avg",
  "alias": "Average Population Density",
  "isAutoGenerated": true,
  "onStatisticExpression": {
    "expression": "$feature.Population / AreaGeodetic($feature, 'square-miles')",
    "returnType": "number",
    "title": "Population Density"
  },
  "statisticType": "avg"
}

Automatically generated field for cluster count. Example

{
  "name": "cluster_count",
  "alias": "Cluster count",
  "isAutoGenerated": true,
  "statisticType": "count"
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.