I have multiple files in a “LOG” directory that I wanted to sort be log date, not creation date in missing log days were added at later dates. Here is what I came up with, fair warning I do not fully understand why it works in regard to the second choice.
The log files are named
ROBOT DAILY LOG 2024-09-XX
There is a YAML property “SORTING” that I define as “ASCENDING” or “DESCENDING”
TABLE reverse(substring(reverse(file.name),0,10)) AS "DATE"
FROM ""
WHERE contains(file.name, this.file.frontmatter.PROJ_NAME)
SORT choice(this.file.frontmatter.SORTING = "ASCENDING",
reverse(substring(reverse(file.name),0,10)),
DATE)
What I do not understand is why DATE, and reverse(DATE) or DATE ASC, DATE DESC
do not work.
If anyone knows a better way please let me know, I am hoping this not break in the future