Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
cimxfang
Contributor
Contributor

Merge two tables in one sheet by a column with common values

Hi team,

I am after a way to merge two tables in the sheet by a column with common values.

for example : 

table 1:

event_open_day |  open_event_count

1                                             10

2                                             20

3                                            30

tables2:

event_close_day |  close_event_count

2                                           100

3                                             200

4                                           300

Merged table:

Event_Day| close_event_count| open_event_count

1                                                                             10

2                                      100                                20

3                                      200                                 30

4                                      300

Labels (1)
1 Reply
gavinlaird
Contributor III
Contributor III

You will want the event day columns to have the same name. Load Table1 and Table2 as normal, then use the following script to merge them into a single table:

MergedTable:
LOAD event_open_day as Event_Day
	,open_event_count
Resident Table1;

Outer Join (MergedTable)
LOAD event_close_day as Event_Day
	,close_event_count
Resident Table2;

Drop Tables Table1, Table2;