How to hide specific file from dataview

How is it possible to hide a specific file from a Dataview query?

I have created a list of shortcuts which I want to be filtered by the “software” criteria
which I have added as metadata.

for some reason, the file “shortcut MOC” is also appearing on the list even though it doesn’t have any metadata attached to it.

Is it possible to subtract only this file instead of filtering by using a WHERE filter?

this is my Query -

table Software
FROM "My_stuff/Learning/SHORTCUTS" 

and the attached file is the results I get:

image

Thank you!

One way to do it would be to add another line to your query where software, which would require that field to have a value.

Another useful query extension would be to add WHERE file.path != this.file.path which eliminates the file the query resides in from the result set. Often found in MOC type of file queries.

Great, thank you!

Pretty sure you can do it from “FROM”

FROM [[yada yada yada]] AND -[[shortcut MOC]]

1 Like

When you say, “Is it possible to subtract only this file,” assume you have a specific file “Shortcut MOC.” I am satisfied omitting files from Dataview queries this way:

  1. Identify the folder where I want to hide files from being listed by Dataview. In my case, this was “Projects.”

  2. For each file I don’t want to list, add a key, “list” and set it to “false.” E.g.,
    “list:: false”

  3. Then write my dataview query something like this:

table status, priority
from "Projects"
WHERE (list != "false")
sort priority desc

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