MarkusDS
(Markus)
January 15, 2020, 9:56am
1
Hi
I have this simple datatable, with some rows being there multiple times.
I would like to merge the non-unique lines, so that my end result would be like this with summed prices for and with one line for each itemnumber.
Is there an easy way to merge the rows by summing up column “PRICE” and keeping itemnumber and qty.
The excel is just for showing, the data will be kept and handled as a datatable.
1 Like
See the use of LINQ for this here:
Thanks a lot @Shubham_Varshney i got output as Ienurable, now do i need to convert into datatable ?
You could also use Pivot Table activities to achieve the required results
The UiPath Documentation Portal - the home of all our valuable information. Find here everything you need to guide you in your automation journey in the UiPath ecosystem, from complex installation guides to quick tutorials, to practical business...
MarkusDS
(Markus)
January 15, 2020, 11:12am
3
Very nice, i will have a look into that, thanks !
vickydas
(vicky)
January 15, 2020, 11:29am
4
Hello @MarkusDS
As Also suggested by @ronanpeter this can be easily done using LinQ
I recreated the same scenario(Datatable) and applied LinQ query on it to get the desired result.
Check this workflow for better understanding
GroupBY.xaml (8.0 KB)
1 Like
Same, put together this which should help:
GroupBySum.zip (2.1 KB)
MarkusDS
(Markus)
January 15, 2020, 11:40am
6
Thanks @ronanpeter and @vickydas
It works perfectly and it is kept as a DT so i can process it futher, thanks
system
(system)
Closed
January 18, 2020, 11:40am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.