How to generate a column that filters out selected tags

Hi

I currently have this dataview

TABLE WITHOUT ID
file.link as Note,
filter(file.etags, (x) => !contains(x,"#change-my-day")) as Tags2
FROM #change-my-day 
SORT file.mtime DESC

which generates a column showing all tags other than the one I don’t want (“change-my-day”).

What I want to do is ALSO exclude the tag “#journal”. Anyone have any ideas what I need to do to generate this?

1 Like

You could try the following query:
````ad-info
title: DQL10_filter_by_file.etags
collapse: close
icon:
color:

TABLE WITHOUT ID
      file.link AS Note,
      file.etags AS Tags2
FROM #change-my-day 
WHERE !contains(file.etags,"#change-my-day") AND
      !contains(file.etags,"#journal")
SORT file.mtime DESC

````
Good luck! I hope this helps.

Hi. Thanks for your response. Just to clarify; I don’t want to exclude any files. I just want to exclude the display of specific tags of the files (in my WHERE clause). In other words I want a column that shows all tags other than #change-my-day and #journal

You could try the following query:
````ad-info
title: DQL20_filter_by_file.etags_excluding-no-files
collapse: close
icon:
color:

TABLE WITHOUT ID
      file.link AS Note,
      filter(
          file.etags,
          (x) => !contains(x, "#change-my-day") AND !contains(x, "#journal")
      ) as Tags2
FROM #change-my-day 
SORT file.mtime DESC

````

Good luck! I hope this helps.

There are many ways to write this! One way would be to change the second arg of filter to (x) => all(!contains(x, "#change-my-day"), !contains(x, "#journal)). Or you could get rid of the ! and change all to none.

thank you!!