Relations, rollups and formulas

Link the rows of two databases, calculate across linked rows, and compute values with formulas: syntax, functions and ready-to-use examples.

On this page
Documentation sections

Three column types go further than what you type in a cell:

  • a Relation links rows of one database to rows of another, for example each invoice to its client;
  • a Rollup calculates something across the linked rows, for example the total invoiced to a client;
  • a Formula computes a value from the other columns of the same row, for example the number of days left before a deadline.

Rollups and formulas are never stored. Filarr works them out each time it shows the table, so they are always up to date. You cannot type in them.

To add one of these columns, see Databases inside your notes: add a column, choose its type, then open Edit property from the column menu to set it up.

Relations

Say you have a Clients database and an Invoices database, each in a note.

  1. In Invoices, add a column and choose the type Relation.
  2. In Edit property, leave Direction on Links to… and choose the Related database: Clients. The list shows each database with the title of its note. It also offers the current database, marked This database, to link rows of the same table.
  3. Click a cell of the new column. Link rows opens a search in Clients. Pick one or more rows.

Linked rows show as small labels, with the first Text column of the other database. Click one to open the note that holds that database.

Two options help:

  • One link at a time: the next row you pick replaces the current one instead of being added. Right for "one client per invoice".
  • Create « … » at the bottom of the search adds the row to the other database when it does not exist yet. This does not work when that database is in the note you have open: add the row in its own table.

See the other side

A relation goes one way: the invoice knows its client, but the client does not list its invoices. To show them:

  • in the settings of the relation, click Add the backlinks column in « Clients »; or
  • in Clients, add a Relation column, set Direction to Backlinks (computed), then choose in Backlinks from the relation that points to it.

The backlinks column is computed from the other database. Nothing is stored twice, it cannot be edited, and deleting it loses nothing.

If the other database cannot be read (its note was deleted, or it is not in this vault), the cell shows Database unavailable and the links are kept as they are. Links to rows that no longer exist show as "1 not found": open the cell to remove them.

Rollups

A rollup follows a relation and calculates across the rows it links to.

  1. Make sure the database has a Relation column.
  2. Add a column of type Rollup.
  3. In Edit property, choose Through relation, then what to Calculate, then the Property to calculate in the other database. Count needs no property.
CalculateResult
CountNumber of linked rows
Sum, Average, Minimum, MaximumOf a number column in the linked rows
CheckedNumber of linked rows whose checkbox is checked
Percent checkedShare of linked rows whose checkbox is checked
Not emptyNumber of linked rows where the property has a value
List of valuesThe values themselves, one after the other

Example: the share of tasks done in each project. A Projects database has a Relation column Tasks that points to a Tasks database, which has a Checkbox column Done. In Projects, add a rollup: Through relation Tasks, Calculate Percent checked, Property Done. Each project now shows the share of its tasks that are done. A project with no linked task stays blank rather than showing 0%.

Formulas

  1. Add a column of type Formula.
  2. Open Edit property and write the formula in the Formula field.

Filarr checks the formula as you type. A mistake shows right under the field, for example Unknown column: Price. When all is well, the field reminds you of the main functions.

In the reading list below, a Formula column turns the status of each book into a word: if(prop("Status") == "Done", "Finished", if(prop("Status") == "In progress", "Reading", "Next up")).

How to write a formula

  • Name a column with prop("Column name"). Upper or lower case does not matter. A one-word name with no space also works on its own: Price * Quantity.
  • Put text in double quotes: "Late".
  • Write decimals with a dot: 1.2.
  • A Select column gives the name of its option, so you can write prop("Status") == "Done". A Multi-select gives its options separated by commas, a Checkbox gives true or false, a Date gives the day as 2026-09-30, and a Relation gives the number of linked rows.
  • true, false and empty are also values you can use.

Operators:

  • +, -, *, / for arithmetic, and % for the remainder of a division. + joins text as soon as one side is text: prop("First name") + " " + prop("Last name");
  • == (or =) and != to compare two values, <, <=, >, >= to compare numbers;
  • && for and, || for or, ! for not.

Functions:

FunctionWhat it gives
if(test, a, b)a when the test is true, otherwise b (or nothing, without b)
and(a, b, …), or(a, b, …), not(a)Combine or reverse true and false
isEmpty(x)True when x is empty
round(x), round(x, 2)Rounds, here to 2 decimals
floor(x), ceil(x), abs(x), sqrt(x)Rounded down, rounded up, without sign, square root
min(a, b, …), max(a, b, …)The smallest or largest number
number(x), text(x)Turns text into a number, or anything into text
concat(a, b, …)Joins texts
join(", ", a, b, …)Joins texts with a separator, given first
length(x), upper(x), lower(x), trim(x)Length of a text, uppercase, lowercase, without spaces at the ends
contains(x, "word")True when the text contains the word
today(), now()Today's date. Both give the day only, without the time.
dateDiff(a, b)The number of days from date b to date a

A number shows in the format of your language. True shows as a check mark, false as a dash.

When a formula shows an error

Instead of a value, the cell then shows the reason:

  • Unknown column: a name is misspelled, or the column was renamed;
  • Not a number: a calculation uses text, or an empty cell;
  • Not a date: dateDiff received an empty or invalid date;
  • Division by zero;
  • Circular formula: two formulas use each other;
  • Missing ), Unknown function: a typing error.

Five formulas to reuse

Rename the columns in quotes to match your own.

Days left before a deadline. With a Date column "Due date", this shows 3 when the deadline is three days away, 0 on the day, and a negative number once it is past:

dateDiff(prop("Due date"), today())

A row without a date shows Not a date. To leave it blank instead:

if(isEmpty(prop("Due date")), "", dateDiff(prop("Due date"), today()))

A status that updates itself. With the Status column of a new database and a Date column "Due date":

if(prop("Status") == "Done", "Done", if(isEmpty(prop("Due date")), "No date", if(dateDiff(prop("Due date"), today()) < 0, "Late", "On track")))

The total of a quote line, tax included. With the Number columns "Quantity", "Unit price" and "VAT %":

round(prop("Quantity") * prop("Unit price") * (1 + prop("VAT %") / 100), 2)

The progress of a checklist. With three Checkbox columns "Brief", "Design" and "Build" on each project, this shows 67% when two of three are checked. if turns each box into 1 or 0, even one that was never clicked:

round((if(prop("Brief"), 1, 0) + if(prop("Design"), 1, 0) + if(prop("Build"), 1, 0)) / 3 * 100) + "%"

To count tasks kept in another database, use the Percent checked rollup shown above.

Unpaid invoices older than 30 days. With a Checkbox "Paid" and a Date "Invoice date", the cell shows a check mark on the invoices to chase:

and(not(prop("Paid")), dateDiff(today(), prop("Invoice date")) > 30)

An invoice without a date shows Not a date: fill in its date.