ORDERBY for multiple words in a row if possible??

Hey I had a question, right now I'm attempting to do a dropdown menu using enum, but I want everything in alphabetical order. Problem is that the amount of words per row is 3-4 so I didn't know how I would go about doing this. I've setup a table specifically for menu values to keep everything organized. So I guess my question is their a way to call to this specific table and column with the result being in complete alphabetical order. So for example "Fresher Computer Scientist" would go before "Fresher Systems Engineer", which would go before "Fresher Systems Field Operator". Didn't know if this was possible in appsheet just thought I'd ask. I've tried using SORT and ORDERBY and can't get it to work properly at all, thanks

0 14 234
14 REPLIES 14

Orderby will work if you are getting values from a certain table and you want to order them by another one. This value can be the ID or something different.

If you just want to sort data by it's own alphabetical order, SORT do the thing.

Please tell us where (which column and it's type) you want that order and from where

Yes, both ORDERBY and SORT use alphabetical sorting. There's nothing extra that you need to do to accommodate for your situation. If you're having issues, then you must be using the expressions, or the dropdown system, incorrectly. Please show us what you're doing so that we may show where your mistake is.

So I had tried this expression -> SORT(tableReferences[Completed Certifications]):False in order to list the values in the column in alphabetical order, but it only takes the first 2 words into account and then it doesn't work for the other words so then they are still out of order. I know that False gives A-Z and I'm making a call to a table/column pairing in AppSheet to use for the values in another table/column as its enum values. I'm not sure what else to add so that in encompasses all the words in a row. Or I don't know if its getting screwed up because some rows have 3 words and some have 4?

That description doesn't really help. I said show what you're doing. Show the input and the output.

The following works as expected for me:

Marc_Dillon_1-1648747571923.png

 

Thanks, yeah that helped. I got it to work properly after all. Sorry I'm fairly new to AppSheet and still trying to figure this expression stuff out. This seems to be the best resource though and I'm grateful for this community

So you fixed it? What was the fix?

Unless AppSheetโ€™s SORT() is doing something out of the ordinary, I believe one has to take spaces into account because SORT() wouldnโ€™t know about words. Therefore, it would be necessary to remove them before sorting or resort to sorting a list of lists. 

Iโ€™m not able to test right now, but if Iโ€™m correct, โ€œFresh Sys Techโ€ would go before โ€œFresh System Devโ€. 

Confirmed. 

Capture dโ€™eฬcran 2022-03-31 aฬ€ 22.31.00.png

So we should use orderby and substitute the spaces then

Yes. I initially thought of using SPLIT() on the list elements, but I've discovered that AppSheet's SORT() doesn't support sorting a list of lists !!!! So I think your suggestion is the only option I can quickly think of. 

The problem with Sort is that it will give you the data from the data you are sorting.

So if we substitute that, the result will be the data withouth the spaces.

OrderBy makes sense in that matter but I think that there is going to be an extra column on the original table to be used to sort(?)

You are right. I have to experiment to propose a workaround, but in any case any solution I can think of now would involve an additional column. 

ORDERBY(
  TABLE[ID],
  SUBSTITUTE(
    [SortColumnWithSpaces],
    " ",
    ""
  )
)

Seems like it should work

That looks neat ๐Ÿ™‚ I'll play with it. Thank you!

Top Labels in this Space