Things I have tried
I have file for every author and a file for every book. In book file, there is ‘author’ variable in front matter; in author file I have dataview querying all works by author, which works fine
dv.table(["Title", "Published", "Pages"], dv.pages()
.sort(t => t.year, 'asc')
.where(t => t.author == dv.current().file.name)
.map(t => [t.file.link, t.year, t.pages]))
What I’m trying to do
Problem happen when a book has multiple author… I wish to display on author’s file books having multiple co authors where author contributed. I tried ‘include’ or ‘contains’ with dataviewjs, documentation online is confusing, syntax don’t work in obisidian. I tried the code below. Thank for help
dv.table(["Title", "Published", "Pages"], dv.pages()
.sort(t => t.year, 'asc')
.where(t => t.author.includes(dv.current().file.name))
.map(t => [t.file.link, t.year, t.pages]))