I’ve followed the above link only. but i’m getting the mentioned error.
The Activities ‘Aggregation’ and ‘Group By Aggregation’ works perfectly. Error occurs only in ‘Native Group Aggregation’ activity.
My scenario is, Group by ‘State’ column and aggregate the columns {“sum(Value1)”,“sum(Value2)”} then print the result.
Attached the sample .xlsx file and process flow .xaml files here. check it and assist me on this.
Hi @balupad14,
I’ve changed the column datatype as ‘double’ as like you given in the Build data table activity. It works with your flow perfectly but still, the same error occurs for me.
I saw the excel file. Yes you would get the errors. Because when you read the xl , the datatable column type is an object. definitely you will get an error. Very soon you will get solution from me for the datatype Problem. Finally Thank you very much using my package and activities. ´
Your column should be surrounded in brackets since you have a space in the column name. Also, you need spaces between the column name, equal sign, and string you’re comparing to. Also, I’m guessing you’ll get a new error because you’re trying to compare a double to a string. You’d have to convert the column to string to do the comparison. A better way to do it might be to just use a .Where() and create a lambda function to sum it up instead of using .Select()
For group by “sum” from data table columns,you can use below select query,i think it’s help to you .
(From p In dt1.AsEnumerable() Group By x= New With { Key.a=p.Item(“Doc Id”),Key.b=p.Item(“Part Category”),Key.d=p.Item(“Tax Type”),Key.e=p.Item(“Tax %”)}
Into Grp = Group Select dt2.LoadDataRow (New Object() {grp(0)(0), grp(0)(1),grp(0)(2),grp(0)(3),String.join(“,”,(CStr(grp.Sum(Function(f) Convert.ToDouble(f(“Tax Amount”).ToString.Trim))) )),String.join(“,”,(CStr(grp.Sum(Function(f) Convert.ToDouble(f(“Total Value (Taxable Amount)”).ToString.Trim))) ))},False) ).CopyToDataTable