Using dataview how do you display the tasks that were completed on a given day?

Things I have tried

Searching Youtube and this forum

What I’m trying to do

Using dataview how do you display the tasks that were completed on a given day?

1 Like

I would recommend you to do two things. First, have a task query and activate in dataview options “Automatic Task Completion Tracking”. This will allow you to automatically have the date of completion when you mark a task as done (COMPLETE THE TASK FROM THE QUERY!!)
The query is simple as

TASK
FROM "folder"
WHERE !completed

if you don’t bother if they are retrieved as tasks you can use

TASK 
WHERE completion != null AND completion = date("YOUR DATE IN FORMAT YYYY-MM-DD")

If you want just the text, you can have a table query that retrieves every task completed on x day. This can a little more tricky. If you want a specific day for every query, you can change the variable I put for date("YYYY-MM-DD")
this example outputs the tasks completed this week (the completion field should be in the task for this to work)

TABLE WITHOUT ID (filter(file.tasks, (t) => t.completion >= date(now) - dur(7 d)).text) AS " task completed this week"
WHERE file.tasks.completed AND file.tasks.annotated

the only problem is that it retrieves all the pages with completed tasks and annotated fields, therefore, it’ll display a blank from all those pages. I’m still figuring out how to do it. But I hope the first answer solved your question

1 Like

I thought, ‘Oh, the second block of code from dmtAt001 must be it!’, but it didn’t work.

Nothing displayed at all. Not even an error message.

Any ideas?

If I manually type in [completion:: “yyyy-MM-dd”] where the characters between " " to the same date as in the code block, the task displays… but I want a solution where dataview reads the implicit variable value.

…but it works on a mac but not on a windows OS…

Why doesn’t it work on the windows installation?

Seem I have the same settings configured for both platforms…

Seems I had the tasks plugin working on the mac. Installing and enabling tasks, and the toggling on the ‘Set done date on every completed task’ forces a completion value creation. However with that option disabled, it doesn’t work on the mac either.

I was looking for a dataview only solution, so I’m not going to flag this post having discovered one solution. Anyway, I have a workaround now, so I’m grateful.

Thanks dmtAt001

Maybe fix #448 associated with version 0.4.20 doesn’t work on my machines? Anyone have any ideas?

https://blacksmithgu.github.io/obsidian-dataview/changelog/#0420

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