Hi Team,
i need to Remove the duplicate invoice and need to add both the totals in one single row item.Amount in document currency to be added. Please provide the solution how to do it.
Hi Team,
i need to Remove the duplicate invoice and need to add both the totals in one single row item.Amount in document currency to be added. Please provide the solution how to do it.
@Sikander_siki
Welcome to the forum
We can do this with grouping the data
There are thousands of data, and we need to only filter the duplicate document number and add single totals to one invoice…
First data table i have given headers, but what will give as input . is it same headers or input like document number and total.
Please find the below screen shot
No problem we can process also this volume
we only need the structure for the preperation. No need for manually enter the calculated values. This we do e.g. with LINQ
Lets assume a well prepared datatable (2 cols, Invoice, TotalAmmount) - dtResult
(From d in dtData.AsEnumerable
Group d by k=d(“Document Number”).toString.Trim into grp=Group
Let sm =grp.Sum(Function (x) CDbl(x(YourColNameOrIndex).toString.Trim))
Let ra = new Object(){k, sm}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable
I have implement the code, but matching document number not able to get and add the amount in document currency into single row with one invoice is not happening,rather it is counting all the rows.
Please find the below code.
Test.xaml (11.6 KB)