Hi everyone,

I’d appreciate some help on the following process:

I have an input DataTable where I have to group by columns Name, Day, Type and sum column First Sum for each group. The problem is I still need all the rows, because Document Number column contains distinct values used later as Transaction Items. I also need to subtract each First Sum from Total Sum, except for the last item/sum.

I’ve used String.Join with delimiter “|” to the cell rows where I need the distinct values, but I’m now stuck.

I’m attaching the excel sample. InputDataTable in Sheet1, desired OuputDataTable in Sheet2, and Sheet 3 has what I managed to do.

Documents.xlsx (11.8 KB)

GetData.xaml (18.0 KB)