Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
noviceneil
Partner - Contributor III
Partner - Contributor III

create one table from 2 different tables

Hello friends,

          I  have been trying to do the following,

TABLE 1: 

LOAD A, B,C from [ lib://A.qvd] (qvd)

 

TABLE 2:

LOAD A,  X, Y from [ lib://B.qvd] (qvd)

 

TABKE C: 

LOAD * from TABLE A;

left join

LOAD * from TABLE B;

DROP TABLE A
DROP TABLE B;

But after loading the script I a not able to find any table..  I am surely doing something wrong while creating table C. Could you please help? 

 

2 Replies
QFabian
Specialist III
Specialist III

Dear @noviceneil , that is a common behavior of Qlik. And it is related to the auto concatenation that Qlik does when it finds two similar data structure.

 

TABLE 1: 

LOAD A, B,C from [ lib://A.qvd] (qvd)

 

TABLE 2:

LOAD A,  X, Y from [ lib://B.qvd] (qvd)

//Here, when you create Table C loading all fields from A, Qlik it is not going to create another data structure, it is going to add this load, to the first structure, so Table C never exists. You just have A with duplicated rows, and B.

TABKE C: 

LOAD * from TABLE A;

left join  // So this LEFT JOIN, add columns from B to A

LOAD * from TABLE B;

// At this point you still having A and B

DROP TABLE A  // and then you drop them
DROP TABLE B; // and both dissapears

 

 

Trying adding a rowno() field, or another field, in order to not create your C table just with A columns, to avoid auto concatenation

 

QFabian
noviceneil
Partner - Contributor III
Partner - Contributor III
Author

Thanks a lot.. I have figured out from your suggestion..

 

 

Now I have another question, if you can help please.

like TABLE 1 and TABLE 2, I have 2 other tables TABLE 3 and TABLE 4, from which I am making another table TABLE D, which is of similar structure as TABLE C but for a different period.

Now as soon a I create TABLE C and TABLE D as there are same column A present in both these table QS creates an automatic association. But I don't want to join TABLE C and TABLE D on column A but on column X and column Y and create a master table for both the periods.