Hello, I am new to UiPath and i need your help to understand how to solve this task. I have three columns called “Id Code”, “Id Person” and “Expenses”. I need to group (Id Code) with (Id Person) and calculate those columns expenses. I also insert example of columns. P.S highlighted columns are example how to count. Thank you for your time, I really appreciate it!
@Milda_x Follow these Steps :
-
Read the Excel File using Workbook Read Range and get the Output Datatable, say DT
-
Then use the Below Expression in an Assign Statement :
Output_DT = (From p In DT.AsEnumerable() Group By x= New With { Key.a =p.Item(“Id Code”),Key.b =p.Item(“Id Person”)} Into Grp = Group Select DT.Clone.LoadDataRow (New Object() {grp(0)(0),grp(0)(1),grp.Sum(Function ( r ) if(String.IsNullOrEmpty(r(“Expenses”).ToString) or String.IsNullOrWhiteSpace(r(“Expenses”).ToString),0,Convert.ToDouble(r(“Expenses”).ToString)))},False)).CopyToDataTable
Where Output_DT is a Datatable Type variable.
Check if this Works
Thank you, you helped me a lot!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.