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

1vote

Creating habit streak

I'm trying to calculate the habit streak to show in the This Year area but I can't seem to find or figure out a formula to calculate the habit streak. I want to create a formula that shows the current streak, the highest streak and if the current streak matches the highest streak then text will display showing "new highscore reached" else "x days to go until you hit your highscore"

My current set up is having the habits as rows and the columns as the days of the week with checkboxes, after a week these will archive and I will create new pages for these same habits. I currently have a progress percentage and habit grade that will update with the new pages that get added.

Current set up: https://stardive.notion.site/Habits-38781875616c4b99bda345808ed8aa8a?pvs=4

Could someone please help me? Thank you!

1 Answer

1vote

Hi,

it is little bit tricky to achieve this in Notion. It might need a 3rd party automation tool to achieve this in my experience.
This is how you could set up the habit streak, highest streak, and the custom message:

1) Current Streak Calculation:

  • For this, you'll need to count the number of consecutive days you've checked off the habit. This can be a bit tricky in Notion, especially if you're archiving weeks and creating new pages.
  • One way to do this is to have a "Streak" property that you manually update each day. If you complete the habit, you increment the streak by 1. If you miss a day, you reset it to 0. This isn't automated, but given Notion's current capabilities, it's a straightforward approach.

2) Highest Streak Calculation:

  • Create a new property called "Highest Streak".
  • Each time you update your "Streak" property, you'll compare it to the "Highest Streak". If the current streak is greater than the highest streak, you update the highest streak to match the current streak.

3) Custom Message:

  • Create a formula property called "Message".
  • The formula will compare the "Streak" and "Highest Streak" properties. If they're equal, it will display "new highscore reached". If not, it will show how many days are left to reach the high score.

    This is an example formula for the "Message" property:

    if(prop("Streak") = prop("Highest Streak"), "new highscore reached", concat(toNumber(prop("Highest Streak")) - toNumber(prop("Streak")), " days to go until you hit your highscore"))

4) Automation:

  • Notion doesn't currently support native automation for these kinds of tasks. However, you can use third-party tools like Zapier or Make to automate some of these processes, like resetting the streak if a day is missed. This would require a more complex setup though.

5) Archiving and New Pages:

  • When you archive a week and create a new page for the habits, you'll need to manually carry over the "Streak" and "Highest Streak" properties to the new page. This ensures continuity in your tracking.

Not an elegant solution at all but might work...

I will think about it little bit more and let you know if I come up with something that could be done in Notion alone.

Martin

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