Sort by folder year Z-A first THEN by filename A-Z

I have struggled to get 2-column sorting to work properly. I've researched and found the common answer is to make a custom column with a sort by set to %column A% %Column B%. This sort of works, but the ordering isn't good in my circumstance.

So in my case I sort by pathing and then filename and it comes out like this:
2020\bandA - songA
2020\bandB - songB
2021\bandC - songC
2021\bandD - songD

or I can sort the column in reverse and get this:
2021\bandD - songD
2021\bandC - songC
2020\bandB - songB
2020\bandA - songA

The problem is, I'm looking for the entirety of the sort to be displayed in this order:
2021\bandC - songC
2021\bandD - songD
2020\bandA - songA
2020\bandB - songB

So the problem I have is year folder should always have precedence before filename (I use artist -title). Is there any sane way to do this?

First click on the column with the filename, then click on the column with the YEAR.

I'm not using the year column, because the folder is named after a year to designate when I found the songs chronologically. I try to Click Path and then Artist column but it will only sort by 1 or the other. Effectively what I'm doing is building chronological playlists by year songs A-Z. Not by song release years.

The path is already unique. So you will get only 1 order.
If you have the year in the property _DRIECTORY, add this column to sort by.

The simplest way I can describe the issue is that:

  1. Years folders will sort oldest - newest because 2020 < 2021 and I prefer it to be newest first which is Z - A ordering
  2. Artist - Song is preferable to be sorted A - Z

A column of path then filename almost works, except if you sort by 2021 folder first, you'd get Z - A song ordering. If I create a special sort it doesn't help me overcome this problem. There is reverse ordering being paired between 2 columns and I need it to take folder precedence always before sorting the songs. I tried: %_folderpath%%_filename% but then I have to sort A-Z and go to the bottom and pull out 2021, move up, pull out 2020, etc.

The best way I could explain this problem is in the OP.

Please: add a column for _DIRECTORY.
Sort by _FILENAME or TITLE so that this is in the right order
Then sort by the column for _DIRECTORY (which should contain the year data)

Thanks, I think that was the right info given the info I provided. It was a little more complicated, I had same-named subfolders of rating numbers as well that caused a bad sorting. However, it lead me to the ultimate answer. All that was required was:
value
field
sort by %_directory%

... and then sorting the result column descending. Then the Z-A order gets paired to the A-Z song order.

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