Database, Relations

Notion Formula: Difference Between Two Values In The Same Column

Screen+Shot+2020-08-24+at+3.24.38+PM.jpg

๐Ÿ”บ Column Calculation

Calculating values in Notion that are in the same column is tough but possible. It requires relating and rollups. The example below shows how a user can find the discrepancy between two consecutive numerical values within the same column.

What I want to find: Is the current payment higher or lower than the previous?

The Properties

Each payment (entry) includes an input property. The next two properties are a child relation to grab the previous payment entry, and a rollup property to return the input of the previous entry.

Screen Shot 2020-08-24 at 12.57.51 PM.png
Screen Shot 2020-08-24 at 1.02.14 PM.png

The Formulas

Find discrepancy between current input and last input:

prop("Input") - prop("Last Input")

Return emojis and text alongside formula above:

(prop("Input") - prop("Last Input") > 0) ? ("๐Ÿ“ˆUP: " + "$" + format(prop("Input") - prop("Last Input"))) : ("๐Ÿ“‰DOWN: " + "$" + format(abs(prop("Input") - prop("Last Input"))))

View Example In Notion