Skip to main content
Version: Java (Groovy)

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

ParameterTypeDescription
specAggSpec

The aggregation specifications (AggSpecs) to apply to all columns of the source table. Note that since aggAllBy automatically applies aggregations accross all columns, this method requires an AggSpec as a parameter instead of an Aggregation.

AggSpec options are as follows:

A comprehensive list of AggSpec options and further information can be found here.

groupByColumnsString...

The group-by column names.

groupByColumnsColumnName...

The group-by column names.

groupByColumnsCollection<String>

The group-by column names.

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")

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))