Join 2 tables with the same columns results in a table with duplicate columns

Dear all,

I’m doing a join left of 2 tables which have the same columns but last column in the second table. This is the example:

DT1:
Employee
Name
Line number
Error

DT2:
Employee
Name
Line number
Error
Ticket

image

I want to get a third table in which I have the same structure as the second one, but when the join instruction is performed I get a table like this:

DT3:
Employee
Name
Line number
Error
Employee_1
Name_1
Line number_1
Error_1
Ticket_1

Any ideas why this is happening? How can I get a table with the lines in DT1 with a new column Ticket with the values from DT2 from the lines which other columns matches with DT1 column values?

Best regards

2 Likes

Buddy @pa041709

When you are trying to join table with join datatable, the number of columns, order of columns, type of columns. must be same buddy…else it will add the right side table columns as a new column to the left side table buddy

here the last column in the table 2 is not there in the first table…so thats why when you are trying to join them, due to mismatch it gets added as new columns in the output datatable buddy

No worries to clear this, you can do one buddy @pa041709
before joining them
add a column to the first datatable using add data column activity where mention the columnname you want to add newly and the datatable name in which you want to add
and then join buddy. It will work for sure

Cheers @pa041709

Hi @Palaniyappan,

Thanks for your answer buddy.
I already did that and it does the same…just to give some more detail both DT1 and DT2 tables I’m creating them from a read range from an EXCEL file. When I check the content of both tables before the join I can see the name of the columns are the same…so don’t know why it is happening.
Some other ideas?

Cheers!

Buddy if you have added the column newly to the dt1 fine
then kindly try to mention the columnname instead of index buddy
Cheers @pa041709

No @Palaniyappan Buddy…it is the same if I used index or column names.
Cheers

1 Like

aaah got it buddy
i just crossed checked before telling
fine
when the column names are same in both the datatable this will happen buddy
image

Cheers @pa041709

1 Like

ok buddy…so the only way to do what I want is removing the _1 columns I don’t need.
Thanks for the help @Palaniyappan

1 Like