Delete duplicate AND original value from a datatable

Hi all,

I have two datatables with one column each and merge them/create a new table, so that I have a table in the end that has also one column and contains only the values that were not in both of the original tables.

As an Example:
If
Table1: 1, 2, 3, 5
Table2: 1, 2, 3, 4
Then
Table3: 4, 5

I hope my goal is clear. I´m sure there is an easy way to solve this, but i tried it with merge and remove duplicates activities as well as the join table activity. Unfortunately I wasn´t able to achieve the result I needed.

Thanks in advance!

Kind regards

one of many options would be to merge the two tables (we assume the column structure / names are the same

dtMerged:
Col1
1
2
3
5
1
2
3
4

then we remove the duplicated values by

dtResult =

(From d in dtMerged.asEnumerable
Group d by k=d(0).toString.Trim into grp=Group
Where grp.Count = 1
Select r = grp.First()).CopyToDataTable
2 Likes

Hi @Timsener ,

There is another method we can use to achieve this requirement.

  1. Use Join data table activity with Full join mode and assign DT1, DT2 to get the DT3.

  2. Use Filter to remove the blank values those are not matched.

Please refer the attached work flow for your reference. if you wish you could try. thanks.
Join Demo.zip (17.4 KB)

1 Like

Thanks @ppr @kirankumar.mahanthi1!

both solutions worked perfectly well :ok_hand:

1 Like

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