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: 
steve1982
Contributor II
Contributor II

Combine 3 tables into 1 by Concatenate

Hi,

I am tried concatenate 3 tables into 1 table. The script as below. The output was I only able to get the 1st table content, which the Category is XX.

Final:
LOAD
A,
B,
C
FROM [lib://AttachedFiles/XXX.xlsx]
(ooxml, embedded labels, table is [Sheet1]);
Left Join
LOAD
A,
D,
E,
F,
'XX' as Categoty
FROM qvd;

concatenate(Final)
LOAD
A,
B,
C
FROM [lib://AttachedFiles/XXX.xlsx]
(ooxml, embedded labels, table is [Sheet1]);
Left Join
LOAD
A,
D,
E,
F,
'YY' as Categoty
FROM qvd;


concatenate(Final)
LOAD
A,
B,
C
FROM [lib://AttachedFiles/XXX.xlsx]
(ooxml, embedded labels, table is [Sheet1]);
Left Join
LOAD
A,
D,
E,
F,
'ZZ' as Categoty
FROM qvd;

Thanks 

Steve

1 Solution

Accepted Solutions
sunny_talwar

My bad, try this

Final:
NoConcatenate LOAD * Resident Final_Temp1; Concatenate (Final) LOAD * Resident Final_Temp2; Concatenate (Final) LOAD * Resident Final_Temp3; DROP Tables Final_Temp1, Final_Temp2, Final_Temp3;

 

View solution in original post

4 Replies
sunny_talwar

Try this

Final_Temp1:
LOAD
A,
B,
C
FROM [lib://AttachedFiles/XXX.xlsx]
(ooxml, embedded labels, table is [Sheet1]);

Left Join (Final_Temp1)
LOAD
A,
D,
E,
F,
'XX' as Category
FROM qvd;

Final_Temp2:
LOAD
A,
B,
C
FROM [lib://AttachedFiles/XXX.xlsx]
(ooxml, embedded labels, table is [Sheet1]);

Left Join (Final_Temp2)
LOAD
A,
D,
E,
F,
'YY' as Category
FROM qvd;


Final_Temp3:
LOAD
A,
B,
C
FROM [lib://AttachedFiles/XXX.xlsx]
(ooxml, embedded labels, table is [Sheet1]);

Left Join (Final_Temp3)
LOAD
A,
D,
E,
F,
'ZZ' as Categoty
FROM qvd;

Final:
LOAD *
Resident Final_Temp1;

Concatenate (Final)
LOAD *
Resident Final_Temp2;

Concatenate (Final)
LOAD *
Resident Final_Temp3;

DROP Tables Final_Temp1, Final_Temp2, Final_Temp3;
steve1982
Contributor II
Contributor II
Author

Get the error message Table 'Final' not found on 

Concatenate (Final)

 

sunny_talwar

My bad, try this

Final:
NoConcatenate LOAD * Resident Final_Temp1; Concatenate (Final) LOAD * Resident Final_Temp2; Concatenate (Final) LOAD * Resident Final_Temp3; DROP Tables Final_Temp1, Final_Temp2, Final_Temp3;

 

steve1982
Contributor II
Contributor II
Author

Thanks Sunny