Join datatable splits the final datatable into two rows

Hi, I’ve apply Full Join to two regular datatables, but final datatable are split into two rows.
I.e. datatable 1

DT1 column 1 DT1 column 2 DT1 column 3 DT1 column 4
xxx yyy zzz qqq
xx yy zz qq
x y z

Datatable 2

DT2 column 1 DT2 column 2
mmm yyy
mm yyyy

Join datatable (after full join should be )

DT1 column 1 DT1 column 2 DT1 column 3 DT1 column 4 DT2 column 1 DT2 column 2
xxx yyy zzz qqq mmm yyy

but I have

DT1 column 1 DT1 column 2 DT1 column 3 DT1 column 4 DT2 column 1 DT2 column 2
xxx yyy zzz qqq
mmm yyy
Do you know where is the problem? Or how should I fix the final datatable?
1 Like

Hey!

Use merge data table activity

Regards,
NaNi

I Apply merge to the final join table and still the same result
image

Hey!

Cool we can do it in another way

  1. Create one Temp Dt- TempDt - create the desired columns - DT1 column 1 DT1 column 2 DT1 column 3 DT1 column 4 DT2 column 1 DT2 column 2

  2. Read first Dt - DtOut1

  3. Read second Dt - Dtout2

  4. Take one for each row and pass the DtOut1 - CurrentRow1

  5. Take one more for each row and pass the DtOut2 - CurrentRow2

  6. Now take the add data row - pass the Dt as TempDt

pass the expression in ArrayOfRows. like this

{CurrentRow1(0).ToString,CurrentRow1(1).ToString,CurrentRow1(2).ToString,CurrentRow1(3).ToString,CurrentRow1(4).ToString,CurrentRow2(0).ToString,CurrentRow2(1).ToString}

After for each row

Take one write range and pass the TempDt as DataTable

This will work for sure

Regards,
NaNi

HI,

Another approach:

How about the following step?

  1. Write dt1 to “A1” in some sheet of some workbook using WriteRange Activity(with header)
  2. Write dt2 to “E1” using WriteRange Activity(with header)
  3. Read datatable from “A1” using ReadRange activity(with header)

Regards,

The tables are particularly fine, but they split into two rows only after the join.

But I need to apply Join to these datatables, Will that be still possible?

1 Like

try this solution

Sequence.xaml (3.6 KB)

Hey…

This will do the same…

No need to join…

Regards,
NaNi

Hi @Katerina_Chabova ,

I tried the same data tables and INNER join is producing the required output.
Have you tried inner join?
image

as mentioned above the described output is of type:
inner join
left dt: dt1
rigth dt: dt2
Join cols dt1.column2 to dt2.column2
Operation: = (equals)

For the different Join Type have a look here:

Per Documentation, a Full join will keep all rows from DataTable1 and DataTable2, regardless of whether the join condition is met. Null values are added into the rows from both tables that don’t have a match. Pretty much like a cartesian product.

Use Inner join, which is what appears to be the requirement in your case. Only rows that meet the join condition from both data tables will be returned.