Need to remove duplicates on single column

i want to remove duplicates only for a single column. please help

Hi @manojmanu.rpa
Remove duplicate rows activity can be used

0r

Hey @manojmanu.rpa please try this linq query.
dtTable.AsEnumerable.GroupBy(function(x) x(columnname).ToString).Select(function(y) y.First).copytodatatable

It will help you to select the unique value from the column

Regards

Sreejith S S

Thanks @sreejith.ss
These is the input i have to give


and output need to come like this

based on invoicedate col i have to merge commented reasons into one cell, can you please help in that.

Regards,
Manoj

Hi @manojmanu.rpa

Can you try this

Use in Assign

dt = (From d In dt.AsEnumerable
Group d By k=d("invoicedate").toString.Trim Into grp=Group 
Let n = grp.Select(Function (rn) rn("PO").toString).FirstOrDefault
Let s = String.Join(";", grp.Select(Function (rn) rn("Commented").toString).toArray)
Let ra = New Object(){k, s, n}
Select dt.Rows.Add(ra)).CopyToDataTable

dt is the datatable in which data is present

Cheers

it’s works. Thanks @Anil_G :clap:

Regards,
Manoj.

1 Like

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