Page 1 of 1
Sort by more criteria
Posted: 12 Jan 2008 23:53
by serendipity
Normally when I sort a list by say "extension", the list is sorted by extension first and then by name. This I guess is a default set up.
In excel for example, there is this nice option to sort columns by Column A then by Column B and so forth.
Similarly in XY I would like to sort files by extension and then by size and then by created etc which would make my life easier at times.
I am sure some of you have come across huge lists where sorting by one criterion is too basic to figure out something. Just wondering if its just me.
Posted: 13 Jan 2008 05:04
by lukescammell
Not a deal breaker for me, but it is certainly something that I think at least once every month without fail - sometimes several times in a day. Don't ask me for specifics on when this would have been useful as I really don't recall, but I certainly keep thinking about this one...
Posted: 13 Jan 2008 08:18
by admin
Yes, it's useful. Actually I DO sort by secondary criteria, but that's always hard-coded to "Name". To make it soft on-demand is of course better.
I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?
Posted: 13 Jan 2008 08:40
by serendipity
admin wrote:Yes, it's useful. Actually I DO sort by secondary criteria, but that's always hard-coded to "Name". To make it soft on-demand is of course better.
I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?
Nice idea. I was thinking of something similar.
Posted: 13 Jan 2008 08:41
by j_c_hallgren
admin wrote:Yes, it's useful. Actually I DO sort by secondary criteria, but that's always hard-coded to "Name". To make it soft on-demand is of course better.
I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?

Duh! Another one of those "Why didn't we think of this before?" items...
yes, of course this would be useful!
And the proposed Shift would be fine with me...however: What about the menu method for us T-P/mouse'rs? I'd say we add a sub-menu to the View>Curr Tab>Sort By which would simply be another "Sort By" that would have the primary sort field grayed out to prevent its selection...this could possibly expanded to one futher level using same method IF three levels of sort would be possible...but the most important is a user-defined minor sort!
Posted: 13 Jan 2008 13:44
by jacky
admin wrote:I won't have the time to do it now, but as for the interaction: how about holding Shift while clicking a column header to make this column the 2nd criterion?
Yeah, if it can be done that would be a nice thing, yes

Holding Shift while clicking the column header is just fine. And also when clicking on the menu, to keep this consistent (as well as allowing to sort by criteria not shown)
Posted: 13 Jan 2008 18:05
by Pagat
If you (Don) use a
stable sorting algorithm then why even sort by secondary criteria on each click?
With a stable algorithm and sorting only by
one criteria each time, there would be no need for any interface:
If you want to have your list sorted "by Date then by extension", simply click first on "extension" and afterwards on "Date" -> Files that are from the same date would remain in their previous order (in this case "by extension").
This way you can also easily sort by three (or even four, five, ...) criteria; simply by clicking onto the according headers one after another.
Posted: 13 Jan 2008 18:21
by admin
Pagat wrote:If you (Don) use a
stable sorting algorithm then why even sort by secondary criteria on each click?
With a stable algorithm and sorting only by
one criteria each time, there would be no need for any interface:
If you want to have your list sorted "by Date then by extension", simply click first on "extension" and afterwards on "Date" -> Files that are from the same date would remain in their previous order (in this case "by extension").
This way you can also easily sort by three (or even four, five, ...) criteria; simply by clicking onto the according headers one after another.
I use Quicksort (not stable). But no problem, I have secondary sorting built in already, and it's extremely fast.
Posted: 13 Jan 2008 19:04
by j_c_hallgren
Pagat wrote:With a stable algorithm and sorting only by one criteria each time, there would be no need for any interface:
This way you can also easily sort by three (or even four, five, ...) criteria; simply by clicking onto the according headers one after another.
And how would this work for someone who wants to use menu options strictly?
Also, if I've decided to totally redo my sort seq, under your solution, i'd likely have to refresh my list first to undo any prior seq...plus there needs to be some method to indicate which field is the main/major field...so as proposed, click would be major, shift+click is minor...which solves the problem.
Posted: 13 Jan 2008 21:35
by Pagat
j_c_hallgren wrote:plus there needs to be some method to indicate which field is the main/major field...so as proposed, click would be major, shift+click is minor...which solves the problem.
with a stable algorithm it would be "first click -> minor", "second click -> major". you are right, there wouldn't be any visual indicator which of the fields is the minor (out of the box; of course it could be added...)
anyway, since Don is using QuickSort and he has already figured it out, it's obsolete to think about the "stable way" anymore.
But: Is "Name" now used as third criterion or are only two criteria used? Because if two files are the same for both criteria their order would be "random" if no third criterion (name) comes into place, right?
Posted: 13 Jan 2008 21:47
by serendipity
Pagat wrote:But: Is "Name" now used as third criterion or are only two criteria used? Because if two files are the same for both criteria their order would be "random" if no third criterion (name) comes into place, right?
I am not sure, but I assume/expect so. Just like how currently the secondary sort is hard-coded to "Name".
Posted: 13 Jan 2008 21:55
by j_c_hallgren
I would think we'd want some field (like name) to be the hidden last sort field so that results wouldn't change if one redid sort..that could cause user confusion...
Posted: 11 Mar 2008 15:43
by serendipity
Code: Select all
+++ List: Added secondary sorting.

Thanks for that. Works as expected.