Skip to content

Commit 784abf2

Browse files
authored
Update ExcelWorksheetsRowOutlines.pq
Additional changes (sort order, columns cleaning, etc.)
1 parent 675b3ec commit 784abf2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

RowsOutline/ExcelWorksheetsRowOutlines.pq

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

182182
in
183-
Sorted
183+
RemovedColumns

0 commit comments

Comments
 (0)