Forum Discussion
create a list from a table
If you have power query, you can try this. Just paste the code in the M edditor.
let
Source = Excel.CurrentWorkbook(){[Name="YourTable"]}[Content],
#"null to cero" = Table.ReplaceValue(Source,null,0,Replacer.ReplaceValue,{"LH", "RH", "J"}),
#"Unpivot columns" = Table.UnpivotOtherColumns(#"null to cero", {"size"}, "Attribute", "Value"),
#"Cero to null" = Table.ReplaceValue(#"Unpivot columns",0,null,Replacer.ReplaceValue,{"Value"}),
#"Combine Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Cero to null", {{"size", type text}, {"Value", type text}}, "en-US"),{"size", "Attribute", "Value"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"List")
in
#"Combine Columns"
- SergeiBaklanFeb 02, 2017Diamond Contributor
Hi,
IMHO, that's not exactly what required. This script generates records like
26 LH 3
instaed of above it shall be 3 records
26 LH
26 LH
26 LH
- Manuel Antonio Mendoza RosasFeb 02, 2017Copper ContributorYou are right, I think I misunderstood the requirement.
Thanks for the clarification!