Concatenate list of column names and fill up

programsam

Board Regular
Joined
Feb 10, 2016
Messages
123
Greetings,

Have the following M code where I'm changing 0 values to null (thanks to another user for the help) but am now wanting to fill up because every row has inconsistent data and I want all of the data to be on the top two rows.

I'm now attempting to create a list of column names and stuff it in to Table.FillUp but am getting an expression error that lists the columns and the syntax ("ColumnXXX",) syntax but reads that the columns "of the table" weren't found.

Code below.

Excel Formula:
    Custom1 = Table.ColumnNames(#"Transposed Table2"),
    Custom2 = List.Transform(Custom1, each {_, each if _ = 0 then null else _}),
    Custom3 = Table.TransformColumns(#"Transposed Table2",Custom2),
    Custom4 = """"&Text.Combine(Table.ColumnNames(Custom3),""", """)&"""",
    Custom5 = Table.FillUp(Custom3,{Custom4})
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Greetings,

Have the following M code where I'm changing 0 values to null (thanks to another user for the help) but am now wanting to fill up because every row has inconsistent data and I want all of the data to be on the top two rows.

I'm now attempting to create a list of column names and stuff it in to Table.FillUp but am getting an expression error that lists the columns and the syntax ("ColumnXXX",) syntax but reads that the columns "of the table" weren't found.

Code below.

Excel Formula:
    Custom1 = Table.ColumnNames(#"Transposed Table2"),
    Custom2 = List.Transform(Custom1, each {_, each if _ = 0 then null else _}),
    Custom3 = Table.TransformColumns(#"Transposed Table2",Custom2),
    Custom4 = """"&Text.Combine(Table.ColumnNames(Custom3),""", """)&"""",
    Custom5 = Table.FillUp(Custom3,{Custom4})
Did not need to fill up after all, a better (and simpler) solution was to delete null values and shift the values up. Code below.

Excel Formula:
    Custom1 = Table.ColumnNames(#"Transposed Table2"),
    Custom2 = List.Transform(Custom1, each {_, each if _ = 0 then null else _}),
    Custom3 = Table.TransformColumns(#"Transposed Table2",Custom2),
    #"Added Custom" = Table.FromColumns(List.Transform(Table.ToColumns(Custom3), List.RemoveNulls),Table.ColumnNames(Custom3))
 
Upvote 0

Forum statistics

Threads
1,215,136
Messages
6,123,247
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top