Dataview table that filters with the first letter

What I’m trying to do

I have a dataview table that display the author, literature note, and the journal. The issue is that this list is getting quite long so I’m trying to divide the table by the first letter of the author’s name, like a glossary.

I have literature notes, in which there is a field “authors” and the values are the internal links to notes where the title of the note is the author.

For example, I have a note called [[Eslami.Jafari.ea2021]]. Inside, I have in-line fields that look like,

authors:: [[Eslami, Mohammad H.]], [[Jafari, Hamid]], [[Achtenhagen, Leona]], [[Carlbäck, John]], [[Wong, Alex]]

What I’d like to achieve are 26 tables, one for each alphabet.

Things I have tried

I’ve managed to go from the image above to the image below by using the command
where substring(,0,1) = "A".

The first issue is that most of my authors’ name file are not yet created so when I used this command where substring(,0,1) = "A" the table only returns authors files that have already been created. I’ve tried using but it didn’t work :frowning:

table as "Literature Note", rows.publisher as "Journal"
from "30 zotero import"

flatten authors
group by authors as Authors where substring(,0,1) = "A" 

sort rows.authors ASC
limit 600

The second issue is, is there a workaround so that I don’t have to create 26 tables? The closest topic that I found on the forum was this topic, but I’m not sure how to modify it to suit my needs.
Below is my failed attempt at dataviewjs (I have zero knowledge on javascript).

let groups = dv.pages()
	.where(p => p.file.folder = "30 zotero import")
	.sort(p =>
	.groupBy(p =>,1).toUpperCase())
for (let group of groups) {
	dv.header(4, group.key);
		["Authors", "Literature Note", "Journal"],
		.sort(k =>
		.map(k => k.file.))

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.