Find the Duplicates on particular Column?

Hi All,
I want to Find a duplicate of a particular column and Make duplicate value as in one row.Can anyone help me for this ,how can i write linq query for this.
Below is the input and output show.

Input
Input

Output
Output

Hi @yashashwini2322

Try this syntax:
distinctDt = InputDt.DefaultView.ToTable(True, "Column A")

distinctDt is of DataType System.Data.DataTable

Hope it helps!!

Hi @yashashwini2322

Check the below flow for better understanding

=> Read Range Workbook
image
Output → InputDt

=> Use below syntax in Assign activity:

distinctDt = InputDt.DefaultView.ToTable(True, "Column A")

=> Write Range Workbook distinctDt back to excel.
image

Regards

Hi @yashashwini2322

Try below expression in Assign Activity

NewDT = DT.AsEnumerable().GroupBy(Function(row) row("Column A")).Select(Function(group) group.First()).CopyToDataTable()

Hope it will helps you :slight_smile:
Happy Automation

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