VladP
(Vlad Popa)
June 12, 2022, 9:43am
1
Hi,
I have two DataTables that more or less contain the same information. I would like to see if there is an element missing or added to one of the DataTables.
So if DT1 =
And DT2 -
I would like it to return that Oranges is missing from DT2.
Anyone that can help?
Thanks!
AshwinS2
(Ashwin S)
June 12, 2022, 10:11am
2
Hi @VladP
Use if condition
If(row(“column name”).ToString.equals row1(“Column name”).ToString
In else you can return missing element row(“column name”). ToString is missing
Thanks
Ashwin.S
Hey @VladP
Use Join Data Tables
for this scenario.
Thanks
#nK
jack.chan
(Jack Chan)
June 12, 2022, 1:36pm
4
you can use the except() function @VladP
the below code will print out the items in dt1 that are missing in dt2 (separated by comma)
this is assuming your column name = “Fruit ”, if not then you have to change it
String.Join(",", dt1.AsEnumerable.Select(function(row) row("Fruit").ToString).ToList.Except(dt2.AsEnumerable.Select(function(row) row("Fruit").ToString).ToList))
1 Like
Hello @VladP
Please refer to the below video. You can find the similar and dissimilar rows from 2 datatables.
system
(system)
Closed
June 28, 2022, 11:46am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.