Database, Relations

Notion Tip: Calculate With Numbers In Relations/Text Properties

Screen Shot 2020-08-18 at 9.00.47 AM.png

🛠

Calculate With Text

Here are some tips for those seeking to minimize their Notion databases. Formulas can be used to manipulate number, text, and date properties, however, not all elements of a database have to live in separate properties to produce a successful formula. In the following example, I show you how to use relations and numbers in text properties to return a calculation.

Functions used in this scenario:

  • toNumber

  • Slice

The Scenario

Screen+Shot+2020-08-18+at+9.35.04+AM.jpg

This table shows a list of historical organizations, the year they started, and the year they dissolved. “Year Started” and “Year Dissolved” are page titles related from an external timeline database.

Questions To Answer

I converted text properties into numbers with “toNumber” function.

Find number of years the organization was active?

toNumber(prop("Year Dissolved")) - toNumber(prop("Year Started"))

Find all organizations that dissolved before the year 2000?

toNumber(prop("Year Dissolved")) < 2000

Minimize The Scenario

Screen+Shot+2020-08-18+at+9.59.03+AM.jpg

Here, I want to merge “Year Started” and “Year Dissolved” properties into the page title. I can still return answers to the same two questions above with toNumber and slice functions.

Questions To Answer

I used “Slice” to isolate each year, then converted “toNumber” before finding the difference.

Find number of years the organization was active?

toNumber(slice(prop("Name"), -4)) - toNumber(slice(prop("Name"), -11))

Find all organizations that dissolved before the year 2000?

toNumber(slice(prop("Name"), -4)) < 2000