Ascending issue now

GNF
Bronze 5
Bronze 5

Hi everyone,

Today, my app is experiencing an issue when I set it to ascending. However, setting it to descending works fine.z5991579103211_3f61155536ff29ce6a79d70721f28d09.jpg

 

z5991579132767_b8c5026017ec8d6a6d86daf17544ec22.jpg

 

 

1 9 317
9 REPLIES 9

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. 

Screenshot 2024-11-03 at 1.05.26 PM.png

GNF
Bronze 5
Bronze 5

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:

TEST.jpg

 

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:

1.jpg2.jpg3.jpgTEST.jpg

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.

Steve
Platinum 5
Platinum 5

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.

Top Labels in this Space