Notion Answers

Help between Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

0vote

I have tried running a formula for one of the properties in my pages however it seems to have an issue. For context I am creating a formula to show if 0 to 1 days have passed since I last reviewed my work, It would show “1 Day” until the next review. Then if 1-3 days have passed then it will say “3 Days” until the next review. Etc.
Here’s exactly what I am looking after:

Days passed‎ ‎ ‎ ‎ ‎ ‎ |‎ ‎ ‎ ‎ ‎ ‎ Next Review
0-1 ------------------> 1 Day
1-3 ------------------> 3 Days
3-7 ------------------> 7 Days
7-28 -----------------> 1 Month
28+ ------------------> 3 Months

This is to create expanding spaced repetition.

However, my code jumps between “next review” dates.

Below in the attached photos are examples:

It works for “1 Day” and “3 days”, however at day 3 to day 6/7 it should say "7 days” but says "3 months”.
Additionally even more irregularities is like between day 10 and day 27 it shows “3 days”, and at some random large numbers like day 116 also shows “3 days"

The “Last Review" property is just a date property.
"Days Ago" property is a formula.
"Semi final formula" is a formula.

I have also added screen shots below (in the image link) of my formula for both the days ago property and the semi final review property.

Is there a mistake on my behalf or the my notion? What should I fix?

Image link - Images of Notion issue - spaced repetition

The code:

if(

    prop("Days Ago") > "28",

    "3 Months",

    if(

        prop("Days Ago") > "7",

        "1 Month",

        if(

            prop("Days Ago") > "3",

            "7 Days",

            if(

                prop("Days Ago") > "1",

                "3 Days",

                "1 Day"

            )

        )

    )

)

1 Answer

1vote

Hey,

try this, it should work better.

prop("Days Ago") > 28 ? "3 Months" : prop("Days Ago") > 7 ? "1 Month" : prop("Days Ago") > 3 ? "7 Days" : prop("Days Ago") > 1 ? "3 Days" : "1 Day"

And if it did not try this one. It might be a value type issue. This one should work with both text and number value type.

toNumber(prop("Days Ago")) > 28 ? "3 Months" : toNumber(prop("Days Ago")) > 7 ? "1 Month" : toNumber(prop("Days Ago")) > 3 ? "7 Days" : toNumber(prop("Days Ago")) > 1 ? "3 Days" : "1 Day"

Please let me know if it worked.

Thanks.

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect