Forum Discussion
Remove blank columns from all tables before combining the tables
- 1 year ago
It might be beacuse of the data type or the previous step you are refrencing try this please
Table.TransformColumns(
#"previous step",
{"Custom", each Table.RemoveColumns(
_,
List.Select(
Table.ColumnNames(_),
(x) => List.AllTrue(List.Transform(Table.Column(_, x), (y) => y = "" or y = null))
)
)}
)
It might be beacuse of the data type or the previous step you are refrencing try this please
Table.TransformColumns(
#"previous step",
{"Custom", each Table.RemoveColumns(
_,
List.Select(
Table.ColumnNames(_),
(x) => List.AllTrue(List.Transform(Table.Column(_, x), (y) => y = "" or y = null))
)
)}
)
Thanks a lot. That worked in removing the blank columns. However, now all the sheets have different column names (although data is in correct order). And when I use Table.combine to combine the sheets, it is combining by column names.
Is there a way to ignore the column names while using Table.combine?
Thanks
- Akash_Varuna1 year ago
Super User
Hi Here4Help , Try These please
Use Table.ToRows to convert each table into a list of rows, ignoring column names.
Use List.Combine to merge all rows into a single list.
Convert the combined list back into a table with Table.FromRows.
Rename columns using Table.RenameColumns to assign consistent names.
If the post helped please do give a kudos and accept the above as a solution- Here4Help1 year agoFrequent Visitor
Thanks, I demoted the headers and then combined the files. Thanks a lot for your help.