How to Merge cells and sum values if rows are same

@sathish_Kumar6

Read the data in to a datatable dt…now use below in the assign activity

Use Build datatable activity with outdt and 4 columns as strings

outdt = (From d In Dt.AsEnumerable() Group d By k=d("Name").toString.Trim Into grp = Group Let gSum =grp.Sum(function(x) CDBL(x("Amount").ToString).ToString Let ra = New Object(){k,grp.FirstOrDefault(1).ToString, grp.FirstOrDefault(2).ToString,gSum} Select r = outDt.Rows.Add(ra)).CopyToDataTable()

Cheers

1 Like