How to sum three columns in LINQ query

Hi @sathish_Kumar6
=> Use Read Range Workbook to read the exce3l and store it in an datatable say dt
Input:


=>Use the below linq query in assign acitivity:

dt= (From row In dt.AsEnumerable()
                     Let sum = row.Field(Of Double)(0) + row.Field(Of Double)(1) + row.Field(Of Double)(2)
                     Select newRow = dt.Clone().LoadDataRow({row(0), row(1), row(2), sum}, False)).CopyToDataTable()

=> Use Write Range workbook to write the data back to excel.
Output:


Workflow:

xaml:
Sequence5.xaml (7.5 KB)

Hope it helps!!
Regards

1 Like