I’ve been experiment with ways to track and summarize time in daily notes, particularly with the bases feature, and I finally found something that seems to work well.
Tracking
In each daily note, I’m adding a string field for the total duration for that day in ISO 8601 format. An example is “PT1H45M” (for 1 hour and 45 minutes). Here’s a handy cheat sheet ISO 8601 Cheat Sheet.
Summarizing in Bases
To summarize, I have a base with all of the daily notes for a year (grouped by month for convenience). For fields that I want to track, I added a Custom Summary. The formula is values.filter(duration(value)).map(duration(value)).reduce(value+acc,duration(“PT0M”)).hours . I had to piece this together from help and other posts, so I’ll break it down.
values.filter(duration(value)): only use values that have a valid durationmap(duration(value)): turn each value into a durationreduce(value+acc,duration(“PT0M”)): add all the durationshours: show the total number of hours
I’m not sure if it’s the most efficient formula, but it does work. Hope this helps someone.