Aggregate

v1.0.0
Analysis
arrayobjectdestructive

Description

Aggregate

Statistical operations on arrays — count, sum, average, min, max, unique values, and flatten nested arrays into a single level.

Operations

Count / Sum / Average / Min / Max

Compute numeric statistics on array elements. Works on arrays of numbers directly, or on specific numeric fields within arrays of objects.

Stats

Returns all numeric statistics at once: count, numericCount, sum, average, min, and max in a single output object.

Unique

Remove duplicate values from arrays. Works with both primitives and objects (deep equality).

Flatten

Merge nested arrays into a single flat array. Useful when you have arrays of arrays that need to be combined.

Configuration

FieldTypeDefaultDescription
Target Pathspath-picker[]Select array paths to aggregate (empty = aggregate root array)
Operationenumcountcount, sum, average, min, max, stats, unique, or flatten

Use Cases

Data Analysis

  • Quick stats: Get count, sum, and average of numeric arrays in one pass with stats
  • Score summary: Find min/max scores across a dataset
  • Totals: Sum up order amounts, quantities, or other numeric fields

Data Cleanup

  • Deduplicate: Remove duplicate entries from arrays with unique
  • Flatten imports: Combine nested array responses from paginated APIs with flatten

Reporting

  • Record counts: Count items matching certain criteria after filtering
  • Numeric ranges: Find the range (min to max) of values in a dataset

Configuration

NameTypeDefaultDescription
Target Pathspath-picker[]Select array paths to aggregate (empty = aggregate root array)
Operationenumcountcount/sum/average/min/max: numeric statistics. stats: all combined. unique: remove duplicates. flatten: merge nested arrays. count sum average min max stats unique flatten

Examples

AI Prompt
Aggregate this data into a smaller result and get statistics.
Input
1[
2 10,
3 20,
4 30,
5 40,
6 50
7]
Config
Target Paths
all
Operation
stats
Output
1{
2 "count": 5,
3 "numericCount": 5,
4 "sum": 150,
5 "average": 30,
6 "min": 10,
7 "max": 50
8}

API Usage

POST /api/v1/utilities/analysis.aggregate
Example:
curl -X POST https://your-domain.com/api/v1/utilities/analysis.aggregate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inputs":{"primary":[10,20,30,40,50]},"config":{"targetPaths":[],"operation":"stats"}}'
Response
1{
2 "count": 5,
3 "numericCount": 5,
4 "sum": 150,
5 "average": 30,
6 "min": 10,
7 "max": 50
8}