I have a column with Numeric values. I have to add all the values in the column with each other. But the no of line items in the column is not fixed. It may have more no of line items sometimes. How can I add all the Values? Help me to Solve in this.
Thanks in Advance
You can use linq to get the sum.
Please have a look.
Hope this helps to solve.
Hope the below expression would help you resolve this
It doesn’t rely on number of line items
And can handle any number of rows
Use read range activity and get the datatable dt as output
Then use a assign activity like this
dou_sumvalue = dt.AsEnumerable.Sum(Function(x) If(IsNumeric(x(“Amount”).ToString.Trim),CDbl(x(“Amount”).ToString.Trim),0))
Where dou_sumvalue is a variable of type
For more details on data le functions
Datatable - variable type is the most commonly used variable type by all UiPath users
And it’s been the most often asked queries in forum especially on its manipulation
So I would like to have this post as a repository for those who are looking for expressions related to Datatable
Let’s go one by one keeping dt as name of datatable variable
1. Get number of rows in a datatable dt
dt.Rows.Count (output - int32 type)
2. Get number of columns in a datatable dt
Try this below expression
(From d in dtData.AsEnumerable Where Not (isNothing(d(Amount)) OrElse String.IsNullorEmpty(d(Amount).toString.Trim)) Select v = CDbl(d(Amount).toString.Trim)).Sum(Function (x) x)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.