The question about filter the same data

I want to filter the data in the same column, in the case that I do not know what the specific data is called, how can I do it?

1 Like

HI @HuaiYe

Can you elaborate your query?

If possible share the sample input and expected output file


Hi @Gokul001
I want to filter the data in a column where each row is different but in some rows they are the same.I want to filter out the same parts of it.


Better if you can provide some Input & output sample files



Duplicate records from the same data table
(From p in dt.Select() where( From q in dt.Select() where string.Join(",",q.ItemArray).Equals(string.Join(",",p.ItemArray)) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()

Try this one
If you want specific Column alone mention the column name
(From p in dt.Select() where( From q in dt.Select() where q("ColumnName").Equals(p("ColumnName")) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()

Cheers @HuaiYe

OK,I’ll put a screenshot for you to see.

I want the data with the same code in this column, excluding the part on the graph, there are many more data, how do i filter the same data when i donnot know the data specific values

HI @HuaiYe

As far I understood you need to get the duplicate rows based on one column if yes
Try this expression

(From p in io_TransactionData.Select() where( From q in io_TransactionData.Select() where q(“Yourcolumname”).Equals(p(“YourColumnName”)) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()


Aww okay I didn’t see that @Palaniyappan also suggested the same

You can try this on your side and let us know if it resolved


1 Like

looks like you want to find out repeating values. We can find this e.g. by grouping the data

Lets assume a datatable with column name 12

Assing Acitvity:
LHS: ListMultiOccurences | List (Of String)

(From d in YourDataTable.Var.AsEnumerable
Group d by k=d("12").toString.Trim into grp=Group
Where grp.Count > 1
Select s=k).toList

it will return a list of all values from 12 (L Col) which occurs more then 1 time

Were you able to get the records as required @HuaiYe

Hello i have filtered the data table using(From p In dt Where p(31).ToString.Equals(“Kindly create add-on WO for invoicing”) Select p).ToArray.CopyToDataTable but after this i want to remove rows whose value is less than 1, how to do it?