Error in storing double value in excel

excel
activities
studio

#1

Hi,

I am trying to calculate the sum of two variables(of type double) present in column5 .
I have taken the sum variable also of DOUBLE data type but i dont know how to write it in excel. Can anybody suggest me please?

I am using this function-

sum=OutputDT.Compute(“Sum(Gross_Amount)”,"")


#2

@SHAISTA, this will help you,

Regards,
Dominic :slight_smile:


#3

Blockquote Assign : Invalid usage of aggregate function Sum() and Type: String.

I get this error when i use this.


#4

@SHAISTA, BTW amounts mentioned there is a column name. Its not a variable.

Regards,
Dominic :slight_smile:


#5

Yes i know that :joy:


#6

@SHAISTA, Refer this existing solution,

  1. How to sum all values in a column of an excel/Datatable?
  2. How to find the sum of 2 columns of an excel and display it in a 3rd column using UIPATH?
  3. Excel Variable SUM Formula

Regards,
Dominic :slight_smile:


#7

I tried but i get some or the other method while using this.
What i have to do is- I have to add the data of 3-4 rows present under the column (GrossAmount) and then i have to write the total amount in a cell in excel.


#8

@SHAISTA, I could achieve this with following query,

Double d = dt.Select().Sum(Function(x) CDbl(x(“GrossAmount”).ToString))

Regards,
Dominic :slight_smile:


#9

Oh i just checked that the value under GrossAmount is in this from 230.58 INR

So it was reading INR also along with the numeric value.

I have done it…thank you