This is the data that I am currently working with.
x | y | a |
---|---|---|
3 | 2 | LL |
5 | 2 | LL |
5 | 4 | LL |
3 | 4 | LL |
6 | 7 | RR |
8 | 7 | RR |
8 | 9 | RR |
6 | 9 | RR |
I am trying to pivot the table such that it becomes:
x1 | x2 | y1 | y2 | a |
---|---|---|---|---|
3 | 5 | 2 | 4 | LL |
6 | 8 | 7 | 9 | RR |
I've tried AGG and the PIVOT functions, but can't seem to get this to work, and this has to be done using onky Google BQ. The complete dataset is much larger, so I need a general solution. Any help or suggestions would be appreciated. Thanks!