Red Gregory

View Original

Workaround: How To Use Rollups In Notion Calculations

For example, if I want to grab the total price of an item from an inventory database, place it into a sold database of which will become a component of a larger sum of items sold formula ... well, this shows up:

prop("Price 1") + prop("Price 2")

It only combines 45 and 20 to make 4520 instead of running an addition calculation. To fix this numerical frustration, the workaround is simple. We need to use toNumber:

toNumber(prop("Price 1")) + toNumber(prop("Price 2"))

Now let's discuss a workaround for rollup values within a complete database with multiple variables. The final database properties are as follows:

  • Quantity - Number

  • Item - Relation

  • Price - Rollup

  • Sent - Checkbox

Here is what the sum formula will determine:

If Sent 1 and Sent 2 checkbox true, then multiple Quantity 1 by Price 1 → add sum to Quantity 2 multiplied by Price 2

((prop("Sent 1") and prop("Sent 2")) == true) ? (prop("Quantity 1") * toNumber(prop("Price 1")) + prop("Quantity 2") * toNumber(prop("Price 2"))) : 0 
See this content in the original post

COPY TEMPLATE