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?
Solved! Go to 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
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"))
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
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
User | Count |
---|---|
18 | |
11 | |
11 | |
8 | |
4 |