(Classic) Transform Key value pairs into separate columns
Hi,
I have a question regarding changing typical JSON key-value pairs into DB columns.
Here's the data schema I'm currently trying to transform:
user channel optstatus
| 1 | true | |
| 1 | SMS | false |
| 2 | true | |
| 2 | SMS | true |
| 3 | false | |
| 3 | SMS | true |
I want to take the value pairs from "channel" and "optstatus" and create a new column in the data schema that would be fed with its values, something like this:
user channel optstatus Email SMS
| 1 | true | true | false | |
| 1 | SMS | false | true | false |
| 2 | true | true | true | |
| 2 | SMS | true | true | true |
| 3 | false | false | true | |
| 3 | SMS | true | false | true |
Or to simplify something like that would be also good:
user Email SMS
| 1 | true | false |
| 2 | true | true |
| 3 | false | true |
I don't wanna change the already-existing structure of the data schema apart from adding new columns. Would I do it in a workflow, query and enrichment, or do some SQL filtering? I would really appreciate your help. Cheers!



