Aggregate any dataset
summarize_datasetCount or aggregate Charlotte open datasets server-side by up to three fields to answer grouped questions, such as 311 requests by type and ZIP code.
Instructions
Count or aggregate any portal dataset server-side, grouped by up to three fields.
Answers questions like "how many 311 requests of each type were made in ZIP 28205?". Rows are sorted by the statistic, largest first, in a column named stat_value.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| near | No | Optional street address or 'latitude,longitude'; when given, only records within radius_miles of it are returned. | |
| limit | No | Maximum groups to return. | |
| where | No | 1=1 | |
| group_by | Yes | Fields to group by. | |
| layer_url | Yes | ArcGIS layer URL from search_datasets, ending in /MapServer/<n> or /FeatureServer/<n>. | |
| radius_miles | No | Used with near. | |
| statistic_type | No | count | |
| statistic_field | No | Numeric field to aggregate; required unless counting. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| notes | No | ||
| source | Yes | ||
| filters | Yes | The SQL where clause that was applied. | |
| group_by | Yes | ||
| location | No | ||
| statistic | Yes | ||
| radius_miles | No |