Orderby () does not sort correctly

i am trying return a list with of [SCC] result sorted by date most resent 1st.

the [SCC list] below should be 35,201,239,35,18,etc

these are the formulas i have in place.

app formula i have the following formula “(select(milk recording[SCC],and([Animal Number]=[_THISROW].[Animal Number],[date]<=[_THISROW].[date])))”

in the data validity i have this formula: “orderby(select(milk recording[MR Animal id],and([Animal Number]=[_THISROW].[Animal Number],[date]<=[_THISROW].[date])),“Date”,true)” where [MR Animal id] is the key for the dataset

Moore_Hill_Farm_0-1723893521892.png

i have also tried as type as “list” with base type as “number” but get the same result.

regards

shane

The Valid_If expressions only impact the order of dropdown lists used to choose values - they have no effect on the actual chosen values.

You have the expression in the App Formula property. I am not sure why you don’t think you can apply the ORDERBY() function there. Since you are assigning values to the SCC List column by an App Formula, there is no need for a VAlid_If expression. Simply MOVE the expression you have in your Valid_If into the App Formula.

PRO TIP: If the SCC List column is simply showing the values identified in the “Related Milk Recordings” list then you can simplify your expression for the SCC List values column as follows:

ORDERBY([Related Milk Recordings], [Date], true)

This assumes that you have the SCC column set as the Label column in your Milk Recordings table. If for some reason you do not then you will need to use your SELECT() expression.

I hope this helps!

thank you,

SCC is not the label so i cant use your solution above, i now have a list in the right order but it is not showing the SCC how do it get it to return the SCC column?

thanks

shane

The order of rows displayed here:

Is determined by the sort order configured for the Related Milk recordings_Inline view.

Sorry i am self taught and might have missed some of the basics, i am sure it must be straight forward but i still cant get it to work.

i have the key list in the right order now but i cant get it to return the [SCC] column. [scc list].[scc] says scc list not a reference

is the key list not a list of references?

i cant use [SCC] as the label and i want to run the [SCC list] in a pdf report

How do i get this with out using SCC as the label

Moore_Hill_Farm_2-1724099984713.png

thanks

shane

https://support.google.com/appsheet/answer/11618586

thank you easy when you know how.

1 Like