Forum

How to join tables ...
 
Notifications
Clear all

How to join tables with different columns and merge duplicate rows

3 Posts
2 Users
0 Reactions
326 Views
(@plasteredric)
Posts: 17
Eminent Member
Topic starter
 

I have three table connections that i'd like to append together. Each table has 5 columns, three of which have identical column names across all tables including a 'unique identifier' column.

Table 1 then has two columns named "A_Test1" and "A_Test2", table 2 has two columns named "B_Test1" and "B_Test2", and table 3 has two columns named "C_Test1" and "C_Test2".

When I use the append queries option it puts all the tables together into a single table with 9 columns and adds null values in the blank cells as I would expect.

Now I have the issue that about 10% of the rows have duplicate unique identifiers due to them being present in each of the tables.

Is there a way of merging these records together so that there are no duplicate UI's and the test results from each table are shown on the same row?

Any help is greatly appreciated

 
Posted : 24/03/2021 7:24 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Richard,

Have you tried merging the tables instead of appending? Merging will bring the matching rows together and append any new rows if you use the Full Outer join.

Mynda

 
Posted : 25/03/2021 6:00 am
(@plasteredric)
Posts: 17
Eminent Member
Topic starter
 

I've managed to sort it with a mix of appending and merging.

When I merged the tables together using the Full Outer Join I ended up with 15 columns so would have needed to add several conditional columns (with if null formulas) to merge the duplicate columns into one.

What I ended up doing was appending all the tables together, removed the "test" columns that were unique to each table and then removed the duplicate rows. I was then able to merge each of the tables to this and just removed the extra columns I didn't need.

 
Posted : 25/03/2021 12:01 pm
Share: