Sort a column based on another column

Hi Community,

I have a table with 3 columns viz Type, Item and itemCount. I want to display the values of column โ€œItemโ€ as a dropdown in my appsheet and I want that dropdown to be sorted based on the descending order values of column โ€œItemCountโ€. I used Orderby formula โ€œorderby(variables2[_RowNumber],sort(variables2[ItemCount],true),true)โ€ but this formula returns the key values of my table and not the values of column โ€œItemโ€. I donโ€™t think even the row keys are being returned in the correct sorted order.

Any help is greatly appreciated. Thanks in advance!

Solved Solved
0 6 1,667
1 ACCEPTED SOLUTION

Yes, a โ€œdereferenceโ€. Thereโ€™s a single dereference with the dot notation, and a list dereference like I just mentioned.

View solution in original post

6 REPLIES 6

There is no way to sort a non-key column by a different column in the Table, in a single expression.

You need to enter this formula into a column first:

ORDER(FILTER(...))

Then in another column/expression you can use a โ€œList Dereferenceโ€

[above column][column wanted from sorted table]

Isnโ€™t there any way to get a non key column from a key column. Sorry if it is a dumb question. I am new to appsheets.

Yes, a โ€œdereferenceโ€. Thereโ€™s a single dereference with the dot notation, and a list dereference like I just mentioned.

Thanks!

Steve
Platinum 4
Platinum 4

For reference:

Thanks Steve

Top Labels in this Space