Filter Datatables


I need a datatable filter that I can not implement. please help me.

I have a dt1 and a dt2, at the end the data from dt1 should remain if they are not contained in the dt2.

I hope I could explain it so you understand it

Hi @juergenh1975
Can you share the excel?


use an assign activity
left side: dtResult | Datatype: datatable
Right side:

(From d in dt1.AsEnumerable
Where Not dt2.AsEnumerable.Any(Function (x) x(“NR”).ToString.Trim.Equals(d(“NR”).toString.Trim))
Select d).CopyToDataTable

why excel share ?
my Excel screen should only show as an example

thank you very much, but sorry I’m a beginner.
can you please give me the exact value I have to enter on the right

@juergenh1975 This is the Whole Value you need to enter in right


Thank you so much! unfortunately I can only check it tomorrow morning, but I am confident that it works

In case of we have to assume that also an empty result can occur (all dt1 rows are present in dt2) we would handle it like following to avoid an exception thrown by CopyToDataTable.



the first suggestion worked wonderfully! Thanks very much !

which variable type is your “Result” exactly? I can’t find “List-DataRow-”

then confirm with OK, OK

1 Like

now it’s perfect! and thank you again!

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