Skip to content

Formula reference

Formulas compute values in Map, Calculate, Filter, Route, Aggregate, Window and Validate nodes. They read like spreadsheet formulas and behave like SQL expressions.

Quantity * UnitPrice * (1 - Discount)
IF([Customer Tier] = "Gold", Revenue * 0.05, Revenue * 0.01)
CASE WHEN tier = 'Gold' THEN 0.05 WHEN tier = 'Silver' THEN 0.03 ELSE 0.01 END
status IN ('COMPLETED', 'SHIPPED') AND order_date >= DATE(2026, 1, 1)
Element Examples Notes
Column amount, [Customer Tier], `unit price` Use brackets or backticks for names with spaces or symbols
Text 'Gold', "Gold", 'it''s' Double the quote character to include it
Number 42, 0.05, 1_000_000, 1e3 Decimals keep full precision
Boolean / null TRUE, FALSE, NULL Case doesn’t matter
Arithmetic + - * / % / on integers gives a decimal
Text join first & ' ' & last Same as CONCAT but null makes the result null
Compare = == != <> < <= > >=
Logic AND OR NOT, && || !
Membership x IN (1, 2), x NOT IN ('a')
Range x BETWEEN 1 AND 10 Inclusive
Pattern x LIKE 'A%', x ILIKE 'a_c' % any text, _ one character; ILIKE ignores case
Null test x IS NULL, x IS NOT NULL Comparisons with null are null, not false
Conditional IF(c, a, b), CASE … WHEN … THEN … ELSE … END Both simple and searched CASE
Conversion CAST(x AS DECIMAL) Types: STRING, INT, FLOAT, DECIMAL, BOOL, DATE, TIMESTAMP, JSON

Precedence, highest first: unary - · * / % · + - · & · comparisons, IS, IN, BETWEEN, LIKE · NOT · AND · OR. Use parentheses when in doubt.

When a formula has a mistake, the canvas shows the node, the field and the position, and suggests the closest function name for typos.

Usable in every formula: Map, Calculate, Filter, Route, Validate, and inside aggregates.

Function Description
IF(condition, then, else?) Value when condition is true, else the third argument (or null).
COALESCE(a, b, ...) First non-null argument.
NULLIF(a, b) Null when a = b, otherwise a.
IS_BLANK(text) True when null or only whitespace.
ABS(x) Absolute value.
ROUND(x, digits?) Round half away from zero.
CEIL(x) Smallest integer ≥ x.
FLOOR(x) Largest integer ≤ x.
TRUNC(x, digits?) Truncate toward zero.
POWER(x, y) x raised to y.
SQRT(x) Square root.
LN(x) Natural logarithm.
EXP(x) e raised to x.
MOD(a, b) Remainder of a / b.
SIGN(x) -1, 0 or 1.
GREATEST(a, b, ...) Largest argument.
LEAST(a, b, ...) Smallest argument.
SAFE_DIVIDE(a, b) a / b, or null when b is 0 or null.
UPPER(text) Upper case.
LOWER(text) Lower case.
TRIM(text) Remove leading and trailing whitespace.
LTRIM(text) Remove leading whitespace.
RTRIM(text) Remove trailing whitespace.
LENGTH(text) Number of characters.
LEFT(text, n) First n characters.
RIGHT(text, n) Last n characters.
SUBSTR(text, start, length?) Substring; start is 1-based.
REPLACE(text, find, with) Replace every occurrence.
CONCAT(a, b, ...) Join as text; nulls are skipped.
CONTAINS(text, part) True when text contains part.
STARTS_WITH(text, prefix) True when text starts with prefix.
ENDS_WITH(text, suffix) True when text ends with suffix.
SPLIT_PART(text, delimiter, n) n-th part (1-based).
LPAD(text, length, fill?) Pad on the left.
RPAD(text, length, fill?) Pad on the right.
REGEX_MATCH(text, pattern) True when the pattern matches.
REGEX_EXTRACT(text, pattern, group?) Matched text (or capture group).
REGEX_REPLACE(text, pattern, with) Replace every match.
MD5(text) Hex MD5 digest.
SHA256(text) Hex SHA-256 digest.
TODAY() Current date (UTC) at run start.
NOW() Current timestamp (UTC) at run start.
DATE(year, month, day) Build a date.
TO_DATE(text, format?) Parse a date (chrono format, default ISO).
TO_TIMESTAMP(text, format?) Parse a timestamp.
YEAR(date) Year number.
QUARTER(date) 1–4.
MONTH(date) 1–12.
WEEK(date) ISO week number.
DAY(date) Day of month.
WEEKDAY(date) ISO weekday, Monday = 1.
HOUR(ts) 0–23.
MINUTE(ts) 0–59.
DATE_ADD(date, n, 'day'|'week'|'month'|'year'|'hour'|'minute') Add n units.
DATE_DIFF('day'|..., start, end) Whole units from start to end.
DATE_TRUNC('month'|..., date) Truncate to the start of the unit.
EOMONTH(date, months?) Last day of the month, optionally shifted.
FORMAT_DATE(date, format) Format as text (chrono format).
TO_STRING(x) Text representation.
TO_NUMBER(text) Parse a decimal number; invalid → null.
TO_INT(x) Parse/convert to integer; invalid → null.
TO_BOOL(x) true/false/yes/no/1/0 → boolean.
JSON_GET(json, 'path.to.field') Value at a path in a JSON column, as text.

Only in Aggregate measures and Window fields. They can’t be nested.

Function Description
SUM(x) Sum.
AVG(x) Average.
MIN(x) Minimum.
MAX(x) Maximum.
COUNT(x?) Rows (COUNT()) or non-null values.
COUNT_DISTINCT(x) Distinct non-null values.
FIRST(x) First value in input order.
LAST(x) Last value in input order.
STRING_AGG(text, separator?) Join values; default separator ’, ’.
MEDIAN(x) Median.
STDDEV(x) Sample standard deviation.
ANY(condition) True when any row is true.
ALL(condition) True when every row is true.

Only in Window fields. The Window node supplies the partition, order and frame.

Function Description
ROW_NUMBER() 1, 2, 3 … within the partition.
RANK() Rank with gaps.
DENSE_RANK() Rank without gaps.
PERCENT_RANK() Relative rank 0–1.
NTILE(n) Bucket number 1–n.
LAG(x, offset?, default?) Value from a previous row.
LEAD(x, offset?, default?) Value from a following row.
FIRST_VALUE(x) First value in the frame.
LAST_VALUE(x) Last value in the frame.