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 not contain dots — it becomes a top-level property on the resultingdynamicobjects inSummaryResult.Data.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.