How can I get the number of completed tasks group by year?

How can I get the number of completed task from the current year ?

I try something like this but “now()” or “today()” dont exist (thx chatGPT…)

TABLE WITHOUT ID
length(filter(rows.tasks, (r) => r.completed)) AS Completed
FROM "NOTES/100 choses à faire avant de mourir"
WHERE completed >= date(now().format("YYYY") + "-01-01") 
  and completed <= date(now().format("YYYY") + "-12-31")
FLATTEN file.tasks as tasks
GROUP BY true

Could you tell me the good syntax?

Now I would table with year and number of task completed in this year for each year where at least one task was completed, any idea ?

Exemple :

20201
202110
20234

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.