To find Sum of Rows and get the value in new column Line items

Hi,

I have an excel file with contain six columns. I need to find sum the columns as Integrated Tax(₹)+ Central Tax(₹) + State/UT Tax(₹) …the sum of value will come in total tax amount columns (C+D+E) Result will come in F … how will achieve this by LINQ…?
Sum.xlsx (9.6 KB)

dt = dt.AsEnumerable.Select(Function(r) dt.Clone.LoadDataRow({r(C),r(D),r(E),Now.Millisecond},False)).CopyToDataTable()

please try this

@Balachander_Pandian

hi

For Each row As datarow In dt.AsEnumerable
row(5)=CInt(row(2).ToString)+CInt(row(3).ToString)+CInt(row(4).ToString)
Next

try this pass the expreesion in the invokecode activity

cheers

@Balachander_Pandian

dt_excel.AsEnumerable.select(function(x) dt_excel.Clone.LoadDataRow({x(0),x(1),x(2),x(3),x(4),cint(x(2))+CInt(x(3))+CInt(x(4))},False)).CopyToDataTable

Main.xaml (7.5 KB)

Hope this helps
Usha

Hi @Shiva_Nikhil Thank you… Code is run successfully but unable to see the output. Please advise me

1 Like

@Balachander_Pandian

for the output you need to change the argument as in/out

use write range workbook activity to write back to excel

cheers

hi @Shiva_Nikhil Thank you… It works now

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