Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User interface for sorting a table by multiple columns

I need a user interface that allows users to sort a table according to multiple columns (e.g. sort by color and then price within color, or alternatively price and then color within price). The only such interface I'm familiar with is the dialogue box found in Excel under data > sort, but this is rather clunky and does not yield itself to quick switching between views. I would much prefer an iTunes-style interface that allows quick sorting by clicking on column headers. However, such interfaces typically only allow sorting by one column (an exception is iTunes itself which has a very limited, apparently hard-coded ability to sort by "Album by Artist" and "Album by Year" by clicking on the Album header).

I can envision an interface where each column header has some numbers, such that clicking on 1 makes the column the primary sort key, clicking on 2 the secondary key, and so on. Alternatively, clicking (or right-clicking) on a column header could bring a drop-down menu with "primary sort", "secondary sort" etc. However, I've never seen such an interface implemented, and I don't have a good intuition of usability issues that may arise.

Are there applications that allow sorting by multiple columns using the column headers? Would you be able to point me to these? Are there any useful usability results regarding such interfaces -- which work better, which less so?

Also, while I am mostly interested in the specification of the interface, any hints to pass on to the people implementing it would be appreciated, e.g. publicly available libraries that provide parts of a solution (especially Java).

Edit: Two people have suggested using an Excel-style dialogue box. This is not going to work. For my application, users need to find the "best match" among existing table entries (which is often not a perfect match). The table is too big to keep in your head, so you need to keep scanning the relevant parts, and it's useful to repeatedly sort the table in order to get multiple views. Having to go through a dialogue box with multiple options for each change of view is just too slow; by the time you're done with the box, you've forgotten the results from the previous view.

like image 422
Ron Avatar asked Mar 09 '09 19:03

Ron


People also ask

How do you sort data by multiple fields?

Right-click a field name and click Advanced Sorting. Click the Sort by arrow and click the first field by which you want to sort. Click Ascending or Descending to choose the sort order. Click the Then sort by arrow, click the next field, then choose a sort order.

How does sorting on multiple columns work?

To sort by multiple columns, simply specify the column names separated by commas (just as you do when you are selecting multiple columns). The following code retrieves three columns and sorts the results by two of them—first by price and then by name.

When sorting is performed on more than one column it is called?

You can also ORDER BY two or more columns, which creates a nested sort .


2 Answers

I've seen the shift-click interface that caparcode mentioned in a few applications, however I can't name any right now. Here's a nice web-based example though.

like image 136
Chris Shaffer Avatar answered Sep 22 '22 15:09

Chris Shaffer


I think Outlook supported sorting by multiple columns. After you clicked a columnheader, you would then shift-click additional column headers. I no longer use Outlook so I can't verify this. Hopefully it will be a starting point for you.

like image 33
Arnold Spence Avatar answered Sep 20 '22 15:09

Arnold Spence