Hi.
I’m trying to use dataview on notes to show other notes that share common tags.
I want to exclude some common tags from the criteria.
However, I don’t want to exclude the note note from showing up because they have said tags.
Use case:
Note A has the tags:
- blog
- goals
- time
Note B has the tags:
- blog
- goals
- management
Note C has the tags:
- blog
- cooking
- chicken
Note D has the tags:
- journal
- reading
Dataview’s role
If I’m in Note A, I want dataview to show Note B having common tags, but exclude Note C.
What I’m trying to accomplish is to not include blog as a tag in the criteria in-common criteria without excluding it.
I’ll provide the following query:
Dataview query
TABLE WITHOUT ID
link(file.link, title) as Note, common, unique
FROM
"blog"
FLATTEN
array(filter(file.etags, (f) => econtains(this.file.etags, f))) as common FLATTEN
array(filter(file.etags, (f) => !econtains(this.file.etags, f))) as unique WHERE
length(common) > 0 AND !contains(file.path,this.file.path)
SORT updated DESC
This problem, as it stands, can be solved by changing length(common) > 1, but that won’t work out well when adding nested tags (e.g. blog/faq, blog/keyword) into the mix.
Thank you
I appreciate you taking the time reading or helping me out.
I believe there’s a simple solution here that I’m just not getting…