I have multiple transactions from salary and I have to figure out the pair which is sum is not equal to zero
From the example below: Salary Id;123 => 7000+(-7000) = zero-> Eliminate
Salary Id 123 => 14200 + 10800 = 25000 (which is equal to salary amount) -> Keep it
Same goes for Salary Id 789 => 789 => -2500 + (-2500 )= -5000 (which is equal to salary amount) -> keep it
salary_Id | Transaction | salary |
123 | 7000 | 25000 |
123 | -7000 | 25000 |
123 | 14200 | 25000 |
123 | 10800 | 25000 |
123 | -8000 | 25000 |
123 | 8000 | 25000 |
456 | 3800 | 8800 |
456 | 5000 | 8800 |
789 | -2500 | -5000 |
789 | -2500 | -5000 |
Output:
salary_id | Transaction | salary |
123 | 14200 | 25000 |
123 | 10800 | 25000 |
456 | 3800 | 8800 |
456 | 5000 | 8800 |
789 | -2500 | -5000 |
789 | -2500 | -5000 |
Solved! Go to Solution.
Hi @Sshasnk I mocked up a workflow let me know what you think?
If there are three transactions it is failing for example below, I just want to eliminate whose sum is coming as zero
salary_Id | Transaction | salary |
123 | 7000 | 25000 |
123 | -7000 | 25000 |
123 | 14200 | 25000 |
123 | 2000 | 25000 |
123 | 8800 | 25000 |
123 | -8000 | 25000 |
123 | 8000 | 2500 |
Note: Added 2000 in the transaction
Hi @Sshasnk I amended the workflow and came up with two other possible ways to tackle you problem. Let me know what you think?