Table.AggregationFn

Generated from docs.json. 16 exposed values, types, and type aliases, in the order the module exposes them.

Built-in aggregation functions, ported from row-aggregation/aggregationFns.ts.

An AggregationFn folds the values of a column over a group's leaf rows. Some also know how to merge the results of child groups, which lets nested groups avoid re-reading every leaf.

Type

AggregationFn

type AggregationFn

A fold over leaf values plus an optional merge of child results.

Built-ins

sum

sum : Table.AggregationFn.AggregationFn

Sum of Number values; other values count as zero.

min

min : Table.AggregationFn.AggregationFn

Smallest Number or Date; Null when there is none.

max

max : Table.AggregationFn.AggregationFn

Largest Number or Date; Null when there is none.

extent

extent : Table.AggregationFn.AggregationFn

List [ min, max ], or List [ Null, Null ] when there is no value of a comparable kind.

mean

mean : Table.AggregationFn.AggregationFn

Arithmetic mean of numeric values; Null when there is none.

median

median : Table.AggregationFn.AggregationFn

Median of Number values; Null when there is none.

unique

unique : Table.AggregationFn.AggregationFn

Distinct values in first-seen order, as a List.

uniqueCount

uniqueCount : Table.AggregationFn.AggregationFn

Number of distinct values.

count

count : Table.AggregationFn.AggregationFn

Number of rows.

first

first : Table.AggregationFn.AggregationFn

First row's value, Null for no rows.

last

last : Table.AggregationFn.AggregationFn

Last row's value, Null for no rows.

Building your own

custom

custom : (List Table.Value.Value -> Table.Value.Value) -> Table.AggregationFn.AggregationFn

Build an aggregation from a fold over leaf values.

withMerge

withMerge : (List Table.Value.Value -> Table.Value.Value) -> Table.AggregationFn.AggregationFn -> Table.AggregationFn.AggregationFn

Add a merge step for child-group results.

Applying

aggregate

aggregate : Table.AggregationFn.AggregationFn -> List Table.Value.Value -> Table.Value.Value

Fold leaf values.

merge

merge : Table.AggregationFn.AggregationFn -> Maybe (List Table.Value.Value -> Table.Value.Value)

The merge step, if the aggregation has one.