AggApproxPct
AggApproxPct returns an approximate percentile aggregation for the supplied percentile and column name pairs.
Syntax
AggApproxPct(percentile, pairs...)
AggApproxPct(percentile, compression, pairs...)
AggApproxPct(inputColumn, percentileOutputs...)
AggApproxPct(inputColumn, compression, percentileOutputs...)
Parameters
| Parameter | Type | Description |
|---|---|---|
| percentile | double | The percentile value to use for all component aggregations. |
| pairs | String... | The source/result column name pairs. |
| compression | double | T-Digest compression factor. This value must be greater than 1 and should be less than 1,000 in most cases. |
| percentileOutputs | PercentileOutput... | The percentile/output column name pairs for the component aggregations. |
Returns
An approximate percentile aggregation for the supplied percentile and column names.
Examples
In this example, AggApproxPct returns the approximate percentage value of Number as grouped by X.
import static io.deephaven.api.agg.Aggregation.AggApproxPct
source = newTable(
stringCol("X", "A", "B", "A", "C", "B", "A", "B", "B", "C"),
stringCol("Y", "M", "N", "O", "N", "P", "M", "O", "P", "M"),
intCol("Number", 55, 76, 20, 130, 230, 50, 73, 137, 214),
)
result = source.aggBy([AggApproxPct(0.50, "Number")], "X")