Skip to content
Advertisement

SQL function to generate new row per event?

I’ve looked for an answer here to no avail; wondering if this problem is best suited outside SQL environment but thought I’d see how it could be solved.

I’m trying to look at web journeys and as a result need my data to be in the following format:

At present the data is in the following format:

I essentially want to break out the event field by comma and create a new row for each comma separated event with all other fields duplicated. My SQL isn’t great, have tried numerous temp tables, unions and split_parts to break out the field to some success but cannot get it into its own row.

Advertisement

Answer

Indeed it works as @GMB suggested.

Only that the function StringTokenizerDelim() is not in the default search path.

You’ll have to qualify it explicitly with the v_txtindex schema in which it resides:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement