Dataview sorting bug(?)

Things I have tried

Hi everyone, I have some notes inside a folder that I want to be listed and then grouped trough dataview, nothing fancy:


TABLE rows.file.link as "LEANINGS"
FROM  "xxx/Journal/Learnings"
GROUP BY dateformat(file.ctime, "MM") AS MON

As expected my notes are being grouped by months… But if I want to display “August” instead of “08”:


TABLE rows.file.link as "LEANINGS"
FROM  "xxx/Journal/Learnings"
GROUP BY dateformat(file.ctime, "MMMM") AS Month

As you can see the order gets completely “randomized”… How can I solve?

Thank’s.

You mentioned “sorting”… but where is the sort command?

With dateformat(file.ctime, "MMMM") or dateformat(file.ctime, "MM") you’re producing strings, not dates (i.e., you’re grouping by a “produced” string from a date).
Then, by default, groups (as strings) are sorted by alphabetic order!

At the end of each code (the two codes you posted above), add this line

SORT rows.file.ctime ASC

Thank you very much, that fixed it.

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