aggregate
Aggregate a dataset: sum/avg/count/min/max of a field, optionally grouped by one or more fields, with an optional RSQL filter. Use this for cross-cutting questions like highest-value customers (aggregate order, sum, localPrice, groupBy=[customerOrganisationName], filter="state==ORDER") or revenue by process. Datasets that carry a voided/deleted flag exclude those rows by default (see the Scope line from describeQueryableFields); line-item datasets like requisition are NOT scoped by their parent order's status, so filter explicitly for placed-orders-only revenue. Datasets: order, partRevision, partSpecification, productionStep, customerOrganisation, cart, requisition, workOrder, processPrices, materialPrices, postProcessing, typescriptEquation, operation, batchMovement, scrap, material, color, jurisdiction, leadTime, precisionPrices, infill, taxJurisdiction, taxComponent, paymentTerm, discount, shippingBox, shippingMethod, routingTemplate, kanbanColumn, documentTemplate. Call describeQueryableFields(entity) for valid field names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | 'asc' or 'desc' by the metric value (default desc). | |
| field | No | Numeric field to aggregate (required for all metrics except count). Use describeQueryableFields(entity) for valid names. | |
| limit | No | Max groups to return (1-50, default 20). | |
| entity | Yes | Dataset to aggregate. One of: order, partRevision, partSpecification, productionStep, customerOrganisation, cart, requisition, workOrder, processPrices, materialPrices, postProcessing, typescriptEquation, operation, batchMovement, scrap, material, color, jurisdiction, leadTime, precisionPrices, infill, taxJurisdiction, taxComponent, paymentTerm, discount, shippingBox, shippingMethod, routingTemplate, kanbanColumn, documentTemplate. | |
| filter | No | Optional RSQL filter applied before aggregating (same syntax as query). | |
| metric | Yes | sum, avg, count, min or max. | |
| groupBy | No | Optional fields to group by (e.g. customerOrganisationName, technology). Omit for a single total. |