Hey dataview experts, I am kind of desparate…
I am trying to produce a dataview table showing me all notes that share at least one tag with my current note - but grouped by tags.
Let’s say I have a note (the one where the dataview table is located) which contains 3 tags (#Tag1, #Tag2 and #Tag3/any-subtag). The end result shoúld be something like this:
|#Tag1||* Note 1
* Note 4
|#Tag2||* Note 3|
|#Tag3/any-subtag||* Note 1
* Note 3
The following code kind of works:
TABLE WITHOUT ID Tag, rows.file.link AS Notes FROM "folder" WHERE any(econtains(file.tags,this.file.tags)) FLATTEN file.tags AS Tag GROUP BY Tag WHERE any(econtains(Tag,this.file.tags))
BUT it also lists (in the first column) #Tag1xyz, #Tag1/subtag.
If I change the the code to
FLATTEN: this.file.etags AS Tag
Then only my 3 tags are shown - but for every tag a complete list of notes is listed that shares at least one of my 3 tags (means: under #Tag1, a note is listed that only shares #Tag2, for example…)
Despite several days of searching, trial and error I haven’t found out why… Is there anybody who could give me a hint what is going on or how I have to change my code in order to see the expected result?
Thanks in advance for any help!