Troubleshooting Dataview Query: Combining Conditions with AND for File Filtering

What I’m trying to do

TABLE without id
  file.link
FROM "1 Notes"
WHERE contains(file.name, "PCL") and !contains(file.tags, "principle")
SORT file.link

I am trying to filter out files that contain both “PLC” and without “principle” in tags. There is something off about the WHERE condition as both of them work separately but don’t work together when you add an AND condition.

Things I have tried

I have tried flattening tags and testing separate conditions without AND. They both work separately, but not together. I have also tried different ways of writing “principle” like “#principle” but to no avail.

Is there something I am missing?

You could possibly try to change the start to:

TABLE WITHOUT ID file.link, contains(file.name, "PCL"), !contains(file.tags, "principle")

This could help you showcase which files are “misbehaving”. When that is found you could potentially try to further list either file.name or file.tags to see if you understand why it misbehaves.

1 Like

Thank you! I found out that the files I was looking for had a typo in their name. That it why the condition didn’t work. I was so sure they were all correct.

1 Like

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