Merging 2 Tables into one with maximum data

Hello, everyone

How could I merge 2 tables (A and B) to including all possible data form both. And if we have data with same parameters, take form A.

For example, table A:

            col1  col2  col3

2012    10     20     25

2013    15     25     30

2014    ?       30     35

 

Table B:

            col1  col3

2011      5     20

2012      ?     25

2013      0      0

2014      20      ?

In result must be smth like:

              col1  col2  col3

2011       5        ?       20

2012      10     20      25

2013      15      25     30

2014      20      30     35

 

In addition column names and data will change from time to time. Therefore, I couldn't bind node settings to column names. If we make outer join by row IDs we will have:

              col1  col2  col3   col1(#1)  col3(#1)

2011      ?        ?       ?          5                20

2012      10     20     25        ?                25

2013      15     25     30        0                  0

2014      ?       30     35        20                 ?

 

How to merge columns col1,col1(#1) and col3,col3(#1) in one node. (in real data total number of columns varies and about 20-30)

 

Hi Ulbashevsham,

You can use two Column List Loop Start nodes, one for each table (make sure to connect the two Loop Start nodes with flow variable connection so one node execution triggers the other node execution). You will have to make the Year column excluded, so it appears for each iteration. Then in each iteration you will have tableAcolX and tableBcolX, which you have to rename with Column Rename (regex), so that they have the same name for each iteration, join them with Joiner node by Year and then use Rule Engine to implement the logic you need. The Loop End (Column Append) node will collect all the columns. If you would like to get the original name for each column before appending, Column List Loop Start outputs "currentColumnName" flow variable which you can use right before appending columns in a Column Rename node.

 

Best,

Anna

Hi,

I'm not sure that I have understand the question so well but is it something like in the attachment below ?

Bets regards,

Fabien