Ex. compare both column center and function
Center Function Profit
ABCD 8234 132.30
AGCD 1334 632.45
TBUD 1234 -332.00
ABCD 8234 -332
ABCD 6234 -112.95
Answer Table Look’s like:
Center Function Profit
ABCD 8234 -200(Hint: 132.30-332=-199.70)
AGCD 1334 632.45
TBUD 1234 -332.00
ABCD 6234 -112.95
(From d in dtData.AsEnumerable
Group d by k1=d("Center").toString.Trim, k2=d("Function").toString.Trim into grp=Group
Let s = grp.Sum(Function (g) CInt(g("Profit").toString.Trim))
Let ra = new Object(){k1,k2,s}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable