Unable to Sort Date in YAML

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

I am trying to find a list of notes sorted by an attribute name DateReported in YAML format.

Things I have tried

Search through the forum and tried dateformat method with flatten but result is not what I am looking for.

Dataview code below:

TABLE
	Status as "Incident Status",
	IncidentTitle as "Incident Title",
	SeverityLevel as "SLA",
	RCAStatus as "RCA Status",
	DateReported as "Date Reported",
	DateResolved as "Date Resolved",
	DateClosed as "Date Closed",
	IncidentConclusion as "Incident Conclusion"
FROM #IncidentManagement 
WHERE Status != "Active" AND contains(Project,"iB") 
SORT DateReported DESC

Notes with DateReported field is stored in date format like eg. Thursday, 09-Mar-2003 or Thu, 09-Mar-23.

Can advise how to get the list of notes sorted by DateReported from latest (ie. DESC).

When using dataview those are not considered dates, but just strings. Only dates in the format “YYYY-MM-DD” is considered dates by default from dataview.

With that being said, it’s possible to convert those strings back into dates, but it do require a change to dataviewjs, as far as I know, and I’m not sure if you want that.

So the better solution would be for you to change into a proper date format like shown above.

Looks like that is the easiest way.

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