A csv existing of 6 columns (Delimiter: Semicolon) has to be re-arranged by consolidating rows with the same ID.
So I first need to identify all different IDs so that afterwards rows with the same ID can be Consolidated within a single row. Three of the related values (in the other columns) are equal for each group (of identical IDs). So either the first or last record can be taken.
But for two of them (marked blue) I need to total up the values in the cell (related to the same ID) - see screenshot below:
Please find a sample file attached… UiPath Forum.zip (442 Bytes)
To sum it up…
Columns D and E need to be consolidated based on the (same) ID in column A.
For the other columns either the first or the last record can be taken.
Thanks in advance for your help!
Hi @ranjith_udayakumar,
the first part (reading data from excel and store it in Data Table) I already did of Course.
Can you please be more specific with the second part since I am not so much into VB.net Methods.
Any concrete idea about the final Code?
Thanks in advance
Hi @ranjith_udayakumar,
thanks for your advice.
I installed the package you suggested and tried to find a solution by using activity “Group by Aggregation”.
But honestly I do not know how to configure it in detail in order to meet my requirements.
Can you help me out please?
Thanks in Advance
Hi @karthick,
thanks for your help.
I managed to realise the first part.
So I got a list of all distinct values of a specific column ("Vertrags-OM) - see the screenshot below where the actual file (marked yellow) and the “filtered” file (marked red) are compared:
But how exactly do I have to proceed in order to get the sum of another column’s values based on the ID in column “Vertrags-OM”?
For the example showed in the screenshot I need to have 11 rows (+header) in the end (each having the ID’s sum of specific columns)
Thanks in Advance for your support
@ranjith_udayakumar,
I never worked with the Group by Aggregation activity and I am not sure what Settings I have to choose in order to:
get all distinct IDs of column “Vertrags-OM” (with the help of @Karthik I actually found another way to realise this - see my post before)
Based on this I need to sum up all values of two different columns belonging to the same ID so that I have one row for each ID with the total of the associated values
for the other values (mapped to further columns) of this row the first value of all the required rows should be taken
I hope the following Picture makes clear what I try to achieve…
you said this is the next step… (from line in DataTableMain.select where line(“Policenumm”).equals(“DistinctValue”) select cint(sum(line(“Columname”)))
But can you please be a bit more precise?
Thanks in Advance
using Assign activity and use the below query to get the sum
(from line in DataTableMain.select where line(“Policenumm”).equals(“DistinctValue”) select cint(sum(line(“Provision”)))
We have two value in Provision . Which value should be considered?
@karthick,
it says that sum is not declared or invalid in the current range.
What does line stand for?
There are two columns which need to be calculated - “Provision” and “Berechnungsgrundlage”