How to group by two column and sum up the rest of the column

Dear developers, how to group by taking two column values into criteria and sum up the rest… below example will group by one column… and it works perfectly… how do i alter the solution for it to group by two column value? thank you appreciate your kind help.
(How do I group by one column in the datatable and take the sum? - #10 by MAHESH1)

@Yusuf_Rahmaniac Having you tried Grouping using this method :
(From p In dt.Select()
Group p By ID= New With { Key.a =p.Item(“ID”).ToString,Key.b=p.Item(“Col2”)} Into GroupA = Group
Select Convert.ToString(GroupA.Sum(Function(x) Convert.ToDouble(x.Item(“Amount”).ToString)))).ToList()

5 Likes

wow you are great sir. Thanks!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.