Forum Discussion

SaaM's avatar
SaaM
Helper II
5 years ago
Solved

expand multiple columns at once

Hi

Is it possible to expand for all the columns Grouped_1 and Grouped_2 at once (example in picture)?

When trying to do it column by column it is too slow.

(In my final structure i will have 10 grouped columns from grouped_1 to grouped_10)

 

 

As the picture won't show, my Table look like this:

 

ID        Grouped_1 Grouped_2
11020 [Table] [Table]
11020 [Table] [Table]
10013 [Table] [Table]
18375 [Table] [Table]
10066 [Table] [Table]
10075 [Table] [Table]
10159 [Table] [Table]
19944 [Table] [Table]
19944 [Table] [Table]

 

Thanks in advance

kind regards

Saam

  • Anonymous's avatar
    Anonymous
    5 years ago

    potresti provare qualcosa del genere ...

     

    listGrouped=List.Select(Table.ColumnNames(yourab), each ----),
    namesColGroupX=[groupe_1={"c11", ---}, groupe_2={"c21", ---}, ...],
    List.Accumulate(listGrouped, yourtab, (s,c)=>Table.ExpandTableColumn(s,c, Record.Filed(namesColGroupX,c)))

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    potresti provare qualcosa del genere ...

     

    listGrouped=List.Select(Table.ColumnNames(yourab), each ----),
    namesColGroupX=[groupe_1={"c11", ---}, groupe_2={"c21", ---}, ...],
    List.Accumulate(listGrouped, yourtab, (s,c)=>Table.ExpandTableColumn(s,c, Record.Filed(namesColGroupX,c)))