Error in storing double value in excel

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)”,“”)

@SHAISTA, this will help you,

Regards,
Dominic :slight_smile:

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

I get this error when i use this.

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

Regards,
Dominic :slight_smile:

Yes i know that :joy:

@SHAISTA, Refer this existing solution,

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

Regards,
Dominic :slight_smile:

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.

@SHAISTA, I could achieve this with following query,

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

Regards,
Dominic :slight_smile:

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

1 Like