Merge rows in a data table


I need to merge rows on the basis of MID. Please help.
Please refer SS.

Hi @Tanmay_V_Chetule

Check once this thread:

Hope it helps.

@Tanmay_V_Chetule

Welcome to the community

Please try this

  1. Create an outputdt and use build datatable and create 4 string type columns
  2. Use assign as below
    outputdt = (From d In dt.AsEnumerable Group d By k=d("Name").toString.Trim, k1=d("Age").ToString.Trim, k2=d("MID").ToString.Trim Into grp = Group Let g1 = String.Join(",",grp.Select(function(x) x("ID").ToString)) Let ra = New Object(){k,k1,g1,k2)} Select r = outputdt.Rows.Add(ra)).CopyToDataTable

Cheers

You also use join activity

@Tanmay_V_Chetule

Please refer below link which helps to compare and merge two datatables using linq Query

Happy Automation

1 Like

Thanks @Anil_G. It worked.
Really appreciate your help.

1 Like

Thank you for the inputs @supriya117

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