Create List off of REPT function
I am looking to create a new row based on a product being purchased 3 times in a transaction. So current record has product code with a quantity of 3 but I need each quantity on its own line/record. I feel like if I can get the REPT converted to list format then I could use the EXPAND function to accomplish the 3 individual rows/records.
Any ideas how to get REPT string results into a list?
example: REPT string result = 243074622430746224307462
desired result = [24307462,24307462,24307462]
-
Is the product code always 8 digits long? I'm just looking to determine an easy pattern to be able to split the text.
One consideration I have is to append a unique character to the end of the product code (i.e. a space character) so the text after the REPT function would be "24307462 24307462 24307642 ". With this output, you could use the TOKENIZELIST function to separate the string into a list based on the space character separators.
Does this meet your needs?
Please sign in to leave a comment.
Comments
4 comments