I have the following Dataview table that is successfully sorted by a value assigned to INDEX.
TABLE WITHOUT ID
file.link AS Projects,length(filter(file.tasks.completed, (t) => t = true)) AS Completed, length(file.tasks.text) as Total, "<progress value='" + (length(filter(file.tasks.completed, (t) => t = true)) / length(file.tasks.text)) * 100 + "' max='100'></progress>" AS Progress
FROM "PROJECTS"
SORT INDEX DESC
i would like to have the INDEX as link instead to text, but then sorting stops to work.
As can be seen index holds the value of heisann, but there is no values associated with [[index]]. And no fields holds the value of 5.
So when you state that doing the SORT INDEX DESC works, but SORT [[INDEX]] DESC doesn’t work. What doesn’t work about it? The first sort statement there refers to a INDEX variable within each of the corresponding files in FROM "PROJECTS".
I don’t know what value that is, but if it’s a field with the name of a note, possibly you’re looking for something like this?
```dataview
TABLE WITHOUT ID
file.link as Projects,
link(index) as Index,
length(filter(file.tasks.completed, (t) => t = true)) AS Completed,
length(file.tasks.text) as Total,
"<progress value='" + (length(filter(file.tasks.completed, (t) => t = true)) / length(file.tasks.text)) * 100 + "' max='100'></progress>" AS Progress
FROM "PROJECTS"
SORT INDEX DESC
```
This would sort by the note name, and add a link to that note in the second column using link().
If INDEX on the other hand just holds some random numeric (or not note-related ) sorting value, I’m truly at loss to what you want to achieve doing SORT [[INDEX]] DESC.