I have a large table of customers, invoice numbers, invoice reference and amount. Sometimes invoices get cancelled/credited. When they are cancelled, they get unique invoice number, but same invoice reference as the original invoice.
I read the entire data into an array, but i am struggling with following: In the case customer number and invoice reference is same and the total of the postings is 0, i want to delete these rows from my array.
Example:
Customer | Invoice | Reference | Amount |
---|---|---|---|
3233 | 91324941 | 91324941 | 143.966 |
3233 | 91323172 | 91323172 | 155.418 |
3233 | 91323173 | 91323172 | -418 |
3233 | 91330112 | 91324941 | -143.966 |
本表只想保留91323172和91323173美元的发票。
Customer | Invoice | Reference | Amount |
---|---|---|---|
3233 | 91323172 | 91323172 | 155.418 |
3233 | 91323173 | 91323172 | -418 |
The two others needs to be removed, as they have the same reference and sum is zero.
PS! 我有大约70个客户和4 000个发票,以通过......办理。