Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
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
MVP & Luminary
MVP & Luminary

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
neetha_p
Master
Master

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
MVP & Luminary
MVP & Luminary

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

neetha_p
Master
Master

Hi,

Yes use Noconcatenate,missed it.