Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to join two qvd

I have two qvds like following:

tQals:

LOAD WERKS_QALS, BUDAT_QALS, AUFNR_QALS, PRUEFLOS_QALS, BWART_QALS, STAT19_QALS, MATNR_QALS, LMENGE01, LMENGE02, LMENGE04, CHARG_QALS, DCM

FROM [$(vSaveQVD)tQals.qvd] (qvd);

tAufk:

LOAD AUFNR_AUFK 
FROM [$(vSaveQVD)tAufk.qvd] (qvd);

I would like to get all data from tQals where AUFNR_QALS not exists in tAufk->AUFNR_AUFK.

Please help.

6 Replies
tresesco
MVP
MVP

Try this:

tAufk:

LOAD AUFNR_AUFK  as AUFNR_QALS


FROM [$(vSaveQVD)tAufk.qvd] (qvd);

tQals:

LOAD WERKS_QALS, BUDAT_QALS, AUFNR_QALS, PRUEFLOS_QALS, BWART_QALS, STAT19_QALS, MATNR_QALS, LMENGE01, LMENGE02, LMENGE04, CHARG_QALS, DCM

FROM [$(vSaveQVD)tQals.qvd] (qvd) Where Not Exists (AUFNR_QALS);

Drop Table tAufk;

jagan
Luminary Alumni
Luminary Alumni

Hi,

Use Not Exists option in the second load statement.

Hope this helps you.

Regards,

Jagan.

somenathroy
Creator III
Creator III

Hi,

Look at the below code:

tAufk:

LOAD AUFNR_AUFK 
FROM [$(vSaveQVD)tAufk.qvd] (qvd);

tQals:

Load *

FROM [$(vSaveQVD)tQals.qvd] (qvd)

Where not Exists (AUFNR_AUFK , AUFNR_QALS);

Regards,

som

Not applicable
Author

try to use according to this format

tAufk:

LOAD AUFNR_AUFK  as AUFNR_QALS
FROM [$(vSaveQVD)tAufk.qvd] (qvd) ;

tQals:

LOAD WERKS_QALS, BUDAT_QALS, AUFNR_QALS, PRUEFLOS_QALS, BWART_QALS, STAT19_QALS, MATNR_QALS, LMENGE01, LMENGE02, LMENGE04, CHARG_QALS, DCM

FROM [$(vSaveQVD)tQals.qvd] (qvd);

Right Join

tAufknew:

LOAD AUFNR_QALS
resident tAufk  Where not Exists(AUFNR_QALS);

Not applicable
Author

try this

hi modakindia

According to your question i tried then find the right solution, so try this below code

tAufk:

LOAD AUFNR_AUFK  as AUFNR_QALS
FROM [$(vSaveQVD)tAufk.qvd] (qvd) ;

Right Join

tQals:

LOAD WERKS_QALS, BUDAT_QALS, AUFNR_QALS, PRUEFLOS_QALS, BWART_QALS, STAT19_QALS, MATNR_QALS, LMENGE01, LMENGE02, LMENGE04, CHARG_QALS, DCM

FROM [$(vSaveQVD)tQals.qvd] (qvd) Where not Exists(AUFNR_QALS);

Regards

Not applicable
Author

Thanks for your reply.

Pleas help at the following:

LET vTableName = 'tTemp1';

tTemp1:

LOAD WERKS_QALS, BUDAT_QALS, AUFNR_QALS, PRUEFLOS_QALS, BWART_QALS, STAT19_QALS, MATNR_QALS, LMENGE01, LMENGE02, LMENGE04, CHARG_QALS, DCM 

FROM [$(vSaveQVD)tQals.qvd] (qvd) Where not Exists(AUFNR_QALS);

IF ScriptErrorCount = 0 then

   STORE $(vTableName) into [$(vSaveQVD)$(vTableName).qvd] (qvd);

ENDIF