Problem importing data

 

Tengo un formulario de solicitud de compra; Se puede incluir cualquier nรบmero de artรญculos en el detalle 
de la solicitud, de los cuales se solicita un cierto nรบmero, pero no todos los artรญculos estรกn necesariamente
aprobados, ni tampoco la cantidad solicitada.
Asรญ que tengo los siguientes campos:
En la solicitud de compra tengo los campos id_request, fecha y departamento;
En el detalle tengo los campos id_detail_request, id_request, cรณdigo, descripciรณn, cantidad solicitada,
cantidad aprobada y aprobaciรณn.
De acuerdo a lo anterior, necesito generar una orden de compra, que en el detalle de la orden incluya
solo los artรญculos aprobados y la cantidad aprobada;
En la orden de compra incluyo id_order_buy, fecha, id_request, proveedor y aprobaciรณn
Mi problema estรก en el detalle de la orden de compra, incluyo los campos
id_detail_order_buy, cรณdigo, descripciรณn, cantidad aprobada, precio unitario y total;
C
on la expresiรณn SELECT(request_detail[code], AND([_THISROW].[id_request]=[id_request], [ESTATUS]="APROVED"))

selecciono solo los artรญculos aprobados en la orden de compra, pero no puedo importar la cantidad Aprobado,
probรฉ la siguiente expresiรณn pero no funciona
LOOKUP([_THISROW].[code], request_detail, id_request, authorized_quantity)
ยฟQuรฉ estoy haciendo mal?
 
Luis_Rodriguez_0-1672012672537.png

 

 
 
 
 
 
Solved Solved
0 4 121
1 ACCEPTED SOLUTION

You may want to look at the following

If SELECT(request_detail[code], AND([_THISROW].[id_request]=[id_request], [ESTATUS]="APPROVED")) is returning list of [Code] values  and you are expecting LOOKUP() to also return multiple values of [authorized quantity] then LOOKUP() will not work with those resulting list of [Code] values with [_THISROW].[Code] because LOOKUP() works against single value in a column.  Excerpts from the help article

Suvrutt_Gurjar_0-1672025492219.png

LOOKUP() - AppSheet Help

You may instead want to use the same expression to return the [authorized_quantity] such as 

 SELECT(request_detail[authorized_quantity], AND([_THISROW].[id_request]=[id_request], [ESTATUS]="APPROVED"))

View solution in original post

4 REPLIES 4

You may want to look at the following

If SELECT(request_detail[code], AND([_THISROW].[id_request]=[id_request], [ESTATUS]="APPROVED")) is returning list of [Code] values  and you are expecting LOOKUP() to also return multiple values of [authorized quantity] then LOOKUP() will not work with those resulting list of [Code] values with [_THISROW].[Code] because LOOKUP() works against single value in a column.  Excerpts from the help article

Suvrutt_Gurjar_0-1672025492219.png

LOOKUP() - AppSheet Help

You may instead want to use the same expression to return the [authorized_quantity] such as 

 SELECT(request_detail[authorized_quantity], AND([_THISROW].[id_request]=[id_request], [ESTATUS]="APPROVED"))

Select returns a list, but not the authorized amount of a specific item; 
Of the items in the detail of the request, I can buy from different suppliers,
so I need to specify the product code and the approved quantity; Sorry if I don't explain well

 

 

I am sorry that I did not understand anything out of your latest post. Also may I request you to not use "Insert Edit code sample" , when you are simply describing the issue in plain language. Reading the normal text is tedious with the code sample option.

Thank you very much, I managed to solve my problem
Top Labels in this Space