Hi guys,

I have just started work with UIPath and have some issues.

can you please help me to understand how to develop the follow code in UI Path for DataTable:

select client_number, Currency, Start_Date, End_Date, sum(Amount) as sum_amount, sum(Commision) as commision

group by client_number, Currency, Start_Date, End_Date

The excel example is attached.

Thank you very much in advance!

DimaUntitled.xlsx (10.8 KB)

# Sum values group by columns

**Stelz**#1

**balupad14**#3

HI @Stelz,

It may help you.

Regards

Balamurugan.S

1 Like

Sum of all Repeated values in Excel
**arivu96**#6

**Fer**#9

DataTableName is as System.Data.Datatable

sum = DataTableName.Compute(“Sum(Amount)”, string.Empty) where sum is defined as int32

Returns error

**arivu96**#10

`sum= Convert.ToInt32(DataTableName. Compute("SUM(Amount)", string.Empty))`

Regards,

Arivu

**arivu96**#12

Ok try below code

`DataTableName.AsEnumerable.Sum(Function(x) If(IsNumeric(x("Amount").ToString.Trim),CDbl(x("Amount").ToString.Trim),0))`

Regards,

Arivu

1 Like

**Fer**#13

How do you have declared the variable that is storing the code? Since I’m not getting AsEnumerable

**xiepanfeng**#14

hi fellow, it seems this activity only can group and sum of on colunms, is it works while group multiple columns?