Forum Discussion
Separating Values Into Rows
- 1 year ago
Hi BO7 , here's another solution you could look. Thanks!
Here's the code:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Texts", type text}}),
Number = Table.TransformColumns(#"Changed Type",{}, each List.Count(Text.PositionOf(_,"A",Occurrence.All)) + 1),
ColNumber = List.Max(Number[Texts]),
ColNames = List.Transform({1..ColNumber}, each "Col" & Text.From(_)),
Custom1 = #"Changed Type",
#"Split Column by Delimiter" = Table.SplitColumn(Custom1, "Texts", Splitter.SplitTextByDelimiter("APP", QuoteStyle.Csv), ColNames),
#"Removed Columns" = Table.RemoveColumns(#"Split Column by Delimiter",{"Col1"}),
Custom2 = Table.TransformColumns(#"Removed Columns",{}, each Text.Replace("APP" & _,";","")),
Custom3 = Table.FromList(List.Combine(Table.ToRows(Custom2)))
in
Custom3
Hi BO7 , here's another solution you could look. Thanks!
Here's the code:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Texts", type text}}),
Number = Table.TransformColumns(#"Changed Type",{}, each List.Count(Text.PositionOf(_,"A",Occurrence.All)) + 1),
ColNumber = List.Max(Number[Texts]),
ColNames = List.Transform({1..ColNumber}, each "Col" & Text.From(_)),
Custom1 = #"Changed Type",
#"Split Column by Delimiter" = Table.SplitColumn(Custom1, "Texts", Splitter.SplitTextByDelimiter("APP", QuoteStyle.Csv), ColNames),
#"Removed Columns" = Table.RemoveColumns(#"Split Column by Delimiter",{"Col1"}),
Custom2 = Table.TransformColumns(#"Removed Columns",{}, each Text.Replace("APP" & _,";","")),
Custom3 = Table.FromList(List.Combine(Table.ToRows(Custom2)))
in
Custom3
Thank you! I was pulling my hair out trying to figure this one out.