Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

join between two qvd

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.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

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);

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

13 Replies
Mark_Little
Luminary
Luminary

Hi,

What is the problem you are having exactly?

Mark

jagan
Luminary Alumni
Luminary Alumni

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;

jonathandienst
Partner - Champion III
Partner - Champion III

Do you want to update the value of QTY?

Or simply load both tables? A join may not be necessary in this case.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
geogou1973
Creator
Creator
Author

HELLO JAGAN.

FULL OUTER JOIN IS NOT CORRECT

HirisH_V7
Master
Master

Hi,

Try making inner join . will let u to fetch the matched records only .

thanks,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
himanshi
Contributor III
Contributor III

hii,

  try concatenate or join instead of left join.

Regards,

Himanshi Dubey

geogou1973
Creator
Creator
Author

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.

geogou1973
Creator
Creator
Author

Hello hirishv7.

I have the same results.

jonathandienst
Partner - Champion III
Partner - Champion III

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;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein