I wanna combine these methods

(
From row In excel1_DataTable
Group row By a = row(“Invoice Number”).ToString.Trim Into grp = Group
Select grp.First
).CopyToDataTable

(
From dte In excel1_DataTable.AsEnumerable
Group dte By col1= dte(5) .ToString.Trim Into Group
Select excel1_DataTable.Rows.Add({ Group.Sum(Function (x) CInt( x(16).ToString.Trim))})
).CopyToDataTable

I wanna combine both syntax and wish it can add a column and write “Guid.NewGuid”
can somebody please help me out

let us know the column index/names for grouping
The column structure of processed datatable
The Column Structure of the target data table, which are representing the output

Thanks for support

Hi Peter,

consider this sample excel sheet.

invoice number (blue color column) is repetitive, based on that. I need only one row of each unique invoice number. including a column where the sum of “Incident Cost” L2:L85 based on invoice number. at the last column it add a same unique random id for all filter row.(it should be random, every time it get filtered
01.xlsx (60.1 KB)
)

I have manually filtered the raw sheet and put it in Sheet1, consider sheet1 as a result sheet

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