Hi everyone I have a weird question. I have a dataset that looks like this
| id | amount |
| 101 | 7 |
| 101 | -3 |
| 101 | -4 |
| 101 | 8 |
| 101 | -4 |
| 101 | -4 |
How do I group so that amounts 7, -3, -4 are the same group #? The Logic is that 7 + -3 + -4 = 0 so I want to group them together. Similarly 8 + -4 + -4 = 0.
For example I want
| id | amount | group # |
| 101 | 7 | 1 |
| 101 | -3 | 1 |
| 101 | -4 | 1 |
| 101 | 8 | 2 |
| 101 | -4 | 2 |
| 101 | -4 | 2 |
I tried using summarize but I cant just sum by ID number because most of them have more than one group per ID. The original data set has Date column which really doesn't follow a pattern, and description which again has just an explanation and is sometimes unique to each transaction.