Turn a field storing a list into rows?
Hi, is it possible to turn a list stored in a column into rows? For example:
ID COL
1 AA,BB,CC
2 XX,YY,ZZ
Becomes
1 AA
1 BB
1 CC
2 XX
2 YY
2 ZZ
Thanks
Answers
-
Hi James, one solution could be to use the 'extract from list' function - You can import the attached dmxd to see an example of this.
1 -
Hi James
The value 'AA,BB,CC' is a list and there are a load of List Functions that are really powerful and under utilized:
'List count' and 'Extract from list'
To 'create' more rows use a Union step (and for future reference to create more columns use a Splice step).
0 -
Great thanks, I'll have a play with it.
0 -
I get the logic, but not sure how the original ID is kept and assigned to the new rows in my example (note that the list could be anything from 1 to 50 values). The way I am doing it is to concat the ID number to the COL value, after they have been extracted from the list. Then after the union, move the ID out of the COL value into a new ID field.
0 -
Looks like I dent even need to do what I thought for the ID. Just including it in the mapping and union works fine.
0