skip to Main Content

Using Notion, I have databases one Class Lessons and one for Summary Stats.

In the Class database, I have a Relation type property linked to Summary Stats for every class.

In the Summary database, I have a rollup to count the all-time overall total number of class lessons done and dates etc.

However, I would like another property setup in Summary Stats to calculate and show Current Monthly Attendance (count how many lessons have been attended this current month) in number format.

Overall, I am struggling to create a formula to count out how many lessons are in the current month because filter is not a function in Notion.

How can I achieve a property to count Current Month only in order to view class count for the current month?

Thanks

2

Answers


  1. Chosen as BEST ANSWER

    I've found a simple solution.

    I created a new property in the Class database with a formula to check if the date is in the Current Month.

    formatDate(prop("Date"), "MM/YYYY") == formatDate(now(), "MM/YYYY")
    

    Then in the Stats Summary, I used a Rollup to Count the Checked boxes. This presents me the Dates in the Current Month as required.

    The limitation here though is that there is no condition with upcoming classes in the Class database after 'Today'. But for my requirements that's okay, because the Class only gets added and recorded after it happens.


  2. In Notion, you can achieve the desired functionality of counting the number of lessons attended in the current month by using a combination of properties and formulas. Here’s a step-by-step approach:

    1. Create a new property in the "Summary Stats" database to store the "Current Monthly Attendance" count. Let’s call this property "Current Month Attendance".

    2. Add a formula property in the "Summary Stats" database to calculate the current month’s start date. Let’s call this property "Current Month Start Date". The formula for this property can be:

      
      
         startOfMonth(now())
      
      
    3. Add another formula property in the "Summary Stats" database to calculate the current month’s end date. Let’s call this property "Current Month End Date". The formula for this property can be:

      
          endOfMonth(now())
      
      
    4. Next, create a rollup property in the "Summary Stats" database to count the number of lessons attended within the current month. Let’s call this property "Current Month Attendance Rollup".

      • In the rollup configuration, select the "Class Lessons" database and choose the "Relation" property that links the classes to the lessons.
      • In the "Aggregation" section, select "Count" to count the number of related records.
      • In the "Filter" section, choose the "Date" property of the "Class Lessons" database and set the filter to be:
    and(prop("Date") >= prop("Current Month Start Date"), prop("Date") <= prop("Current Month End Date"))
        ```
    
      This filter ensures that only lessons within the current month are counted.
    
    5. Finally, link the "Current Month Attendance Rollup" property to the "Current Month Attendance" property you created earlier. This will display the count of lessons attended in the current month in the "Summary Stats" database.
    
    With these steps, you should be able to calculate and display the current month's attendance count based on the lessons attended. Remember to adjust the property and database names as per your setup in Notion.
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search