I add to my knowledge base information about the films I have watched and the actors associated with these films. I have a separate file “Actors”, where using the Dataview code a table with data of the actors is displayed: name, date and place of birth, etc. Among this data are the films in which they starred. The idea is that these films will be notes-films that I previously created. I do this using file.inlinks.
However, I ran into a problem: I need to exclude the daily notes folder (Daily) from the mentions output. Now it looks like this:
table without id
file.link as "Actor",
born as "Born",
height as "Height",
file.inlinks as "Movies"
from #movies/actors and !"Templates" and !"Daily" and !"Actors"
I keep all my notes in the root. I also use the “Daily” folder to take daily notes. In my daily notes, I actively link information to the notes from the / (root). So far, the formula that I use is the only working solution for me and where is not yet suitable for solving my problem.
When writing daily notes, I can insert the name of an actor and make it a link to a separate page. Dataview treats this as a mention of the actor, adding a daily note to the list of movies that actor has starred in. Here’s what a daily note looks like:
table without id
file.link as "Actor",
born as "Born",
height as "Height",
filter(file.inlinks, (o) => !contains(o.file.folder, "Daily")) as "Movies"
from #movies/actors and !"Templates" and !"Daily" and !"Actors"
In addition to the variant you’ve marked as your solution, it could also be done using properties to declare that the movies are actual movies (and/or to denote that the daily notes are just that, daily notes), and then add clauses to the query to exclude/include just notes of the given type.
This could be useful for example if you extend your information to also includes actors or figures being in both movies and books and … . With the note marked as a given type, you could then have dedicated columns for the various media the actor is present in.
An untested variant of the “Movies” column could then become something like:
filter(file.inlinks, (l) => l.type = "Movie") as Movies