Sort by with dataview

Hi everyone,
first-time poster here :slight_smile: I am currently migrating from notion to obsidian, and I’m about to replace some helpful views I would like to have in obsidian too.

What I’m trying to do

I have a folder containing my daily notes, those are named like yyyy-mm-dd.
Another folder holds migrated notes from notion. Each migrated note is linked do a daily element, those links are stored as attributes like this:
image

now, I’d like to have a table that shows these files, in descending order. the table itself is working and shows the correct notes, but not in order:

dataview 
Table row["Daily notes"], Type
from "9 Migration"
where my-where-statement
SORT default(daily-notes, "") DESCENDING

the issue is that no order takes place. There are notes from 2022 and 2023, and both ASC and DESC have no effect.

Things I have tried

I also tried

dataview 
Table row["Daily notes"], Type
from "9 Migration"
where my-where-statement
SORT default(row["Daily notes"], "") DESCENDING

The same issue occurs if remove the default() function btw.

but in both cases, the files are not shown from latest to oldest. I was playing around with stuff like

SORT file.ctime DESC

but as these files are migrated, the file.ctime does not reflect the actual date. I’m not really sure why the sorting isn’t working (other tables work as supposed), but maybe the link attribute behaves differenty.

Thank you in advance!

I believe I figured it out…

SORT row[“Daily notes”].file.name desc

seems to work.

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