I’d say just do a couple of loops through the datatable using a counter either with while loops in a sequence or using decisions in a flowchart. Reference the rows like datatable(counter)(0).
First run, just get all the unique names. If it’s a new name put in an array. Check the array each loop and keep adding the uniques to the end.
The loop through the array, match the name in the datatable column 0 and then if it matches have a second array that matches the first (but of type integer or double).
At the end, just write out the arrays or else put into a new datatable or whatever you need to do with them.
the above solution is when a datatable is actually built/configured with in uipath, but in case when a datatable is a result of a read from a csv/xls file, in which case the columns are by default of strings…
How to calculate for a specific column in that case which has a int/double values…
Assign : Syntax error in aggregate argument: Expecting a single column argument with possible ‘Child’ qualifier.
If I remove Cdbl conversion, row(1) = datatable.Compute(“sum([Total Count])”, “TranType='” &row(0).ToString & “'”)
The error is, Assign : Invalid usage of aggregate function Sum() and Type: String.
@arivu96 - this is not were I have stucked. Am filtering the data’s from one excel sheet by column specific and adding the data’s dynamically to datatable and after that I have to write those data’s to excel sheet. Its working fine but its overwriting the data in the excel sheet row. So I just want to how to add multiple rows into a data table using add data row.
This works perfectly when the type of the data column is predefined as int32. My situation is that I am outputting a datatable from Excel Application Scope and the data type of the column is Object. Using the solution that you provided, I got an error saying “assign invalid usage of aggregate function sum()”. could you provide an example showing how/where can I change the data type of the column while simulating your solution? Thanks a lot!