Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master II

concatenate two same tables with different schema

Hi All,

I have two same identical tables different schema. I want to store in a single QVD while loading.

How to achieve this.

Script:

ODBC CONNECT TO SCHEMA1 (XUserId is ZXSCDERS, XPassword is QAZSXW);

EMP1:

Load ENAME,

     JOB,

     DEPTNO,

     SAL,

     COMM ,

     'HR' as KEY;

SQL SELECT * FROM SCHEMA1.EMP;

ODBC CONNECT TO SCHEMA2 (XUserId is QWERDCS, XPassword is SXWSAS);

EMP2:

Load ENAME,

     JOB,

     DEPTNO,

     SAL,

     COMM ,

     'SALES' as KEY;

SQL SELECT * FROM SCHEMA2.EMP;

store EMP1 into QVD\EMP.qvd;

store EMP2 into QVD\EMP.qvd;

Capture.PNG

1 Solution

Accepted Solutions
marcus_sommer

Those table doesn't exists because qlikview concatenated automatically tables which have the same fields. I'm not sure if this also worked with those both preceeding loads - if your former load-script runs successfully and the table-viewer showed two EMP tables then not. If yes you will have only one table which you then could store as qvd. If not you need a noncatenate statement like this:

EMP:

Noconcatenate

load *  Resident EMP1;

concatenate

load *  Resident EMP2;


Store EMP into QVD\EMP.qvd;


- Marcus

View solution in original post

5 Replies
Anonymous
Not applicable

ODBC CONNECT TO SCHEMA1 (XUserId is ZXSCDERS, XPassword is QAZSXW);

EMP1:

Load ENAME,

     JOB,

     DEPTNO,

     SAL,

     COMM ,

     'HR' as KEY;

SQL SELECT * FROM SCHEMA1.EMP;

ODBC CONNECT TO SCHEMA2 (XUserId is QWERDCS, XPassword is SXWSAS);

EMP2:

Load ENAME,

     JOB,

     DEPTNO,

     SAL,

     COMM ,

     'SALES' as KEY;

SQL SELECT * FROM SCHEMA2.EMP;

//store EMP1 into QVD\EMP.qvd;

//store EMP2 into QVD\EMP.qvd;

TRY:

EMP

load *  Resident EMP1;

concatenate

load *  Resident EMP2;


Store EMP into QVD\EMP.qvd;


qlikviewwizard
Master II
Master II
Author

Thank you Neetha_p.

Will check and let you know.

qlikviewwizard
Master II
Master II
Author

Hi,

I got this error:

ScriptErrorDetails"EMP Table not found"
marcus_sommer

Those table doesn't exists because qlikview concatenated automatically tables which have the same fields. I'm not sure if this also worked with those both preceeding loads - if your former load-script runs successfully and the table-viewer showed two EMP tables then not. If yes you will have only one table which you then could store as qvd. If not you need a noncatenate statement like this:

EMP:

Noconcatenate

load *  Resident EMP1;

concatenate

load *  Resident EMP2;


Store EMP into QVD\EMP.qvd;


- Marcus

Anonymous
Not applicable

Hi,

Yes use Noconcatenate,missed it.