I have DataTable as attached file.
I want to split into another table base on “item” & “Number” Cols
The Condition: The values at “Number” Col are < 0 and The values at “item” are same.
I have used linQ code as below but it printed result not correct.
Where is mistake in my code?
Thanks in advance!
(From d In table.AsEnumerable
Group d By k=d(“item”).toString.Trim(), k1 = Convert.ToDouble(d(“Number”).toString.Trim) < 0 Into grp=Group
Where grp.Count > 1
Select grp.ToList).SelectMany(Function (x) x).CopyToDataTable
Book1.xlsx (8.3 KB)