Ayuda Orderby & Select

Buenas noches, no logro resolver este problema que no parece tan complejo.
Tengo este select que me devuelve los ID_PEDIDO que necesito ordenados correctamente segun el valor en el campo ORDEN ENTREGA, pero no quiero el campo ID_PEDIDO sino que de la misma tabla quiero otro campo que se llama POSICION. Podrรญan ayudarme?

ORDERBY(SELECT((Pedidos[ID_PEDIDO]), [Entregar el] = TODAY());[ORDEN ENTREGA])

0 7 258
7 REPLIES 7

Hereโ€™s the Google translation of your post:

I have this select that returns the ORDER_ID that I need correctly ordered according to the value in the DELIVERY ORDER field, but I donโ€™t want the ORDER_ID field but from the same table I want another field called POSITION. Could you help me?

ORDERBY (SELECT (Orders [ORDER_ID], [Deliver on] = TODAY ()); [DELIVERY ORDER])

I may be failing to understand something very basic but wouldnโ€™t the following do what you want?

ORDERBY (SELECT (Orders [POSITION], [Deliver on] = TODAY ()); [DELIVERY ORDER])

El ORDERBY obliga a que el campo que trae sea la KEY de la tabla que en este caso es ID_PEDIDO

ORDERBY() can only be used on a List of row keys. To do what it seems you want, youโ€™d have to have the ordered List of row keys stored in a column, then use List Dereference on that column.

Gracias por tu respuesta, no estoy usando derefernce porque ya tengo los datos que necesito en ese select, lo que quiero es que para cada ID_PEDIDO que da como resultado ese select me pase el POSICION, yo creo que se hace con un LOOKUP anidado antes o algo asi pero no he logrado resolverlo.

Iโ€™m rather confused. I see now that I was mistaken about ORDERBY(). I was thinking of SORT(). I think @Marc_Dillon understands the problem much better than I do.

I know youโ€™re NOT using dereference, thatโ€™s what Iโ€™m telling you that you SHOULD be using.

Column-1 =

ORDERBY( SELECT( table[key-column] , .... ) )

Column2 =

[Column-1][POSITION]

I solved it by creating an AppSCript that runs in the book that, before each change that is made in the sheet, orders the records following this logic previously described, this makes the records bring them as they are in the table and I ask for the position field directly, although I couldnโ€™t solve it in AppSheet if I achieved it in 2 steps.

Thank you very much for the answers.

Top Labels in this Space