Grammar
pivot Operation Grammar
Create Pivot
pivot(inward: Boolean= true) { pivotColumns: PivotColumnsSelector}
Reduce Pivot into DataRow
Pivot.minBy{ rowExpression: RowExpression}
| .maxBy{ rowExpression: RowExpression}
| .first[ { rowCondition: RowFilter} ]
| .last[ { rowCondition: RowFilter} ]
| .medianBy{ rowExpression: RowExpression}
| .percentileBy(percentile: Double) { rowExpression: RowExpression}
.with{ rowExpression: RowExpression}
| .values{ valueColumns: ColumnsSelector}
Aggregate Pivot into DataRow
| .frames()
| .with{ rowExpression: RowExpression}
| .values{ valueColumns: ColumnsSelector}
| .aggregate{ aggregations: AggregateDsl}
Group Pivot into PivotGroupBy and reduce / aggregate it
Pivot.groupBy{ columns: ColumnsSelector}
| .groupByOther()
[ .default(defaultValue) ]
Check out PivotGroupBy Grammar for more information.