check this excel.
The aim is to check if an document number is found under two accounts. Account is stated on the yellow lines.
How do you think is the best approach?
Read first all account numbers in an array and then add a new column where we add the account number for each row and then we detect duplicates based on two columns, document number and account number?
filter out the '@5C.... rows
and have a look on the FillUp_BlockBlanks.xaml
When account 200004 is refering to the above rows: 2-13 from excel then we need to do some modification on the filling up. For this modification one of my colleagues @kumar.varun2 can help you
Yes, The input file you shared yesterday was not having such scenario. The last row of the new input file is having the empty first column. I think it contains the total.
We can try by removing it.
In the assign before the for each, just change the right part.
I want to know if the same document number appears on two different accounts.
Ideally we will have a column with Yes No values for each document number.
(
From row in dt_Output
Group row by k=row("Document Number")
into grp=Group
Where (grp.Count > 1 And grp.Select(Function(gr) gr("Account Number")).Distinct.Count > 1)
Select k
).ToArray
This gives an array of object, which contains the document number which satisfy your requirements.
(
From row In dt_Output
Group row By k=row("Document Number").ToString.Trim
Into grp=Group
Where (grp.Count > 1 And grp.Select(Function(gr) gr("Account Number").ToString.Trim).Distinct.Count > 1)
Select k
).ToArray