Dataview plugin snippet showcase

Hello ,

I had a lot of difficulties to find how to sum data from daily note into weekly and monthly consolidations. Here is what I’ve found

Here is the data per day I want to sum:

The data is read from the YAML front matter

---
sport:
  freeletics: 15
---

To sum per week:

TABLE
	sum(default(rows.sport.kettlebell,0)) AS "Kettlebell",
	sum(default(rows.sport.freelitics,0)) AS "Freelitics",
	sum(default(rows.sport.pushups,0)) AS "Pushups",
	sum(default(rows.sport.abs,0)) AS "Abs"
FROM "daily"
GROUP BY file.day.month + "-" + file.day.week AS pipo

Result:

To sum per month:

TABLE
	sum(default(rows.sport.kettlebell,0)) AS "Kettlebell",
    sum(default(rows.sport.freelitics,0)) AS "Freelitics",
    sum(default(rows.sport.pushups,0)) AS "Pushups",
    sum(default(rows.sport.abs,0)) AS "Abs"
FROM "daily"
GROUP BY file.day.month AS pipo

Result:

Hope it helps someone

6 Likes