Good Morning Everyone,
New to BigQuery and am stumbling over something that I find quite intuitive in other BI languages I have used in the past, namely transposing keys and values so that the key becomes the column name and the value becomes the value associated with the column.
I have looked at a number of examples online and when I work through them I am presented with a multitude of various errors that I am unable to resolve, because I simply don't have enough experience.
For those inevitably questioning why I may want to do this, it is a business requirement that I am obliged to fulfill, however if you have any thoughts on better ways to approach this, I am more than happy to take this advice and appreciate it.
**The Json:**
[
{
"resultsMap": {
"map": {
"item": [
{
"value": "2021-03-02-12.16.28.012279",
"key": "TIMESTAMP"
},
{
"value": "1",
"key": "CONTROL_KEY"
},
{
"value": "123465789",
"key": "LOGGING_KEY"
}
],
"key": "5049"
}
}
}
]
What I have
| resultsMap.map.key | resultsMap.map.item.value | resultsMap.map.item.key |
|---|---|---|
| 5049 | TIMESTAMP | 2021-03-02-12.16.28.012279 |
| CONTROL_KEY | 1 | |
| LOGGING_KEY | 123456789 |
What I want
| resultsMap.map.key | TIMESTAMP | CONTROL_KEY | LOGGING_KEY |
|---|---|---|---|
| 5049 | 2021-03-02-12.16.28.012279 | 1 | 123456789 |
Thank you very much in advance for your help.
Regards, Scott

