Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I'm facing a problem with join two qvd files.
The one qvd file has 37000 records and the other has 14000 records.
I try to have all the records from the file of 37000 and in the same ITEM of the second file to take the changes.
i have the following script but i take only the records that matching in the field ITEM.
Can anyone help me in this.
LOAD
STKDAT,
FBPCS AS ITEM,
FGIMA,
QTY
FROM
STOCK_131.QVD (qvd);
LEFT JOIN
LOAD
INQTY,
OUTQTY,
ITEM,
STORE_ID
FROM
SRS_TABLE.QVD (qvd)
WHERE STORE_ID = 131;
Thank you in advance.
Or this:
Map_Move:
Mapping LOAD
ITEM,
Sum(INQTY) - Sum(OUTQTY) As Move
FROM
SRS_TABLE.QVD (qvd)
WHERE STORE_ID = 131
GROUP BY ITEM
;
Data:
LOAD *,
RangeSum(QTY, Move) As FinalQTY
LOAD
STKDAT,
FBPCS AS ITEM,
FGIMA,
QTY,
ApplyMap('Map_Move', FBPCS, 0) As Move
FROM
STOCK_131.QVD (qvd);
Hi,
What is the problem you are having exactly?
Mark
Hi,
Try
LOAD
STKDAT,
FBPCS AS ITEM,
FGIMA,
QTY
FROM
STOCK_131.QVD (qvd);
FULL OUTER JOIN
LOAD
INQTY,
OUTQTY,
ITEM,
STORE_ID
FROM
SRS_TABLE.QVD (qvd)
WHERE STORE_ID = 131;
Do you want to update the value of QTY?
Or simply load both tables? A join may not be necessary in this case.
HELLO JAGAN.
FULL OUTER JOIN IS NOT CORRECT
Hi,
Try making inner join . will let u to fetch the matched records only .
thanks,
Hirish
hii,
try concatenate or join instead of left join.
Regards,
Himanshi Dubey
Hello Jonathan.
Yes, in the same items i want to update the qty with the difference of inqty and outqty and i want to keep the QTY of the other items from the first table.
I'm doing the changes in the QTY in the Straight chart i have created in the qvw.
Hello hirishv7.
I have the same results.
Perhaps something like this then:
T_Data:
LOAD
STKDAT,
FBPCS AS ITEM,
FGIMA,
QTY
FROM
STOCK_131.QVD (qvd);
LEFT JOIN (T_Data)
LOAD
ITEM,
Sum(INQTY) - Sum(OUTQTY) As Move
FROM
SRS_TABLE.QVD (qvd)
WHERE STORE_ID = 131
GROUP BY ITEM
;
Data:
LOAD
STKDAT,
ITEM,
FGIMA,
QTY,
Alt(QTY, 0) + Alt(Move, 0) As FinalQTY
Resident T_Data:
DROP TABLE T_Data;