Selecting specific rows where credit/debit balance does not equal zero

Hi,

I am looking for some assistance related to selecting certain rows from a table where the amounts do not cancel on another out. Any assistance will be appreciated.

Initial Table
purchaseDt	SKU	pruchaseDesc	Item ID	factor	purchaseAmt
2022-06-10	1375068	Item 1	315111	-1	-115.01
2022-06-10	1375068	Item 1	315111	1	115.01
2022-06-14	1375068	Item 1	315111	1	115.01
2022-06-14	1375068	Item 1	315111	1	115.01
2022-06-15	1922340	Item2	808222	1	655.59
2022-06-14	1922340	Item2	808222	1	311.8
2022-06-14	1922076	Item 3	8573333	1	590.35
2022-06-14	1922076	Item 3	8573333	1	590.35
Expected Output
purchaseDt	SKU	pruchaseDesc	Item ID	factor	purchaseAmt
2022-06-14	1375068	Item 1	315111	1	115.01
2022-06-14	1375068	Item 1	315111	1	115.01
2022-06-15	1922340	Item2	808222	1	655.59
2022-06-14	1922340	Item2	808222	1	311.8
2022-06-14	1922076	Item 3	8573333	1	590.35
2022-06-14	1922076	Item 3	8573333	1	590.35

in general you can do it by grouping the data on SKU Or Item ID

When processing the group members we would suggest to check some more requirements e.g. handling when not the exact opposite amount is to handle (when this can happen) like
5,-5,3,-2 → we assume 3,-2
5,-3,-2 → we assume no tows to keep

some you can implement some more specifics e.g finind pairs by mathing the closest opposite amount, or taking oldest first…