Functions
Functions
Choose a category below to look up a function. For a walkthrough of grain, grouping, and windows, read context-sensitive functions.
| Family | Behavior | Reference |
|---|---|---|
| Scalar | Transform a value at its existing grain | String, numeric, date/time, collections, utility |
| Context-sensitive | Summarize groups or compare rows within a partition | Aggregate, window and ranking |
| Row-producing | Expand values or stack query results into rows | UNNEST, DATE_SPINE, UNION |
These families describe behavior. A scalar operation on an aggregate, such as round(sum(amount), 2), retains that aggregate's grouping.
For related syntax, see ROLLUP and grouping sets, union and grouping, and custom function definitions.
Reading an entry
Each entry lists accepted inputs, output type, and the output's usual purpose: property for a value associated with keys, metric for a grouped calculation, key for an identifier or dimension, and constant for a value independent of data rows. Literal-only expressions may be constants even when a card lists property.
Examples use actual syntax, including operators such as values[1] and value is null. Built-ins use their names directly; custom functions use @function_name(...).
Expand Show Example and click Run. Copy includes the complete model when one is needed. Try scalar query examples for combinations of functions.
The shared demo uses DuckDB. Backend-specific entries explain when local execution or an extension is required.