How to parse delimited messages in a snowflake table and create a columns for each distinct value?

Viewed 28

If I have a table with the following structure:each row represents 1 transaction

enter image description here

and within each Message row I have a similar message to the following:

enter image description here

I want to parse through the message and for the values contained within the "," delimiter I want to create a new table with that data placed in it. Something like this:

enter image description here

The key is that each transaction can have different number of possible column headers so txn 1 can have V22200, V22210 AND Txn 2 can have V22200,V22210, AND V22220 so for each txn I want to place the correct substring value in the correct column.

The ask is to do this in snowflake! I have no idea how to do this pls help!!

Thanks!

0 Answers
Related