Query a table to get aggregated statistics back for a specific field.
For example, a county boundaries table with population information can be queried to return aggregated results for total, average, maximum, and minimum population, rather than downloading the values for every county and calculating statistics manually.
Pan and zoom to define the extent for the query. Click 'Get statistics' and choose one of the options.
- Create a
ServiceFeatureTable
with a URL to the feature service. - Create
StatisticsQueryParameters
, andStatisticDefinition
objects, and add to the parameters. - Execute
QueryStatistics
on theServiceFeatureTable
. Depending on the state of the two checkboxes, additional parameters are set. - Display each
StatisticRecord
in the first returnedQueryStatisticsResult
.
- QueryParameters
- ServiceFeatureTable
- StatisticDefinition
- StatisticRecord
- StatisticType
- StatisticsQueryParameters
- StatisticsQueryResult
analysis, average, bounding geometry, filter, intersect, maximum, mean, minimum, query, spatial query, standard deviation, statistics, sum, variance