Group DataTable and get the number of entries

Hi!
In https://acme-test.uipath.com/vendors/results-by-name/ (menu Vendors - Search for Vendor - Display All Vendors ) I’m get DataTable and want group by Country .
The result should be in new DataTable as follows 2 columns “Country” and "Numbers " :
Romania 8
Italy 3
Germany 2
France 4

SearchForVendors.xls (28 KB)

@Aleksey_M Check below workflow, i have changed input sheet name to “Sheet1”.

new.xaml (13.1 KB)

1 Like

Thank’s Manjuts90 , it work!
But is there a solution without a loop? For example use datable.Select.AsEnumerable() ?

1 Like

@Aleksey_M. I don’t have much knowledge in coding, there will be a way, u can search in forum u might chance of getting answer through that method.

@Aleksey_M You can modify the below code based on ur requirement.

 dtOutPut= (From p In dta.Select
             Group p By ID= Convert.ToString(p("Id")) Into GroupA=Group
             Select dta.Rows.Add(GroupA(0)("Id").ToString,string.Join(",",(From p In GroupA Select Convert.ToString(GroupA("name"))).ToList))).ToArray.CopyToDataTable

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