I am trying to create a pivot sort of thing for a group of customer ids (cids).The dataset is of the form
| Cid | Match |
|---|---|
| A | 1 |
| A | 2 |
| B | 2 |
| B | 3 |
| B | 4 |
The transformed dataset should look like
| Cid | Match_1 | Match_2 | Match_3 |
|---|---|---|---|
| A | 1 | 1 | null |
| B | 2 | 3 | 4 |
Here the Match_n suffix is dynamic and should be decided based on the max rows present across all Cids. I am not sure if this is even feasible.
I have tried pivot and other things but eventually hit a wall.
Found this but this is for a specific range of i (Big Query Transpose).
P.S: I just thought of something! Maybe that works. But still currently need help.
