Can I get the removed duplicate rows count?

Hi,
Can anyone tell me if there is an easy way to get the count of the duplicate rows removed by using the Remove Duplicate Rows Activity?

Thanks in advance for suggesting an easy solution?

Count_Duplicate=DT.Asenumerable.Groupby(Function(r) r(Col_Name).To string).Where(Function(g) g.Count>1).SelectMany(Function(g) g.Skip(1)).Count

So it works on a specific column right?
But I am removing duplicates from the entire Data Table.

dtOriginBeforeDupRemoveVar.Rows.Count - dtAfterDupRemoveVar.Rows.Count

2 Likes

Hello @Lokesh_Chandra ,

Try the below method to remove the duplicate Rows present in a Data Table:
dt_UniqueValueDt = dt_InputDt.DefaultView.ToTable(True)

To get the count of Duplicate Rows Use this :
Duplicate_RowCount = (From itemsA in inputDT where( From itemsB in inputDT where string.Join(“,”,itemsB.ItemArray).Equals(string.Join(“,”,itemsA.ItemArray)) Select itemsB).ToArray.Count>1 Select itemsA).CopyToDatatable.Rows.Count.ToString

Hi @Lokesh_Chandra,

You can get it by subtracting the last state from the first state.

Regards,
MY

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