Hi Expert,
I have an excel table and i need sum two datarows.( i.e. Amt_Before_Tax +GST sum up value will come on Taxvalue column.) How to do achieve this by LINQ. Attached input file
LINQSUM.xlsx (9.0 KB)
Hi Expert,
I have an excel table and i need sum two datarows.( i.e. Amt_Before_Tax +GST sum up value will come on Taxvalue column.) How to do achieve this by LINQ. Attached input file
LINQSUM.xlsx (9.0 KB)
dtData.AsEnumerable().ToList().ForEach(Sub(row) row.SetField("TaxValue", Convert.ToDecimal(row("Amt_Before_Tax")) + Convert.ToDecimal(row("GST"))))
Use the below vb in Invoke code activity,
For Each row As DataRow In inputDataTable.Rows
Dim amtBeforeTax As Double = Convert.ToDouble(row("Amt_Before_Tax"))
Dim gst As Double = Convert.ToDouble(row("GST"))
row("TAXvalue") = amtBeforeTax + gst
Next
Check the below workflow for better understanding,
Input -
Output -
Hope it helps!!
@mkankatala Thank you Much
Hi @Balachander_Pandian ,
Try this.
Input:
Output:
Code:
(From rows In dt.AsEnumerable
Let a = CDbl(rows("Amt_Before_Tax").ToString)+CDbl(rows("GST").ToString)
Select dt.Clone.Rows.Add({rows("sno").ToString,rows("Amt_Before_Tax").ToString,rows("GST").ToString,a.ToString})).CopyToDataTable
Workflow:
Xmal:
Sum.zip (1.4 KB)
Thanks,
It’s my pleasure… @Balachander_Pandian
Happy Automation!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.