ORDERBY in appsheet template not ordering values properly.

I am using the below expression to ORDERBY values based on the values from other child table.

Malik786_1-1702834514646.png

It orders the resultant values incorrectly. i.e., 93 comes before 280, 94 come before 260 and so on...

https://docs.google.com/spreadsheets/d/1Gz8-D6BHnCEaOThIh74o9bKtaY2dKmR8J8SBlOo5zE4/edit?usp=sharing 

Malik786_2-1702835517899.png

Any piece of help will be highly appreciated.

 

 

Solved Solved
0 1 184
1 ACCEPTED SOLUTION

The ORDERBY is not implemented correctly with a couple of issues. 

1)  It is implemented to use a LIST to perform the ordering which will not work.  I am surprised that you are not encountering a syntax error for that alone and should probably be raised to AppSheet support.  This part...[related Assessments][Total]...produces a list of [Total] values from each [related Assessments] row. 

2)  You cannot order based on a column in another table.  In the ORDERBY, you must specify a column in the Students table on which to order its rows.  If your desire is to order by the Total from the [related Assessments] list of items, then you need to add a column to the Students table (it can be a virtual column) that calculated the Total from the [related Assessments] List.  Then you can use this newly introduced column to perform the ordering on.

View solution in original post

1 REPLY 1

The ORDERBY is not implemented correctly with a couple of issues. 

1)  It is implemented to use a LIST to perform the ordering which will not work.  I am surprised that you are not encountering a syntax error for that alone and should probably be raised to AppSheet support.  This part...[related Assessments][Total]...produces a list of [Total] values from each [related Assessments] row. 

2)  You cannot order based on a column in another table.  In the ORDERBY, you must specify a column in the Students table on which to order its rows.  If your desire is to order by the Total from the [related Assessments] list of items, then you need to add a column to the Students table (it can be a virtual column) that calculated the Total from the [related Assessments] List.  Then you can use this newly introduced column to perform the ordering on.

Top Labels in this Space