Hi
I hope the following make sense.
I hope the following makes sense. So I want to sum all the possible combinations the amount below, Per id then type.
| id | Type | Amount |
| 1 | a | 10 |
| 1 | b | 20 |
| 1 | c | 30 |
| 1 | d | 40 |
| 2 | a | 30 |
| 2 | b | 10 |
| 2 | c | 50 |
| 2 | d | 70 |
So something like:-
| id | Combo | Sum amount Amount |
| 1 | a+b+c+d | 100 |
| 1 | a+b+c | 60 |
| 1 | a+b | 30 |
| 1 | a | 10 |
| 1 | a+d | 50 |
| 1 | b+c | 50 |
An so on...
Then if the below matches with in 1 either way then return the combo’s that match