Alphabetically sorting problem

This snapshot shows the alphabetically sorting problem in my app. The second row should be on top. All table columns are formatted to ‘Plain text’. What am I doing wrong?

0 8 409
  • UX
8 REPLIES 8

It seems that the first row and the second row has different value for the Object column.

In the right viewer, the correct sorting should be:

ELE-MOLD-CC2-C-120120
ELE-MOLD-CC2-C-185120
ELE-MOLD-CC2-C-18595

18595 goes first because it has 5 digits only

You are talking about sorting the text length and then sorting the texts. There is no reason to work that way. Also, I don’t think that’s the standard sorting, like in Excel and other data-applications.

3X_3_8_385bd23d0e57f49626e34fe5f821b24fbc1eed59.jpeg

My testing also shows that sort algorithm of Google sheets and AppSheet seems to be different for text strings with the pattern you have shared.

AppSheet sorting seems to be based on absolute number value in such a string so AB-999 will appear before AB-1111

AppSheet Sort

Google Sheet sort

3X_5_8_58c95eab0486cc23376c6c8cda98aaa79ec7bb21.png

The sorting is to be basic algorithm. I’ve used many data programs including Excel, Access, dBase, etc. They are working the same way. I would say AppSheet is weird and it confuses people when searching the sorted data. It should be no difference among others.

AppSheet uses a sorting algorithm that attempts to “do what you’d expect” with distinct numeric text components: treat them as numbers and sort numerically. Unfortunately, those of us with a more experienced technical background don’t expect that and find it annoying. There’s no way to disable this behavior. The best you can do us work around it, perhaps by creating a separate sorting column that munges the sort keys to foil the unwanted sorting behavior (e.g., by removing the hyphens, perhaps). Alternatively, add trailing zeros to the numeric components so they sort as desired even when interpreted as numbers.

OK, thanks.

Top Labels in this Space