Dataview query for zettelkasten index page

I’m trying to reproduce the dataview query below, replacing the linked file names with linked titles. I want to use it as a Zettelkasten index page showing pages grouped and sorted by tag with the link text using the title instead of the Zettel unique name.

The tags column works fine, but the link text is the Zettel unique name. I want to replace the link text with the frontmatter title.

TABLE WITHOUT ID (link(substring(tag,1)) + " (" + length(rows.file.link) + ")") AS Tags, link(sort(rows.file.name)) AS Files
FROM ""
WHERE file.tags
FLATTEN file.tags AS tag
GROUP BY tag

I tried the query below and the tags part works, the links work, but I want to replace the link text with the frontmatter title.

When I tweak on the files column, I can get what looks like a link to a file that uses the title, but when I hover over the link it says “Unable to find “File Name” in Home.” Home is the name of the page where I am writing the query. And if I click on a link it creates a new page in the root with the file name = title.

TABLE WITHOUT ID (link(substring(tag,1)) + " (" + length(rows.title) + ")") AS Tags, link(sort(rows.title)) AS Files
From ""
WHERE file.tags 
FLATTEN file.tags AS tag
GROUP BY tag

The basic query is linking the files propery (using title as link text, and showing the tags, but of course there is no grouping and the tags are not linked.

table without ID substring(file.tags,1) as tag, link(file.name,title) as title
from ""

Any help would be greatly appreciated.

Given a random link like aLink, type need to do link(aLink, "alias of link") to change the alias of it. Furthermore to do that on a list I would suggest doing map(listOfLinks, (aLink) => link(aLink, "the new alias of that link"))