Web to Excelsheet

Hi i have a task that bot need extract the value from web and after extrating it has two columns

  1. I need to add the column values and write to another excel sheet of those columns of value1 and value2

Input =
Column1 column2
10 10
5 12
Output =
15 22

This way
How can i achieve this one can any one help

@Palaniyappan

1 Like

@Sagar_Sukla

after writing data to excel
use read range activity for reading the first excel

use 2 assign activity

outputvalue1=dt.AsEnumerable.Sum(Function(x) cint(x(“ColumnName”).ToString))

outputvalue2=dt.AsEnumerable.Sum(Function(x) cint(x(“Columnname”).ToString))

use write cell or add datarow activity to write the values in another sheet

cheers

Hi

Hope the below steps would help you resolve this

  1. Let’s take u have the datatable named dt

  2. Now get the sum value like this for those two columns

int_sum_1 = dt.AsEnumerable().Sum(Function(row) cint(row(“Columnname_1”)))

int_sum_2 = dt.AsEnumerable().Sum(Function(row) cint(row(“Columnname_2”)))

Where both are integer varivale

In cint doesn’t work try with double like this cdbl

  1. Now use a assign activity like this
    Dtfinal = dt.Clone

  2. Then use clear datatable activity and pass dtfinal as input and output

  3. Now use add Datarow activity and mention like this
    ArrayRow = {int_sum_1.ToString, int_sum_2.ToString}
    And datatble as dtfinal

  4. Finally use a write range activity where pass dtfinal as input and enable add headers property

Hope this helps

Cheers @Sagar_Sukla

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.