Aggregate functions are not available from a menu. They operate on a set of values. These functions are available for every data provider except for raster, WFS, and WMS providers (which can use only the SpatialExtent function.
Option | Definition | Syntax | Example |
---|---|---|---|
AVG |
Returns the average of the values as a Double data type. You can specify an optional argument: ALL or DISTINCT. For example: AVG(Id), AVG('all', Id), AVG('distinct', Id) |
AVG('all', Numeric_property) |
AVG('all', Parcel_Value) This example finds the average of all parcels that have a Parcel_Value property, including the ones that are null or empty. |
COUNT |
Returns the number of rows as an Int64 data type. You can specify an optional argument: ALL or DISTINCT. For example: COUNT(Id), COUNT('all', Id), COUNT('distinct', Id) |
COUNT('optional_argument', Numeric_property) |
COUNT('all', Parcel_ID) This example counts all the rows containing a Parcel_ID property, including the ones that are null or empty. |
MAX |
Returns the maximum value with the same data type as the input parameter. You can specify an optional argument: ALL or DISTINCT. For example: MAX(Id), MAX('all', Id), MAX('distinct', Id) |
MAX('optional_argument', Numeric_property) |
MAX('all', Parcel_Area) This example finds the largest parcel area value for all parcels containing a Parcel_Area property, including the ones that are null or empty. |
MEDIAN |
Takes a numeric value and returns the middle value or an interpolated value that would be the middle value once the values are sorted. The returned value has the same data type as the input parameter. Represents an inverse distribution function that assumes a continuous distribution model. |
MEDIAN(Numeric_ property) |
MEDIAN(Parcel_Value) This example finds the median value for all parcels that have a Parcel_Value property. It includes parcels with null or empty values for Parcel_Value if it is a numeric property. |
MIN |
Returns the minimum value with the same data type as the input parameter. The returned value has the same data type as the input parameter. You can specify an optional argument: ALL or DISTINCT. For example: Min(Id), Min('all', Id), Min('distinct', Id) |
MIN('optional_argument', Numeric_property) |
MIN('all', Parcel_Area) This example finds the area of the smallest parcel that has a Parcel_Area property, including the ones that are null or empty. |
SPATIALEXTENT |
Returns the smallest possible bounding rectangle of all geometries in a layer. |
SPATIALEXTENT(geometry) |
SPATIALEXTENT(geometry) |
STDDEV |
Returns the sample standard deviation as a Double data type. |
STDDEV(Numeric_property) |
STDDEV(Parcel_Value) This example finds the standard deviation among parcel values for all parcels with a Parcel_Value property, including the ones that are null or empty. |
SUM |
Returns the sum of the values as a Double data type. You can specify an optional argument: ALL or DISTINCT. For example: Sum(Id), Sum('all', Id), Sum('distinct', Id) |
SUM('all', Numeric_property) |
SUM('all', Parcel_Value) This example finds the total of parcel values for all parcels with a Parcel_Value property, including the ones that are null or empty. |