{"record":{"id":"a314453c82891991","repo":"cube-js/cube","slug":"comparedaterange-drilldown-query-is-not-currently","errorCode":null,"errorMessage":"compareDateRange drillDown query is not currently supported","messagePattern":"compareDateRange drillDown query is not currently supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-client-core/src/ResultSet.ts","lineNumber":202,"sourceCode":"   * // An example for React\n   * const drillDownResponse = useCubeQuery(\n   *    {\n   *      ...drillDownQuery,\n   *      limit: 30,\n   *      order: {\n   *        'Orders.ts': 'desc'\n   *      }\n   *    },\n   *    {\n   *      skip: !drillDownQuery\n   *    }\n   *  );\n   * ```\n   * @returns Drill down query\n   */\n  public drillDown(drillDownLocator: DrillDownLocator, pivotConfig?: PivotConfig): Query | null {\n    if (this.queryType === QUERY_TYPE.COMPARE_DATE_RANGE_QUERY) {\n      throw new Error('compareDateRange drillDown query is not currently supported');\n    }\n    if (this.queryType === QUERY_TYPE.BLENDING_QUERY) {\n      throw new Error('Data blending drillDown query is not currently supported');\n    }\n\n    const { query } = this.loadResponses[0];\n    const xValues = drillDownLocator?.xValues ?? [];\n    const yValues = drillDownLocator?.yValues ?? [];\n    const normalizedPivotConfig = this.normalizePivotConfig(pivotConfig);\n\n    const values: string[][] = [];\n    normalizedPivotConfig?.x.forEach((member, currentIndex) => values.push([member, xValues[currentIndex]]));\n    normalizedPivotConfig?.y.forEach((member, currentIndex) => values.push([member, yValues[currentIndex]]));\n\n    const { filters: parentFilters = [], segments = [] } = this.query();\n    const { measures, timeDimensions: timeDimensionsAnnotation } = this.loadResponses[0].annotation;\n    let [, measureName] = values.find(([member]) => member === 'measures') || [];\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-client-core/src/ResultSet.ts#L184-L220","documentation":"ResultSet.drillDown() builds the underlying detail query for a clicked cell, but drill-down for compareDateRange queries (multiple date ranges compared in one query) has no single unambiguous source query, so the method explicitly refuses and throws. This is a deliberate 'not implemented' guard, not a runtime failure of your data or config.","triggerScenarios":"Calling resultSet.drillDown(locator, pivotConfig) on a ResultSet whose queryType is 'compareDateRange' (returned by the server for a multi-range timeDimension comparison), e.g. the user clicks a chart cell in a period-over-period comparison wired to drillDown.","commonSituations":"Dashboard libraries that attach drill-down handlers generically to every ResultSet; an app that recently switched a chart from a single date range to compareDateRange without removing the drillDown handler.","solutions":["Disable/omit the drillDown handler for charts whose query uses compareDateRange.","Restructure the comparison as two separate regular queries (one per date range) so drillDown works on each ResultSet.","Implement the drill-down query manually: derive measure/dimension members from the pivot and apply the specific date-range filter yourself.","Track Cube client releases for compareDateRange drillDown support before relying on it."],"exampleFix":"// before\nonClick={() => {\n  const q = resultSet.drillDown({ xValues, yValues }); // throws for compareDateRange\n  if (q) runDrill(q);\n}}\n\n// after\nonClick={() => {\n  if (resultSet.queryType === 'compareDateRange') return; // skip drill-down\n  const q = resultSet.drillDown({ xValues, yValues });\n  if (q) runDrill(q);\n}}","handlingStrategy":"validation","validationCode":"function canDrillDown(resultSet) {\n  const unsupported = ['compareDateRange', 'blending'];\n  return resultSet && !unsupported.includes(resultSet.queryType);\n}\n\n// usage\nonClick={() => { if (canDrillDown(resultSet)) { const q = resultSet.drillDown(loc); } }}","typeGuard":"function isDrillable(rs: ResultSet): boolean {\n  return rs.queryType !== 'compareDateRange' && rs.queryType !== 'blending';\n}","tryCatchPattern":"let drillQuery = null;\ntry {\n  drillQuery = resultSet.drillDown({ xValues, yValues }, pivotConfig);\n} catch (e) {\n  if (/drillDown query is not currently supported/.test(e.message)) {\n    drillQuery = null; // hide drill-down UI for unsupported query types\n  } else { throw e; }\n}","preventionTips":["Gate drill-down UI (cell click handlers) on resultSet.queryType === 'regular'.","Wrap drillDown calls in a shared helper that returns null for unsupported query types.","Prefer two separate regular queries over compareDateRange when drill-down is required.","For blended charts, attach drill-down to the underlying per-query ResultSets instead.","Re-check client changelogs for drill-down support of compareDateRange/blending."],"tags":["drill-down","unsupported-feature","compare-date-range"],"backgroundTag":"drilldown-unsupported-query-type","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}