I am trying to show tasks from various notes filtering these based on a specific tag (#test/tag)
Things I have tried
It works as far as it takes existing tasks from different notes – however, when I have a list of notes in a file, the dataview filter takes all existing tasks beneath the first task with a tag,m even though they have different tags.
For example:
List of todos in specific note file:
Funding Project A #test/tag
Testtask #anothertest/tag
Dataview Code:
TASK
WHERE contains(file.tags, "#test/tag") AND !completed
Output:
Funding Project A #test/tag
Testask #anothertest/tag
So dataview seems to be listing anything below the correct tags, whether it has the correct tag or not.
I think it is because tags are note-level metadata, i.e. they apply to an entire file and cannot be isolated.
With text, we can isolate words as list-level or task-level metadata, which means we can ask Dataview to query the tag as if it were text only and therefore extract just the lines of data that we need. I think your original way makes more sense, but …
That’s my understanding of things, but I am a novice when it comes to Dataview.
In a TASK query there is also a difference between file.tags and tags, where the first refers to all tags related to the file, and the second refers to the tags of a given task. Incidentally the use of text also refers to just a single task. (If I’m not mistaken)