Merge Different Data Table Issue

Hi, I have three different data tables (dt1, dt2, and dt3) created using the build data table. dt1 has two columns, dt2 has one column, and dt3 has one column. I want to merge them column-wise. I have tried merging the data tables, but I got a result in row-wise merging. How do I do it column-wise?

@Haseeb_Farrukh

check the reference

1 Like

Very informative, however my issue is that I want to merge three of my data tables.

Hi @Haseeb_Farrukh

Please check on below

Cheers!!

1 Like

@Haseeb_Farrukh
link query:
dtResult = {dt1,dt2,dt3}.SelectMany(Function(d) d.AsEnumerable.Select(Function(r) d.Clone.LoadDataRow({r(0)},False))).CopyToDataTable()

OR

image

1 Like

It is working, but the issue is that it is merging all of the data into one single column. All I need is that all my data from the three Build Data Activities should appear in three separate columns. Thanks

Hi @Haseeb_Farrukh

Could you try with the below Linq Expression in assign activity,

- Assign -> dtResult = {dt1,dt2,dt3}.SelectMany(Function(d) d.AsEnumerable.Select(Function(r) d.Clone.LoadDataRow({r(0)},False))).CopyToDataTable()

Hope it helps!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.