Skip to main content
Functions are the building blocks that define Calculation Pipelines, a domain-specific algebra for computer-readable cost calculations. Functions are represented as a tagged union, using the field function which every function contains. Anywhere a function is accepted you may find any of the functions listed here, and you tell them apart using the value of the function field.
FunctionTagDescription
ConstantconstantEmit a constant value at a given resolution.
AddaddSum two or more operands.
SubtractsubtractCompute left - right.
DividedivideCompute numerator / denominator with unit algebra.
MultiplymultiplyMultiply two operands with unit algebra.
AggregateaggregateAggregate a dataset over a coarser resolution window.
ResampleresampleResample a coarse-resolution series to finer resolution.
SelectselectKeep only values matching a condition (temporal or value-based).
MaskmaskConditional substitution based on a condition.
ClipclipClamp values to a min/max range.
LookuplookupTier-based table lookup.