I built a workflow to process a payments report and ran into the following situation. I have the columns: invoice number, amount collected, invoice handover date, invoice payment date, and invoice code.
If I identify a positive payment with the same invoice number, date, and amount that matches a negative payment, the two entries should be deleted (they cancel each other out) — for example: a negative payment of -200 RON and a positive payment of +200 RON sum to zero.
Next: if I identify positive payments with the same date and amount that match negative payments but they do NOT have an invoice number, I will check the columns “Handover Date,” “Payment Date,” and “Invoice Code” to confirm they belong to the same case. If they do, the two payments should be deleted.
1 Like
Hi Larisa, welcome to the forum!
Any chance you could provide a small sample dataset? It would really help us test and validate the logic we’re suggesting.
Best,
Alpay
1 Like
3 Likes
Welcome to KNIME Forum, and tnx for sharing a sample dataset
.
I created this wf detecting_and_deleting.knwf (97.3 KB)
See if it works for you.
Gr. Hans
4 Likes
Here’s an alternative to @HansS solution, although I think his is much better than mine. His solution is flexible to data configuration while mine requires like rows to be within two rows. My workflow works with the data you provided, but will not work if the like rows are more than two rows apart. I posted this just to show that there are usually mulitple solutions to Knime problems.
Invoice Balances.knwf (153.3 KB)
2 Likes


