(From d in dtData.AsEnumerable
Group d by k=d("Name").toString.Trim into grp=Group
Let pc = grp.Any(Function (x1) CInt(x1("value").toString.Trim) >= 0)
Let nc = grp.Any(Function (x2) CInt(x2("value").toString.Trim) < 0)
Where pc AND nc
From g in grp
Order By dtData.Rows.IndexOf(g)
Select r=g).CopyToDataTable
we can use variables within the statement and calculate the column index / name in advance
like this for example
strKeyCol = “Name”
strValCol = “value”
(From d In dtData.AsEnumerable
Group d By k=d(strKeyCol ).toString.Trim Into grp=Group
Let positive = grp.Any(Function (x1) CInt(x1(strValCol ).toString.Trim) >= 0)
Let negative = grp.Any(Function (x2) CInt(x2(strValCol ).toString.Trim) < 0)
Where positive And negative
From g In grp
Order By dtData.Rows.IndexOf(g)
Select r=g).CopyToDataTable