i want to find the sum of each column separately, in the end i need to have 6 sum values. whats the best approach for this? any particular activity in ui path to find sum>?
Let us take you are having a datatable dta. with Six Columns.
Create one Array variable of type string.
Let us take it as
Arr Sum= (From p In (From q In dta.Columns.Cast(Of System.Data.DataColumn
Select q.ColumnName.ToString)
Select Convert.ToString((dta.Select().Select(Function(x) x(Convert.ToInt32(p.ToString)))).Sum)).ToArray
Now the first Element of the array contains the Sum of First Column, Second Element Contains the Sum of Second Column Like that.
Sum array = (From p In (From q In CustomisedCurrentDT.Columns.Cast(Of System.Data.DataColumn
Select q.ColumnName.ToString)
Select Convert.ToString((CustomisedCurrentDT.Select().Select(Function(x) x(Convert.ToInt32(p.ToString)))).Sum)).ToArray
(From p In (From q In CustomisedCurrentDT.Columns.Cast(Of System.Data.DataColumn
Select q.ColumnName.ToString)
Select Convert.ToString((CustomisedCurrentDT.Select().Select(Function(x) x(Convert.ToInt32(p.ToString)))).Sum)).ToArray
Arr Sum= (From p In (From q In dta.Columns.Cast(Of System.Data.DataColumn
Select Convert.ToString(q.ColumnName))
Select Convert.ToString((dta.Select().Select(Function(x) Convert.ToInt32(x(p.ToString)))).Sum)).ToArray
(From p In (From q In CustomisedCurrentDT.Columns.Cast(Of System.Data.DataColumn Select Convert.ToString(q.ColumnName))
Select Convert.ToString((CustomisedCurrentDT.Select().Select(Function(x) Convert.ToInt32(x(p.ToString)))).Sum)).ToArray