Probleme with combining Dataview-Query with daily notes

Things I have tried

In my daily note I want to have a dataview, of all the tasks I completed (just) today.

So here is my dataview:

TABLE WITHOUT ID
	regexreplace(Tasks.text, "\[.*$", "") AS Tasks 
WHERE file.tasks FLATTEN file.tasks AS Tasks 
WHERE Tasks.completed 
WHERE Tasks.completion = this.file.name
SORT Tasks.to DESC

but the result shows nothing:

As you can see, my daily notes have the format YYYY-MM-DD. When I complete a task, I annotate a inline-metadata like [completion:: YYYY-MM-DD].

In the following dataview, I get the correct result, so I assume the failure in the code above hides in that line: “WHERE this.file.name = Tasks.completion”

TABLE WITHOUT ID
	regexreplace(Tasks.text, "\[.*$", "") AS Tasks, 
	Tasks.link AS "created", 
	Tasks.completion AS "completion              " 
WHERE file.tasks FLATTEN file.tasks AS Tasks 
WHERE Tasks.completed 
SORT Tasks.to DESC

Can anybody help me with that?

Thanks in advance!
Silias

Yes, the main error is in WHERE Tasks.completion = this.file.name:

  • you’re comparing two different things: date ≠ string
  • Tasks.completion is a date and this.file.name is a string

You’ve two ways: transforming this.file.name in a date or using the implicit field file.day (see plugin documentation to understand when it exists and what means).

WHERE Tasks.completion = date(this.file.name)

or

WHERE Tasks.completion = this.file.day
1 Like

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