Trying to figure out the best way to approach this. For the sake of simplicity, I'm going to make up some unreasonable situation for an example; I am a merchant with some crap data and I don't know the number of items people bought, so I have to back into it
- I have three products, and three distinct prices that customers bought at ($250, $350, $500)
- I have the total amount the customer paid (taxes / refunds etc not relevant for this example)
So if I know a customer paid $600 - it's likely they got one product at $250 and one product at $350. If a customer paid $1,000 then they either bought 2 products for $500, or 4 products for $250 or 3 products at $250*2 and $500 (thank you @dennis).
What I would like is something like:
customer_id | total_amount_paid | assumed_number_of_products | assumed_prices |
---|---|---|---|
1241 | 1000 | 4 | 250, 250, 250, 250 |
1241 | 1000 | 2 | 500, 500 |
1241 | 1000 | 3 | 250, 250, 500 |
0912 | 600 | 2 | 250, 350 |
Any recommendations would help. Really stuck trying to approach this without overthinking it.