如何计算当前月的出勤率?

huangapple go评论99阅读模式
英文:

How to calculate Current Monthly Attendance?

问题

使用Notion,我有两个数据库,一个是"Class Lessons",另一个是"Summary Stats"。

在"Class Lessons"数据库中,我有一个关联类型属性,链接到每个课程的"Summary Stats"。

在"Summary Stats"数据库中,我有一个汇总属性,用于统计所有时间内完成的课程总数以及日期等信息。

然而,我想在"Summary Stats"中设置另一个属性,用于计算并显示当前月份的出勤次数(统计本月已上了多少课),以数字格式显示。

总的来说,我在努力创建一个公式来计算当前月份有多少课程,因为在Notion中没有"filter"函数。

我该如何创建一个属性来仅计算当前月份,以便查看本月的课程数量?

谢谢

英文:

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

答案1

得分: 0

我创建了一个新的属性在Class数据库中,使用一个公式来检查日期是否在当前月份。

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

然后在统计摘要中,我使用了一个Rollup来计算选中的复选框的数量。这样就按所需方式呈现了当前月份的日期。

这里的限制是,在Class数据库中没有与“今天”之后的即将上课的课程的条件。但对于我的要求来说,这是可以接受的,因为课程只会在发生后添加和记录。

英文:

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.

huangapple
  • 本文由 发表于 2023年7月3日 16:10:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76602932.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定