Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

merge different tables with similar fields

Hello,

I have 3 tables like below.

Table 1 : FieldA FieldB FieldC

Table 2: FieldA FieldB FieldD

Table3: FieldA FieldB FieldE

And I would like to make this NewTable.

NewTable: FieldA FieldB FieldC FieldD FieldE

Could somebody show me what is the best way to make it work.

Thanks in advance.

Jay

4 Replies
Anonymous
Not applicable
Author

Hi Jay,

This should do it I guess unless I'm missing something:


NewTable:
Load
FieldA,
FieldB,
FieldC
From xxxx;
join
Load
FieldA,
FieldB,
FieldD
From zzzz;
join
Load
FieldA,
FieldB,
FieldE
From yyyy;


Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Jay,

depending on your needs, you can either join the tables, as suggested above (possibly using left join if needed), or you may want to concatenate the tables. When you concatenate, no key matching is done, and the data is simply appended - very much like "UNION ALL" in SQL, only in QlikVIew you can force concatenation even with slightly different sets of fields.

cheers,

Ask me about Qlik Sense Expert Class!
Not applicable
Author

Hi Johannes,

Thanks for you prompt reply.

By the way, it seems that I cannot use "load from" since it tries to load data from file but what I need is to do it from existing file.

Thanks any way.

Not applicable
Author

Oleg,

Thanks. By the way, My tables are created by Crosstable function and have exactly same row numbers.

Any idea?

Table1:
CrossTable(FieldA, FieldC, 1)
LOAD
@3 as FieldB,
@11 as 1,
@13 as 2,
@15 as 3
FROM [$(psFile)]
(biff, no labels, header is 2 lines, table is ??????$);

Table2:
CrossTable(FieldA, FieldD, 1)
LOAD
@3 as FieldB,
@12 as 1,
@14 as 2,
@16 as 3

FROM [$(psFile)]
(biff, no labels, header is 2 lines, table is ??????$);

Table3:
CrossTable(FieldA, FieldE, 1)
LOAD
@3 as FieldB,
@35 as 1,
@36 as 2,
@37 as 3

FROM [$(psFile)]
(biff, no labels, header is 2 lines, table is ??????$);