Transform values
A transformation is a setProp whose value is an expression. This page groups the functions you reach for most, by what you are doing; the function reference lists every function with its signature and examples.
setProp("Counterparty", trim(prop("Counterparty")))setProp("Amount EUR", round(prop("Amount") * prop("FX rate"), 2))setProp("Settles", dateAdd(prop("Trade date"), 2, "days"))setProp("Size", ifs(prop("Amount") >= 1_000_000, "large", prop("Amount") >= 10_000, "medium", "small"))| Task | Expression | Result |
|---|---|---|
| Remove surrounding spaces | trim(" GB123 ") |
"GB123" |
| Change case | upper("gbp"), lower("GBP") |
"GBP", "gbp" |
| Take part of a text | substring("GB00B16NNR78", 0, 2) |
"GB" |
| Join texts | concat("ACC", "-", "042"), or "ACC" + "-" + "042" |
"ACC-042" |
| Pad to a width | "42".padStart(6, "0") |
"000042" |
| Test a pattern | test("INV-2026-001", "^INV-\\d{4}") |
true |
| Extract matches | match("Ref AB-12 and CD-34", "[A-Z]{2}-\\d+") |
["AB-12", "CD-34"] |
| Replace the first match | replace("1,234,567", ",", "") |
"1234,567" |
| Replace every match | replaceAll("1,234,567", ",", "") |
"1234567" |
| Split into a list | split("a;b;c", ";") |
["a", "b", "c"] |
| Length | length("GBP") |
3 |
| Contains | contains("Fontana Partners", "Partners") |
true |
| Any value as text | format(42), format(today()) |
"42", an ISO date |
test, match, replace, and replaceAll take JavaScript regular expressions as text, so a backslash is doubled: "\\d+". To join a text and a number with +, convert the number with format first.
setProp("Account", trim(prop("Account")).upper())setProp("Reference", prop("Memo").match("[A-Z]{2,5}-[0-9]+").first())setProp("Clean amount", replaceAll(prop("Amount text"), "[^0-9.\\-]", ""))Numbers
Section titled “Numbers”Numbers are exact decimals while a formula computes, so money arithmetic has no binary rounding error.
| Task | Expression | Result |
|---|---|---|
| Arithmetic | prop("Qty") * prop("Price"), +, -, /, %, ^ |
|
| Round to places | round(1234.5678, 2) |
1234.57 |
| Round down, up | floor(2.7), ceil(2.1) |
2, 3 |
| Absolute value | abs(-5) |
5 |
| Smallest, largest | min(3, 7, 1), max(3, 7, 1) |
1, 7 |
| Text to number | toNumber("1234.5") |
1234.5 |
| Number to formatted text | formatNumber(1234567.891, "commas", 2) |
"1,234,567.89" |
| Currency text | formatNumber(-1234.5, "usd") |
"-$1,234.50" |
| Short form | formatNumber(1234567.891, "humanize") |
"1.2M" |
Also available: sqrt, cbrt, pow, exp, ln, log10, log2, sign, mod, pi(), and e().
A blank number is not 0: arithmetic on an empty value fails the run with “Numeric operand is empty”, and division by zero fails with “Division by zero”. Guard both:
setProp("Price", if(empty(prop("Quantity")) or prop("Quantity") == 0, 0, prop("Consideration") / prop("Quantity")))Dates are UTC. A column typed date reads as a date; text dates convert with parseDate, or with setType(name, "date") for ISO-8601 text.
| Task | Expression |
|---|---|
| Parse ISO-8601 text | parseDate("2026-09-30") |
| Parse another format | parseDate("30/09/2026", "DD/MM/YYYY"), parseDate("30 Sep 2026 5:55 PM", "D MMM YYYY h:mm A") |
| Format as text | formatDate(prop("Trade date"), "YYYY-MM-DD"), formatDate(now(), "MMMM D, Y") |
| Add or subtract | dateAdd(prop("Trade date"), 2, "days"), dateSubtract(today(), 1, "months") |
| Difference | dateBetween(prop("Settle date"), prop("Trade date"), "days") |
| Start or end of a range | dateStart(range), dateEnd(range) |
| Parts | year(d), month(d), date(d) (day of the month), day(d) (weekday, 1 is Monday), week(d), hour(d), minute(d) |
| Now and today | now(), today() |
| Unix time | timestamp(d) in milliseconds, fromTimestamp(ms) |
Units are "years", "quarters", "months", "weeks", "days", "hours", and "minutes". formatDate and parseDate take Moment tokens (YYYY, MM, DD, HH, mm, …); text in [brackets] is written as is.
setProp("Trade date", parseDate(prop("trade_date_text"), "DD/MM/YYYY"))setProp("Days to settle", dateBetween(prop("Settle date"), prop("Trade date"), "days"))setProp("Period", formatDate(prop("Trade date"), "YYYY-[Q]Q"))now() and today() read one clock per run, so every row of a run sees the same moment.
Conditional values
Section titled “Conditional values”| Task | Expression |
|---|---|
| Two-way choice | if(prop("side") == "B", "BUY", "SELL"), or prop("side") == "B" ? "BUY" : "SELL" |
| Many-way choice | ifs(prop("score") >= 90, "A", prop("score") >= 75, "B", "C") |
| Default for a blank | if(empty(prop("ccy")), "EUR", prop("ccy")) |
| Combine conditions | and, or, not, or &&, ||, ! |
| Compute once, use twice | let(n, prop("qty") * prop("price"), if(n > 1000, n * 0.99, n)) |
Lists come from split, match, a list column, a JSON array, or every column after groupBy.
| Task | Expression | Result |
|---|---|---|
| Transform every item | [1, 2, 3].map(current * 2) |
[2, 4, 6] |
| Keep some items | [1, 2, 3].filter(current > 1) |
[2, 3] |
| Find one item | [5, 8, 13].find(current > 6) |
8 |
| Any, all | prop("tags").some(current == "urgent"), .every(…) |
|
| Contains | prop("tags").includes("urgent") |
|
| Join into text | ["a", "b"].join(", ") |
"a, b" |
| Pick an item | at(list, 0), first(list), last(list) |
|
| Part of a list | slice(list, 1, 3) |
|
| Sort, reverse, unique | sort(list), reverse(list), unique(list) |
|
| Flatten | [[1, 2], [3]].flat() |
[1, 2, 3] |
| Count, total | count(list), length(list), sum(list) |
Inside map, filter, find, findIndex, some, and every, current is the item and index its position.
Look up a value in another table
Section titled “Look up a value in another table”inputs().prop(handle).find(column, value) returns the first row of a named table whose column equals the value, and .prop(name) reads a field from it:
setProp("FX rate", inputs().prop("fx").find("ccy", prop("ccy")).prop("rate"))A miss gives empty. See Combine tables.
Running state across rows
Section titled “Running state across rows”context() holds values for the whole run, which makes running totals and maximums possible without grouping. This marks the row with the highest price:
context().setProp("highest", 0)if(prop("price") > context().prop("highest"), context().setProp("highest", prop("price")))setProp("is_highest", prop("price") == context().prop("highest"))The second statement runs over every row before the third starts, so the third compares each row with the highest price of the whole run. For a running total that each row reads up to itself, add and write in one do(…); see Language basics.