Forum Discussion
Extracting and Flattening an embedded table within a data set
- 1 year ago
NewStep=#table(Table.ColumnNames(YourTableName),List.TransformMany(Table.ToRows(YourTableName),each List.Zip(List.Transform(List.Skip(_,2),each Text.Split(_,","))),(x,y)=>List.FirstN(x,2)&y))
- 1 year ago
Thanks CaptOdyssey
It is now more sensible now,
please use the below code which Source is related to the table you presented here.
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Merged Columns" = Table.CombineColumns(Source,{"RateDifferentialPercentages", "RateDiffEffectiveDTs"},each List.Zip(List.Transform(_, (x)=> Text.Split(x,","))),"Merged"), #"Expanded Merged" = Table.ExpandListColumn(#"Merged Columns", "Merged"), Custom1 = Table.SplitColumn(#"Expanded Merged","Merged", each _) in Custom1If you have any question, just ask me
- 1 year ago
Hello and thank you for your proposed solution. Unfortunately, I cannot figure out how to apply your suggestion. How would I add your suggested new step to the code below?
let
Source = Table.Combine({RateDifferentials2}),
#"Filtered Rows" = Table.SelectRows(Source, each [StdRateDiffEffectiveDTs] <> null and [StdRateDiffEffectiveDTs] <> ""),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"StdRateDiffEffectiveDTs", type text}}),
NewStep=#table(Table.ColumnNames(YourTableName),List.TransformMany(Table.ToRows(YourTableName),each List.Zip(List.Transform(List.Skip(_,2),each Text.Split(_,","))),(x,y)=>List.FirstN(x,2)&y))
Hello and thank you for your proposed solution. Unfortunately, I cannot figure out how to apply your suggestion. How would I add your suggested new step to the code below?
let
Source = Table.Combine({RateDifferentials2}),
#"Filtered Rows" = Table.SelectRows(Source, each [StdRateDiffEffectiveDTs] <> null and [StdRateDiffEffectiveDTs] <> ""),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"StdRateDiffEffectiveDTs", type text}}),
- wdx223_Daniel1 year agoCommunity Champion
let
Source = Table.Combine({RateDifferentials2}),
#"Filtered Rows" = Table.SelectRows(Source, each [StdRateDiffEffectiveDTs] <> null and [StdRateDiffEffectiveDTs] <> ""),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"StdRateDiffEffectiveDTs", type text}}),NewStep=#table(Table.ColumnNames(#"Changed Type"),List.TransformMany(Table.ToRows(#"Changed Type"),each List.Zip(List.Transform(List.Skip(_,2),each Text.Split(_,","))),(x,y)=>List.FirstN(x,2)&y))
in
NewStep