How to extract group of data in payer column based on company code of duplicate values

Hi @Jyothi1

=> Read Range Workbook
image
Output → dt

=> Use below syntax in Assign:
resultDt = (From row In dt.AsEnumerable() Group row By CompanyCode = row.Field(Of Double)("Company") Into Group Select result = New Object() {CompanyCode, String.Join(",", Group.Select(Function(r) r.Field(Of String)("Payer")))}) _ .Select(Function(x) dt.Clone().Rows.Add(x)).CopyToDataTable()

=> Write Range Workbook resultDt.
image


data.xlsx (10.5 KB)

Regards

1 Like