Hi everyone,
Today, my app is experiencing an issue when I set it to ascending. However, setting it to descending works fine.
Does it help if you use "01..." instead of just "1..." with your group names?
The sorting uses TEXT based sorting. When numbers are embedded into the text, the order is not as you might expect. TEXT sorting orders the items based on each character position. So, all items are sorted by the first character, the second character, the third and so on - each digit is separate character.
I am not sure why your values are showing an order of "9. ...", "11. ...", "3.1. ...", "5. ..." and "9. ..." --- UNLESS you have leading spaces in some of those values???
Below are some sample values sorted as TEXT. The Left hand side is based on the values as is. The center has SOME values with leading spaces. The right hand side is numerically sorted with leading ZEROES inserted as suggested by @AleksiAlkio.
If you don't like the idea of leading zeroes, another option is to use Alphabetic characters to designate the order instead of numbers.
Thank you @AleksiAlkio , @WillowMobileSys ,
I have created a simple data table to compare ascending and descending. I noticed that the sorting pattern is unusual and inconsistent between them. My simple data table simulation is as follows:
How have you specified the options for your Enum column? Are you reading them from a different table with a formula or have you set those options manually?
I've noticed that the sorting rules for Ascending and Descending in AppSheet are difficult for me to understand
In my test, I simply created some sample data in Google Sheets, connected it with AppSheet, and viewed it in both ascending and descending orders. I haven't applied any formulas or slices, and all the sample data is in text format, as follows:
If you set values equally like use 02. ABC, 09.ABC or 11.ABC etc. instead of 1. ABC, 9. ABC or 11. ABC it should fix the issue.
At some point in the past, I think it was the founder of AppSheet himself who said AppSheet sorting used some intelligence to recognize text with mixed numbers and other text so that they would sort "as you'd expect" rather than the strict character-based sorting that @WillowMobileSys describes. Unfortunately, I couldn't find the post. So the behavior @GNF is seeing with ascending sorting seems to match my recollection. That descending doesn't follow the same rules suggests a bug has crept in, perhaps with desktop mode. Whether the intelligent sorting is intended or not, the inconsistency is a bug. @AleksiAlkio, perhaps you could escalate this?
I agree with @Steve there is inconsistency in how the sorting is occurring. There must be some bug. Unfortunately these are the things that happen when the standard practice isn't followed.
@GNF I would open a ticket to support and hopefully it is fixed quickly. In the meantime, I would consider an alternate way of sorting your Group headings - either use the method @AleksiAlkio has suggested with leading zeros OR use only alphabetic characters.
Good Luck!!
It's the dot that makes the system confused.
User | Count |
---|---|
18 | |
11 | |
7 | |
3 | |
2 |