Forum Discussion

mariopavic's avatar
mariopavic
Frequent Visitor
6 years ago
Solved

Dynamic column expand

Hi all,   I want to expand records column dinamically. Here is the code:     toExpand = Table.ExpandRecordColumn(#"Table to expand", "newColumn name", ListOfNamesToExpand) // ListOfRecords cont...
  • mariopavic's avatar
    6 years ago

    I didn't compare old vs new code but new one is way faster:

    convertToList= Record.FieldNames(Record.Combine(List.Select(Table.Column(#"Removed Other Columns","newColumnName"), each _ <> "" and _ <> null))), 
    ListOfNamesToExpand = Table.ExpandRecordColumn( #"Removed Other Columns","newColumnName", convertToList),

    The problem was in creating the actual list.