How to get the non duplicates based on three Columns in Datatable

I can able to get the Non Duplicates based on key one Column with below Query,can anyone help me to get the non duplicates based three Columns with in data table

(From d In dt
Group d By k=d(0).toString.Trim Into grp=Group
Where grp.Count =1
Select grp.First()).CopyToDatatable

@Lakshmi_N Considering that you need to do a Group By based on three Columns you can try the below Query :
(From d In dt
Group By x= New With { Key.a =d.Item(“Col1”),Key.b=d.Item(“Col2”), Key.c = d.Item(“Col3”)}
Into grp = Group Where grp.Count=1 Select grp.First()).CopyToDataTable

ThankS,

this code is working,but i want to extract duplicates with only these three columns not all columns in the DT

(From d In dt
Group By x= New With { Key.a =d.Item(“Col1”),Key.b=d.Item(“Col2”), Key.c = d.Item(“Col3”)}
Into grp = Group Where grp.Count>1 Select grp.First()).CopyToDataTable

Hi @Lakshmi_N,
you can use this for your purposes, this activity will create a new DT with filtered data and you specify filter by which you want to filter the data and also you can remove or keep columns that you specify.

Filter data table i have tried but not able to achieve the required Duplicate Columns,here getting all column with duplicates.but my requirement is,in Datatable i have 70 Columns and 8000 rows,here i want to extract the duplicates rows based on three columns(col1,col2,col3) final out put Dt contains only 3 columns(col1,col2,col3) with Duplicate rows.

@Lakshmi_N,

I can’t find some pretty solution which would work for this, you can only create loop in loop which will compare row with other rows but this will be slower.
Also you can check this forum topic about this, I don’t know if it is a slolution for your problem.


Cheers,
Dino

@Lakshmi_N Can you provide a Sample data Input Data and the Expected Output for that data, so we can understand what exactly the operation that is needed to be performed ?