candl docsOpen candl
Guides / Datasets

Calculated fields in datasets

Add columns candl works out for you, such as a balance owed, and use them as merge tags.

3 min readUpdated 20 Nov 2026Uses example data

Calculated fields

A calculated field is a column candl works out for each record, from the record’s own columns, from another dataset, or both. It is a merge tag like any other column. Open the dataset’s settings, tab Columns, and choose New calculated field.

Start from a ready-made one (Balance owed, Number of records, Most recent answer, Days since a date, Combine text) or Blank. You can also describe it in words and let AI write the formula; check what it writes.

The formula language

[Fee]
A column of this record, in square brackets.
"Paid"
Text, in quotes.
+ - * /
Arithmetic.
&
Joins text: [First Name] & " " & [Last Name].
= <> < <= > >=
Comparisons, with AND, OR and NOT.
Functions
More than 50, in five groups: Logic (IF, IFS, SWITCH, ISBLANK), Numbers (ROUND, SUM, CURRENCY), Text (UPPER, LEFT, CONTAINS) Dates (TODAY, ADDDAYS, YEARS, FORMATDATE) and Many rows (MATCHING). The formula reference lists every function with what it does and an example, and has worked recipes.

Example: what each family still owes for the bus

BusPasses has a Fee for each student. Payments are in a second dataset, BusPayments, with many rows per student and an Amount column. You want one merge tag that says what is left.

  1. In BusPasses, New calculated field, Balance owed. Name it Balance owed, Shows as Price.
  2. The card a value from another dataset is named Total paid. Set it to The sum of Amount from BusPayments.
  3. Rows that belong to this record: where Record ID is this record’s Record ID, so only Levi’s payments count toward Levi’s fee.
  4. To count only this year, choose Only some rows, for example Date is after 2026-09-01.
  5. The formula:
    Formula
    [Fee] - [Total paid]
  6. Pick a student under Result for to see his result, then Done and save the tab.

Now {{BusPasses:Balance owed}} fills in each family’s balance. For a friendlier line, make a second field with this formula:

Formula
IF([Balance owed] > 0, "You still owe " & CURRENCY([Balance owed]), "Paid in full, thank you")

candl works calculated fields out again when rows arrive (an import, a sync or a form answer) and when the dataset’s settings are saved. A formula with a mistake shows Needs fixing in the list, with what is wrong.

Blanks count as zero. In a formula an empty number is treated as 0, so a family with no payments owes the whole fee, and dividing by zero gives 0 rather than an error. SUM and AVG skip empty values instead. Text comparisons ignore capitals, so [Status] = "paid" matches Paid.
Dates can be added and subtracted. Subtract one date from another to get the days between them, or add a number to a date to move it that many days, for example [Due] - TODAY().
One field can use another, but not in a circle. A calculated field can read another calculated field in the same dataset. If two fields each read the other, neither can be worked out and both show Needs fixing.