You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/query-builder/analyzer.ts
+12-5Lines changed: 12 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,14 @@ export function analyzeQueryHierarchy(
186
186
...queriesForHierarchy.restDimensions,
187
187
...analysis.metrics,
188
188
],
189
-
// Repeat the last query because we will add all the rest dimensions to it
189
+
originalQuery: {
190
+
...analysis.query,
191
+
},
192
+
totalsQuery: {
193
+
...analysis.query,
194
+
members: [...analysis.metrics],
195
+
},
196
+
// Repeat the last query because we will add all the rest dimensions to it (this will be the "expanded" level)
190
197
queriesInfo: [
191
198
...queriesForHierarchy.queriesInfo,
192
199
queriesForHierarchy.queriesInfo[
@@ -200,6 +207,9 @@ export function analyzeQueryHierarchy(
200
207
})),
201
208
...(analysis.query.order??[]),
202
209
];
210
+
// We check for the length instead of length - 1 because we've duplicated the last query to add all the rest dimensions so the length of the array we're iterating over is one element longer thant the queriesForHierarchy.queriesInfo.length
@@ -215,10 +225,7 @@ export function analyzeQueryHierarchy(
215
225
...queryInfo.formatDimensions,
216
226
...queryInfo.prevLevelsExtraDimensions,
217
227
...queryInfo.extraDimensions,
218
-
// We check for the length instead of length - 1 because we've duplicated the last query to add all the rest dimensions so the length of the array we're iterating over is one element longer thant the queriesForHierarchy.queriesInfo.length
0 commit comments