Group by and sum possible with UIPath compared to using an external database solution?

I have this data table:

Code,Hours
1,02:00:00
9,04:00:00
1,06:00:00
9,03:00:00
2,02:00:00

I want to Group By Code, and Sum on Hours, resulting in a data table something like this:

Code,SumH
1,08:00:00
9,07:00:00
2,02:00:00

With a SQL DBMS approach, this would be easy as pie, but perhaps it is not possible to do in an easy manner with UIPath? Most of the solutions I find are quite complicated…

Thank you for any insights!
Jakob

The solution can include stripping the timeformat and have simple ints for Hours if that would make the solution, ie:

Code,Hours
1,2
9.4
1,6
9,3
2,2

@Jakob_Petersen
You can do with
For each and manually coding
With some packages e.g from Go Platform
LINQ Statement

In Case of you can Share some Sample Excel WE can Help you very qhickly

If you can help me, I would be extremely grateful!! This is some example data that you requested (a csv that I had to zip in order to be able to upload on this forum):

test_data.zip (189 Bytes)

Yes i will Help you. Just give me some little time

@Jakob_Petersen

PFA demo implementation here: Jakob_Petersen.xaml (9.6 KB)

the solution makes use of timespan DataType for the hour/minute/second Addition
the group by was realized by iterating over the different groups (first for each)
and processing the group rows (second for each)

Kindly note:

  • rewire the path to csv according to your environment
  • ID value has been shifted to INT (removing leading zeros from the string)
  • output datatable was included for demo purpose and can be removed

Let me know your feedback and mark the solving post as solution. So others can benefit from it.

1 Like

Hi @Jakob_Petersen,

Take a look . In the below one has an activity called “Group by aggregation”. It helps you…

Regards
Balamurugan.S

Thank you so much, ppr! That was a smart and understandable solution to my problem!

Jakob

1 Like

Very easy to implement into my rather lengthy, and complex solution as well!

Cheers, ppr!
J

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.