Red Gregory

View Original

Advanced Notion Formula: Find Interval Progression

How The Databases Are Setup

There are two databases:

  1. The calculator (top)

  2. The main database (bottom)

Each connect via a relation property.

I automate this connection with the following filter:

Next, a rollup called “Views” is made inside the calculator to Total Views from the original database. The formulas will refer to only to this rollup.

Formulas For Interval Progress

These formulas are located in the Calculator Database

Last Interval Formula

if(toNumber(replace(prop("Views"), ".*[,]", "")) - toNumber(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ".*[,]", "")) >= 0, "+" + format(toNumber(replace(prop("Views"), ".*[,]", "")) - toNumber(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ".*[,]", ""))) + " Views", format(toNumber(replace(prop("Views"), ".*[,]", "")) - toNumber(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ".*[,]", ""))) + " Views")

Increase %

floor(1000 * (toNumber(replace(prop("Views"), ".*[,]", "")) - toNumber(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ".*[,]", "")) - (toNumber(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ".*[,]", "")) - toNumber(replace(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ",(?:.(?!,))+$", ""), ".*[,]", "")))) / (toNumber(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ".*[,]", "")) - toNumber(replace(replace(replace(prop("Views"), ",(?:.(?!,))+$", ""), ",(?:.(?!,))+$", ""), ".*[,]", "")))) / 1000

The Formulas In Action

See this content in the original post

View Example In Notion

Further Reading

See this gallery in the original post