I just want to remove “Tagnotes” from this result. It’s a hub note.
I keep all notes that aren’t attachments and templates on the same folder, and I don’t want to create a new folder just because of one stubborn note.
inlinks would be the right option, since it gives you the notes linking to the note you’re currently in (at least that was the point when I was using where file.name = this.file.name)
Even cutting the second where and trying the change you suggested, results are the same
I guess the problem is in how inlinks function, then. Would it be a bug? It doesn’t make sense for it to work this way
It seems like what you want to do is not to remove that note from the overall file set result list, but just the presentation of a given file. That is slightly different as to what I read when first read your request.
Secondly, you can’t compare a link with a text. That is you can’t check if a list of links, file.inlinks, contains just the file name (as a text), "Tagnotes". You need to compare links against a links.
My proposed solution for your query would be to do:
```dataview
table Links
where file.name = "tag ~ self-improvement & polymath"
FLATTEN list(filter(file.inlinks, (i) => i != link("Tagnotes"))) as Links
```
You see the WHERE clauses limits which files are presented as rows in your table, and having a WHERE clause to remove a file could be the correct option if you got a file list like “circle, square, triangle, Tagnotes”, where you clearly wouldn’t want the "Tagnotesto be included. Then you would do something likeWHERE file.name != “Tagnotes”`.
When you want it excluded in a row within your table, you need to use filter() or similar effects. I’ve separated out the actual filter operation into a FLATTEN line as I feel they’re easier to read. The explanation from outer to inner is as follows:
FLATTEN list( ... ) as Links - Take the array produced by ... and store that as a list into the intermediate variable Links
filter(file.inlinks, (i) => ... ) – Since file.inlinks is a list, and we only want the part of the list not being our file, we use filter to loop through the list, and for each of the links, i, we do our check
i != link("Tagnotes") – With i being a single link we can compare that against another link, which we create using the function link() and the filename