@@ -167,17 +167,17 @@ UnZipped = Table.Buffer(fnUnZip(File.Contents(FullPath))),
167167// invoke RowsOutline function to get separate index+outlineLevel table
168168 AddOutlineTable = Table.AddColumn(MergedRelationsTarget, "RowsOutline", each fnRowsOutline([#"Attribute:Target"]), type table),
169169
170- // Clean table
171- RemovedColumns = Table.RemoveColumns(AddOutlineTable,{"Index", "Attribute:Id", "Attribute:Target", "Attribute:name", "Attribute:sheetId", "Attribute:id"}),
172-
173170// join [AddOutlineTable] and [Data] by rows index
174- AddedRowsOutline = Table.AddColumn(RemovedColumns , "DataWithOutline", each Table.RemoveColumns(Table.Join([RowsOutline], {"Index"}, Table.AddIndexColumn([Data],"Index"), {"Index"}), {"Index"}), type table),
171+ AddedRowsOutline = Table.AddColumn(AddOutlineTable , "DataWithOutline", each Table.RemoveColumns(Table.Join([RowsOutline], {"Index"}, Table.AddIndexColumn([Data],"Index"), {"Index"}), {"Index"}), type table),
175172
176173// add outlines to Data or not
177- Result = if AddOutlinesToData or AddOutlinesToData = null then AddedRowsOutline else RemovedColumns ,
174+ Result = if AddOutlinesToData or AddOutlinesToData = null then AddedRowsOutline else AddOutlineTable ,
178175
179176// sort order
180- Sorted = Table.Sort(Result,{{"Index", Order.Ascending}})
177+ Sorted = Table.Sort(Result,{{"Index", Order.Ascending}}),
178+
179+ // Clean table
180+ RemovedColumns = Table.RemoveColumns(Sorted, {"Index", "Attribute:Id", "Attribute:Target", "Attribute:name", "Attribute:sheetId", "Attribute:id"})
181181
182182in
183- Sorted
183+ RemovedColumns
0 commit comments