Excel Automation - Calculate and sum the transaction amount

Hi you can try with this approach.

From row In dataTable.AsEnumerable()
Group row By CustomerName = row.Field(Of String)(“CustomerName”) Into Group
Select New With {
.CustomerName = CustomerName,
.TotalSales = Group.Sum(Function(row) row.Field(Of Double)(“SalesAmount”))
}

dataTable - Read Range Output

Steps

  1. use Read Range and create the OP
  2. Use assign ( var type- DataTable )Activity & pass the query
  3. Use write range activity & write the output
1 Like