> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# analyticsQueryPlan

> Plan an ad hoc analytics answer without saving a report. First look for an existing report with analyticsReports and verify its columns, calculations, filters and dates with analyticsReport. If none answers the question, plan here, then run analyticsQueryRows with the returned planId. Disclose limitations; clarify missing concepts rather than silently substituting. After presenting the answer, offer to save it. On an explicit yes, call analyticsReportCreateFromPlan with this same planId without another planning or confirmation step. For an explicit new report or CSV request, use analyticsReportPlan and the normal report confirmation flow instead. Takes 10 to 30 seconds. Each call runs LLM planning, creates an internal author thread and consumes author quota at a query cost of 500. This operation is not idempotent; do not automatically retry it as an ordinary read.

**Required scopes:** [`analytics_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-analytics_read)

## Arguments

**basePlanId** `ID`

An earlier plan to refine, preserving everything the new question does not change.

**question** `String!` *required*

The question to answer, including requested dates, filters and breakdowns.

## Returns

**analyticsQueryPlan** `[AnalyticsReportPlan!](/docs/api-reference/v3/reference/analytics/analytics-report-plan)` *required*

A validated analytics plan for a report, ad hoc question or edit, without saving a report. Pass `planId` to `analyticsReportCreateFromPlan`, or for an edit to `analyticsReportEditFromPlan`, to save it.

**fields**

**columns** `[\[AnalyticsReportPlanColumn!\]!](/docs/api-reference/v3/reference/analytics/analytics-report-plan-column)` *required*

The planned columns, in order. For a new report request, show them before saving. For an ad hoc answer, present the results and limitations before offering to save.

**fields**

**calculation** `String`

How the column would be calculated, such as `count of distinct returns`. Null for a column read as stored.

**description** `String`

What the column means.

**label** `String!` *required*

The column's header.

**explanation** `String!` *required*

What the report would show, or why it can't be made.

**limitations** `[String!]!` *required*

Ways the report would differ from what was asked.

**missingConcepts** `[String!]!` *required*

What Redo's analytics has no data for.

**planId** `ID`

The plan to save. Null when the report is UNAVAILABLE.

**status** `[AnalyticsReportPlanStatus!](/docs/api-reference/v3/reference/analytics/analytics-report-plan-status)` *required*

Whether the report can be made as asked.

**title** `String`

The title the report would have.

## Example

```graphql theme={null}
query {
  analyticsQueryPlan(basePlanId: "...", question: "...") {
    explanation
    limitations
    missingConcepts
    planId
    status
    title
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.