aggAllBy
aggAllBy
creates a new table containing grouping columns and grouped data. The resulting grouped data is defined by the aggregation specified.
note
Because aggAllBy
applies the aggregation to all the columns of the table, it will ignore any column names specified for the aggregation.
Syntax
aggAllBy(spec)
aggAllBy(spec, groupByColumns...)
Parameters
Returns
A new table containing grouping columns and grouped data.
Examples
In this example, aggAllBy
returns the minimum "Number"
values, grouped by X
.
import io.deephaven.qst.table.*
import io.deephaven.api.agg.spec.*
source = newTable(
stringCol("X", "A", "B", "A", "C", "B", "A", "B", "B", "A", "A", "B", "A", "C", "B", "A", "B", "B", "C"),
stringCol("Y", "M", "N", "M", "N", "N", "M", "O", "P", "N", "M", "N", "M", "N", "N", "M", "O", "P", "N"),
intCol("Number", 55, 76, 55, 130, 230, 50, 76, 137, 214, 55, 76, 55, 130, 230, 50, 76, 137, 214),
)
result = source.aggAllBy(AggSpec.min(), "X")
- source
- result
In this example, aggAllBy
returns the 99th percentile of each column.
import io.deephaven.qst.table.*
import io.deephaven.api.agg.spec.*
source = newTable(
stringCol("X", "A", "B", "A", "C", "B", "A", "B", "B", "A", "A", "B", "A", "C", "B", "A", "B", "B", "C"),
stringCol("Y", "M", "N", "M", "N", "N", "M", "O", "P", "N", "M", "N", "M", "N", "N", "M", "O", "P", "N"),
intCol("Number", 55, 76, 55, 130, 230, 50, 76, 137, 214, 55, 76, 55, 130, 230, 50, 76, 137, 214),
)
result = source.aggAllBy(AggSpec.percentile(0.99))
- source
- result