Many times we have been asked to calculate the max and average value from a dataset.
In this article , we will see how we can eaily achieve this LINQ query in UiPath.
Implementation in UiPath
Step 1:- Lets drag build DataTable activity in the designer panel & populate some value.
Step 2:- Drag message box activity in the Designer panel & use the LINQ query to get the maximum value from the data.
Max_Value:-
DataTable_Name.AsEnumerable().Max(Function(row) cint(row(“Column_Name”)))
Step 3:- Drag message box activity in the Designer panel & use the LINQ query to get the average from the data.
Average_Value:-
DataTable_Name.AsEnumerable().Average(Function(row) cint(row(“Column_Name”)))
Step 4:- Lets run the workflow now.
I hope you enjoyed the article!
Happy Automation!!