Set up so only tasks with X tag shows up in one list and X without tag in another

Hi!

I’m trying to set up so to that dataview includes tasks with a certain tag attached to them in one list and shows tasks without that tag in another list, I.E.

## TODO

- [ ] Some task from my daily

## Waiting

- [ ] Some other task from my daily, that can be right below the other task but this one has a #waiting tag

Things I have tried

I tried setting up the following query

## Todo

TASK FROM "" AND -#Waiting
WHERE !checked 
AND text != ""

## Waiting

TASK FROM #Waiting
WHERE !checked 
AND text != ""

Now this almost works, but if the #waiting tag is included in one task, it will count all the tasks within the entire file as having the #waiting tag while I’d like to just include that one line that has it.

This may be a better place to ask your question: Discussions · blacksmithgu/obsidian-dataview · GitHub

  1. Tags are, by default, page level metadata. If you define as source FROM #waiting it filter all pages with that tag, not the tasks with the tag.

  2. If you want to filter a tag inside tasks content, then you need to filter inside tasks level.

  3. To check how metadata works in specific note, use this inline js query:

`$=dv.span(dv.current())`
  1. To filter uncompleted tasks with specific tag you can use this method:
TASK
FROM "your/folder/path"
WHERE !completed
WHERE contains(tags, "#waiting")

(to filter out, use WHERE !contains(tags, "#waiting"))

  1. To select tasks under a specific header/section, you can use this:
TASK
FROM "your/folder/path"
WHERE !completed
WHERE meta(section).subpath = "TODO"
2 Likes

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