Forum Discussion
Concatenate Dynamic COlumn
- 6 years ago
= Table.AddColumn(Source, "Key2", each Text.Combine( List.Transform(Level_List, (col) => Record.Field(_, col)), "__") )
sorry. I completely misunderstood the problem.
What about this:
Table.CombineColumns(Source, List_Level, each Text.Combine( _ , "__"), "key2")
?
Anonymous , yes I tried this before. But this replace the "Level " columns with the newly combined "key2" column, while I still need the "Level " columns so I can use them as Hierarchies in my visuals.
Otherwise, the "key2" columns is what I am looking for.
- Anonymous6 years agoNot applicable
nelsonwhyu I was just giving an hint to to overcome the main problem
If you need complete solution, probably is like this:
newKey=Table.CombineColumns(Source, level_list, each Text.Combine(_, "__"), "keytwo"),
#"Merge di query eseguito" = Table.NestedJoin(SourceI ,{"Indice"},newKey,{"Indice"},"newKey",JoinKind.LeftOuter),
#"Tabella newKey espansa1" = Table.ExpandTableColumn(#"Merge di query eseguito", "newKey", {"keytwo"}, {"keytwo"}),
#"Rimosse colonne1" = Table.RemoveColumns(#"Tabella newKey espansa1",{"Indice"})
in
#"Rimosse colonne1"- Anonymous6 years agoNot applicable
Another way to get what you want is to do in the reverse sense what done: 😁
#"Duplicata colonna" = Table.DuplicateColumn(newKey,"keytwo", "keytwo - Copia"),
#"Suddividi colonna in base al delimitatore" = Table.SplitColumn(#"Duplicata colonna", "keytwo - Copia", Splitter.SplitTextByDelimiter("_", QuoteStyle.Csv), level_list)
in
#"Suddividi colonna in base al delimitatore"