Alphabetically grouped dataview table of all files

What I’m trying to do

I want to make a table that alphabetically lists all of the notes in my vault, with each row being a letter of the alphabet. If it’s possible, it’d be more convenient and compact than having a dataview list for each letter of the alphabet.

Note starts with Note link
A Apple, et cetera…
B Banana, et cetera…
C Carrot, et cetera…
…And the rest of the alphabet Et cetera…

I’d appreciate some help with the dataview code for this!

Something to start playing with it …

```dataview
TABLE WITHOUT ID upper(substring(file.name, 0, 1)) AS "Note starts with", file.link AS "Note link"
FROM ""
SORT file.name ASC
```

… but for a more adequate solution, you should provide more info.

Dataview resources:

Cheers, Marko :nerd_face:

Thank you! :grinning_face_with_smiling_eyes: Sorry if I wasn’t clear enough. I’d like a table like this.

Note starts with Note link
A Apple, Apple pie
B Banana, Banana split

Searching around and editing your code, I’ve got this so far…

TABLE WITHOUT ID upper(substring(file.name, 0, 1)) AS "Note starts with", join(sort(rows.file.link), ", ") AS "Note link"
FROM ""
GROUP BY upper(substring(file.name, 0, 1))
SORT file.name ASC

The only issue is that it displays a hyphen instead of the letter, like this.

Note starts with Note link
- Apple, Apple pie
- Banana, Banana split

How would I edit the code to display the letters?

Almost there :slight_smile:

```dataview
TABLE WITHOUT ID
  letter AS "Note starts with",
  join(sort(rows.file.link), ", ") AS "Note link"
FROM ""
GROUP BY upper(substring(file.name, 0, 1)) AS letter
SORT letter ASC
```

So we gave the first column the name letter. Then, we assigned a grouping to that name. We made proper sorting with the letters and not the file name, which is the same, but …

Cheers, Marko :nerd_face:

1 Like

Thank you Marko! That works perfectly :blush:

1 Like