Excluding a specific tag from a query

I use this query to display only “not done” tasks for projects. It is useful for checking that the remaining tasks are correctly tagged or scheduled. Using it, I can quickly review a large number of projects without needing to go to individual project files and without being distracted by tasks already done or other project-related entries that live on the individual project files. When I find a problem I can use the Hover plugin to open the project file and make a correction.

TASK 
FROM "Notes/GTD/Projects/Normal Projects" 
WHERE !completed

The output of the query has this structure:

Project A
list of not completed tasks
Project B
list of not completed tasks
Project C
list of not completed tasks

Undesirably, the query lists three standard closeout jobs for each project that are never done until the project itself is completed. Example of these tasks:

  • [ ] #n/task Consider this project for use as a recurring project. #s/closeout.

Is it possible to modify the query so that tasks with a specific tag (in this case #s/closeout) are excluded?

I have tried many variations, including modifying the FROM statement by adding:

“AND -#s/closeout”

but none work and at this point I’m not even sure that what I’m trying to do is possible.

Try this:

```dataview
TASK
WHERE !completed
  AND !contains(text, "#s/closeout")
```

Thank you!

With beta version there’s a new implicit field to tags inside tasks:

TASK
WHERE contains(tags, "#tag")
1 Like

Thank you. I saved this information for future use.