hmm
First, why this behavior? Because in your case due is a link, not a simple date. And link is a problematic thing to sort. Why? Because link is a path with a multiple behaviors inside obsidian (because the problem of files with same names but in different folders).
- In your case you have the multiple due date links (daily notes?) in different folders. That’s why you see some small groups with the wanted sort, because they are in the same folder (and they have a shared path > something like
folder/sub-folder/2022-04-28.md) - you can add a column with this target:
Tasks.due.file.path(this only works if the file exists! file needs to be real) - once again, I repeat: files need to exist as md files. (and you need to correct all the due links you send because you need to remove the space before the date/name, i.e., this
[[2022-04-29]]and not[[ 2022-04-29]]… this is important) - Now, instead of the
file.pathlet’s “extract” thefile.nameof each link in due withTasks.due.file.name. - Now, we need to convert this value to a date (to better sort order) using
date(Tasks.due.file.name) - Finally, use this to sort your table (important: the order of the commands matter):
```dataview
TABLE WITHOUT ID
regexreplace(Tasks.text, "\[.*$", "") as Task,
meta(Tasks.section).subpath as "Status",
Tasks.due As "Due Date",
Tasks.Project As "Project",
file.link as "File"
FROM "Projects"
FLATTEN file.tasks As Tasks
WHERE !Tasks.completed
SORT date(Tasks.due.file.name)
LIMIT 20
```