Dataview list query: how to exclude tags/files from some folders

Hi All,

I use a lovely query that gives me all sub-bullets of all bullets containing a certain tag:

LIST item.children.text
FROM #tag
WHERE file.day > (date(today) - dur(360 days))
FLATTEN file.lists as item 
WHERE contains(item.tags, "#tag")
SORT file.day ASC

Now, some files were moved to an “Archives” folder, and I want to exclude it from my query.
I tried to add criteria:

WHERE !contains(file.path, Archives)

And it does not work, no matter if I use quotes, file.folder, …

Can you please help me enrich my query to exclude all files which path contains “Archives”?

Thanks!

As far as I can see your second WHERE clause doubles the FROM clause. So why not replace the latter like following?

FROM -"path_to_your_Archives"

It makes much more sense indeed!
Thank you!

1 Like

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