can anyone help me i have data in excel where iam doing sum of 3 columns and divided by 100 and writing the value in D column
here my requirement is i want add percentage and increase the value to 3 decimals
is this possible?
i dont have any pre-build template here
Hi
Kindly follow these:
- Clone your data table to get its header
Assign dtResult = dt1.Clone() - Use this LINQ to get what you want
Assign dtResult =
( From row in dt1.AsEnumerable()
Let ColA = Convert.ToDecimal(row(“ColA”).to string)
Let ColB = Convert.ToDecimal(row(“ColB”).to string)
Let ColC = Convert.ToDecimal(row(“ColC”).to string)
Let Sol = Math.Round(((ColA+ColB+ColC)/100), 3)
Let nc = dt1.Columns.Count-1
Let ra = row.ItemArray.Take(nc).Append(Sol).ToArray
Select r = dtResult.rows.add(ra)
).copytodatatable - Write dtResult into an excel using Write Range activity.
Please mark if it solve your problem.
Thank you