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 AggregationFnA fold over leaf values plus an optional merge of child results.
Built-ins
sum
sum : Table.AggregationFn.AggregationFnSum of Number values; other values count as zero.
min
min : Table.AggregationFn.AggregationFnSmallest Number or Date; Null when there is none.
max
max : Table.AggregationFn.AggregationFnLargest Number or Date; Null when there is none.
extent
extent : Table.AggregationFn.AggregationFnList [ min, max ], or List [ Null, Null ] when there is no value of a
comparable kind.
mean
mean : Table.AggregationFn.AggregationFnArithmetic mean of numeric values; Null when there is none.
median
median : Table.AggregationFn.AggregationFnMedian of Number values; Null when there is none.
unique
unique : Table.AggregationFn.AggregationFnDistinct values in first-seen order, as a List.
uniqueCount
uniqueCount : Table.AggregationFn.AggregationFnNumber of distinct values.
count
count : Table.AggregationFn.AggregationFnNumber of rows.
first
first : Table.AggregationFn.AggregationFnFirst row's value, Null for no rows.
last
last : Table.AggregationFn.AggregationFnLast row's value, Null for no rows.
Building your own
custom
custom : (List Table.Value.Value -> Table.Value.Value) -> Table.AggregationFn.AggregationFnBuild an aggregation from a fold over leaf values.
withMerge
withMerge : (List Table.Value.Value -> Table.Value.Value) -> Table.AggregationFn.AggregationFn -> Table.AggregationFn.AggregationFnAdd a merge step for child-group results.
Applying
aggregate
aggregate : Table.AggregationFn.AggregationFn -> List Table.Value.Value -> Table.Value.ValueFold leaf values.
merge
merge : Table.AggregationFn.AggregationFn -> Maybe (List Table.Value.Value -> Table.Value.Value)The merge step, if the aggregation has one.