public class PivotTable extends Object
Constructor | Description |
---|---|
PivotTable() |
Modifier and Type | Method | Description |
---|---|---|
static Table |
pivot(Table table,
CategoricalColumn<?> column1,
CategoricalColumn<?> column2,
NumericColumn<?> values,
AggregateFunction<?,?> aggregateFunction) |
Returns a table that is a rotation of the given table pivoted around the key columns, and
filling the output cells using the values calculated by the
aggregateFunction when
applied to the values column grouping by the key columns |
public static Table pivot(Table table, CategoricalColumn<?> column1, CategoricalColumn<?> column2, NumericColumn<?> values, AggregateFunction<?,?> aggregateFunction)
aggregateFunction
when
applied to the values column
grouping by the key columnstable
- The table that provides the data to be pivotedcolumn1
- A "key" categorical column from which the primary grouping is created. There
will be one on each row of the resultcolumn2
- A second categorical column for which a subtotal is created; this produces n
columns on each row of the resultvalues
- A numeric column that provides the values to be summarizedaggregateFunction
- function that defines what operation is performed on the values in the
subgroupsCopyright © 2022. All rights reserved.