I want to retrieve duplicates based on the columns “Supplier”, “Invoice”, and “Code” in workbook Test.xlsm, remove them from Sheet1, and paste them to Sheet2.
I already know how to remove duplicate rows within a DT using the activity, but that is not the goal.
This is what I have so far using Linq, but I didn’t figure out how to group by 3 columns, and I don’t know if there is another way to accomplish this task,
FindDuplicates.zip (81.1 KB)
Currently, it can group by 2 columns but not for 3:
Unfortunately, I cannot use non-official activities
@Tana20 - Please check this
@prasath17 Thanks, it works!
This way works well too!
.GroupBy(r => (r["Supplier"],r["Code"],r["Invoce"]), r=> r)
.Where(r => r.Count() == 1)
.Select(r => r.ToArray())
//.SelectMany(r => r)
@park363 - Have you tried your solution? Lamba expression doesn’t work in Uipath, we have to change it to Function(x) x something like this…
upper code is c#.
as your comment, vb uses ‘Function(x) x’ for lambda.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.