Skip to content

Commit 675b3ec

Browse files
authored
Update ExcelWorksheetsRowOutlines.pq
Changed join for relation id (was index, correct - by names)
1 parent 74d3b47 commit 675b3ec

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

RowsOutline/ExcelWorksheetsRowOutlines.pq

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ UnZipped = Table.Buffer(fnUnZip(File.Contents(FullPath))),
158158
in
159159
Removed,
160160

161-
// merge relations id (via sheets index)
162-
MergedRelationsID = Table.Join(FilteredByNames, {"Index"}, workbook, {"Attribute:sheetId"}),
161+
// merge relations id (via sheets name)
162+
MergedRelationsID = Table.Join(FilteredByNames, {"Name"}, workbook, {"Attribute:name"}),
163163

164164
// join workbook relations
165165
MergedRelationsTarget = Table.Join(MergedRelationsID,{"Attribute:id"},workbook_rels,{"Attribute:Id"}),
@@ -174,7 +174,10 @@ UnZipped = Table.Buffer(fnUnZip(File.Contents(FullPath))),
174174
AddedRowsOutline = Table.AddColumn(RemovedColumns, "DataWithOutline", each Table.RemoveColumns(Table.Join([RowsOutline], {"Index"}, Table.AddIndexColumn([Data],"Index"), {"Index"}), {"Index"}), type table),
175175

176176
// add outlines to Data or not
177-
Result = if AddOutlinesToData or AddOutlinesToData = null then AddedRowsOutline else RemovedColumns
177+
Result = if AddOutlinesToData or AddOutlinesToData = null then AddedRowsOutline else RemovedColumns,
178+
179+
// sort order
180+
Sorted = Table.Sort(Result,{{"Index", Order.Ascending}})
178181

179182
in
180-
Result
183+
Sorted

0 commit comments

Comments
 (0)