Add new row for multiple delimited values in a cell

jmg80525

New member
Joined
Feb 26, 2016
Messages
4
Reaction score
0
Points
0
Greetings:

I swear I've seen an example of this before, but can't find. I have a table I've loaded into Power Query. One column has a set of values delimited by a comma. I realize I can split the values into new columns, but how do I then instantiate a new row, populate the delimited value into it's original column and then copy all other values into their respective columns from the source row? Thanks in advanced.

jg
 
Do you have an example of what you want it to look like before and after? A workbook or even typed out table would help.
 
Hi jg,
Did you want something like this?

Code:
let
    Source = #table(
      type table [
        #"List" = text,
        #"Name" = text,
        #"ID" = Int64.Type
      ],
      {
        {"apples,oranges", "Abel",13},
        {"snails,lettuce,pork","Margot",12}
      }
    ),
    SplitList = Table.TransformColumns(Source,{{"List", Splitter.SplitTextByDelimiter(",")}}),
    ExpandedList = Table.ExpandListColumn(SplitList, "List"),
    ChangedType = Table.TransformColumnTypes(ExpandedList,{{"List", type text}})
in
    ChangedType
 
That works. Thanks. I had forgotten about the List type.
 
Back
Top