Unable to remove duplicate from date in datatable


Used the Remove duplicate activity but it is unble to remove dupliicate. can anyone have any logic to remove this please suggest. thanks

@Shubham_Kinge ,
On what basis you are Removing the duplicates? Do you want the first value after removing the duplicates? If so try this.


(

From row in DT_Input

Group row By a=row(“Date to Process”).ToString.Trim into grp=Group

Select grp.First

).CopyToDataTable

Regards,

but this should not remove the different company code with same date.

@Shubham_Kinge ,

Try this


(
From row in DT_Input
Group row By a=row(“Company Code”).ToString.Trim, b=row(“Date to Process”).ToString.Trim into grp=Group
Select grp.First
).CopyToDataTable

Regards,

Hello @Jithesh_R
Found one more reliable.
if column name changed then also it will work.

dt_transaction = dt_transaction.AsEnumerable().GroupBy(Function(row) String.Join(“|”, row.ItemArray), Function(key, group) group.First()).CopyToDataTable()

Thanks For support.

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