Improving sorting properties

Sorting ascending or descending is a very useful function. However if you sort e.g. complaints named "Complaint (NUMBER)" the result is:

Complaint (1)

Complaint (10)

Complaint (11)

Complaint (12)

Complaint (2) etc.

Could this be changed?

  • Gravatar mjklaine
  • Aug 25 2015
  • Will not implement
  • Oct 30, 2015

    Admin Response

    The Record name column is alphanumeric and this is how the software would naturally sort a list. We provide the Record Number column to allow sorting by number.

  • Attach files
  • Amusik commented
    August 25, 2015 09:03

    Good point.

    Sorting is one of the most interesting algorithms. Because you can sort all the entries by comparing them one character after the other, reading from left to right. Or you can sort them based on the entire string. The first is much faster because you only have to compare fractions of the strings whereas in the other option you need to read the whole string all the way to the end, no matter how long it is.

    Many computer programs will sort strings the first way because the assumption is that the content is a string of text and with a text string this approach will work perfectly. When you have running numbers mixed inside the strings you will see this effect. Even some versions of Windows sort file names the same way. But I know what you mean, it would be nicer if it was otherwise. 

    The fastest solution I could think of would be to change the numbering to go 001, 002, 003, instead of 1,2,3. This would fix the sorting. But this is not really feasible because some programs have dozens of records while others have thousands. So there's no way to know how many zeros to add, and it would look ugly.

    Hopefully the grids will be replaced with an upgrade at some point in the future, which will fix this :)

  • Gravatar