Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

Inner Join Sap Tables

Hello,

I have the following tables in Script:

COBK:

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     DATE(BUDAT) AS CONT_DATE

FROM DAT_05_SAP_CO_COBK_*.qvd (qvd)

WHERE BUDAT >= '01/07/2015';

COEP:

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     WKGBTR,

     OBJNR

FROM DAT_06_SAP_CO_COEP_*.qvd (qvd)

WHERE LEFT(OBJNR,2)='KS';

What I need is to make an INNER JOIN between them (by field %KEY_COBK).

The thing is I've tried the following:

GENERAL:

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     DATE(BUDAT) AS CONT_DATE

FROM DAT_05_SAP_CO_COBK_*.qvd (qvd)

WHERE BUDAT >= '01/07/2015';

INNER JOIN(GENERAL)

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     WKGBTR,

     OBJNR

FROM DAT_06_SAP_CO_COEP_*.qvd (qvd)

WHERE LEFT(OBJNR,2)='KS';

But I have 0 results. Instead, if I do the following I get the data:

GENERAL:

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     DATE(BUDAT) AS CONT_DATE

FROM DAT_05_SAP_CO_COBK_*.qvd (qvd)

WHERE BUDAT >= '01/07/2015';

COEP:

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     WKGBTR,

     OBJNR

FROM DAT_06_SAP_CO_COEP_*.qvd (qvd)

WHERE LEFT(OBJNR,2)='KS';

INNER JOIN(GENERAL)

LOAD *

RESIDENT COEP;

DROP TABLE COEP;

Do you know how could I do to get my 1st option working, by joining directly both tables?

Thank you!!!

1 Reply
ychaitanya
Creator III
Creator III

Hello

Have you tried this.

GENERAL:

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     DATE(BUDAT) AS CONT_DATE

FROM DAT_05_SAP_CO_COBK_*.qvd (qvd)

WHERE BUDAT >= '01/07/2015';

INNER JOIN

LOAD

     KOKRS&'|'&BELNR AS %KEY_COBK,

     WKGBTR,

     OBJNR

FROM DAT_06_SAP_CO_COEP_*.qvd (qvd)

WHERE LEFT(OBJNR,2)='KS';

It should n't give a problem actually, we are sure table GENERAL  not autoconcatenating to any tables above?