AggregateBy
An AggregateBy represents one aggregation inside a GroupBy. It produces a single output column named by its Alias.
Properties
| Property | Type | Description |
|---|---|---|
Field | string? | Property to aggregate (optional for Count). |
Alias | string? | Name of the result column (must not conflict with GroupBy.Fields, no dots). |
Aggregator | Aggregator | Aggregation function. |
Alias rules
Aliasmust be a plain identifier — a leading letter or underscore, then letters, digits, or underscores. Letters are matched by Unicode category, so a non-Latin alias such as"المجموع"is valid. It becomes a top-level property on the resultingdynamicobjects inSummaryResult.Data. Anything else — a dot, comma, space, or dash — throwsAggregationMustHasValidAlias(tightened in 2.1.4; see breaking changes).Aliasmust not collide with any field name inGroupBy.Fields.Fieldis required for every aggregator exceptCount.
C# example
var aggregations = new List<AggregateBy>
{
new AggregateBy { Aggregator = Aggregator.Count, Alias = "OrderCount" },
new AggregateBy { Field = "Amount", Aggregator = Aggregator.Sum, Alias = "Revenue" },
new AggregateBy { Field = "Amount", Aggregator = Aggregator.Avg, Alias = "AverageAmount" }
};JSON example
[
{ "aggregator": "Count", "alias": "OrderCount" },
{ "field": "Amount", "aggregator": "Sum", "alias": "Revenue" },
{ "field": "Amount", "aggregator": "Avg", "alias": "AverageAmount" }
]See also
- GroupBy →
- Aggregator enum →
- SummaryResult → the shape that surfaces aliases.