Relations

How to Incorporate Column Value Into Notion Formula

There is a major flaw in Notion that I hope gets fixed and that is incorporating column values into formulas. At least from what I gather, it requires a small hack and work around to make this function possible. And yes, it is possible. Below I will try my best to explain how I managed to find a solution.

Some databases that may need to use this function include: strategy-based tables, numerical-heavy databases and mass-filing systems. Grabbing the value of a column is doable on Notion (ie. Count All, Count Values, Count Unique Values, Count Empty, Count Not Empty, Percent Empty and Percent Not Empty). What we're going to figure out is how to utilize those values in a formula property. The tools we're going to implement are Relationยน and Rollupยฒ.

Step 1

Let's say we're trying to divide all values in the Tags column by all entries in the Name column. What this means is if there are 15 rows of Names that are filled, 15 will be the value we are using by selecting โ†’ Count All. There are 15 rows in Tags as well, but we only want to count rows that have data. This will require us to select โ†’ Count Values.

Screen Shot 2019-12-04 at 1.29.11 PM.jpg

Step 2

Next, add a formula property labeled Result, then add three new properties to the table โ†’ Relation Hide, Rollup Name Hide, Rollup Tags Hide, of which should be hidden after this tutorial.

Relation Hide โ†’ Choose the database you're working in, and choose Use the sample property. Next, add all entries into one cell.

Screen Shot 2019-12-04 at 1.59.11 PM.jpg
Screen Shot 2019-12-04 at 1.22.19 PM.jpg
Screen Shot 2019-12-04 at 1.59.47 PM.jpg

Step 3

Now, we are going to setup our two Rollup properties. Click Rollup Name Hide cell โ†’ Select the following:

  • Relation: Relation Hide

  • Property: Name

  • Calculate: Count All

Click Rollup Tags Hide cell โ†’ Select the following:

  • Relation: Relation Hide

  • Property: Tags

  • Calculate: Count Values

Screen Shot 2019-12-04 at 2.07.30 PM.jpg

Step 4 (Optional)

Let's look at the Result column now and make our formula. The following arrangement can be copy and pasted into result in order to make a simple calculation. Rollup Tags Hide divided by Rollup Name Hide. Of course, you may develop a more complex result with the values you'd like to plug in.

Simple Division Formula:

prop("Rollup Tags Hide") / prop("Rollup Name Hide")

If-Statement Division Formula:

if(prop("Rollup Tags Hide") / prop("Rollup Name Hide") == 1, "โ˜…โ˜†โ˜†โ˜†", if(largerEq(prop("Rollup Tags Hide") / prop("Rollup Name Hide"), .9), "โ˜…โ˜†โ˜†โ˜†", if(largerEq(prop("Rollup Tags Hide") / prop("Rollup Name Hide"), .6), "โ˜…โ˜…โ˜†โ˜†", if(largerEq(prop("Rollup Tags Hide") / prop("Rollup Name Hide"), .5), "โ˜…โ˜…โ˜…โ˜†", if(largerEq(prop("Rollup Tags Hide") / prop("Rollup Name Hide"), .4), "โ˜…โ˜…โ˜…โ˜†", if(smaller(prop("Rollup Tags Hide") / prop("Rollup Name Hide"), .4), "โ˜…โ˜…โ˜…โ˜… โœ“", ""))))))
Screen Shot 2019-12-04 at 2.15.25 PM.jpg

Footnotes

  1. Relation: A property used to grab data from one database in order to be accessed into another. All data in original database, including corresponding properties can be viewed in database using relation.

  2. Rollup: After the implementation of Relation, all properties associated with the relation may be actively used in a relational database. This also includes column values and other features.


VIEW EXAMPLE๏ปฟ