Guides

Edit an analysis in a notebook

Inspect the cells behind an answer, change a calculation, and check dependent results.

Here, you will change a unit price from 6 to 8 and check that the total and chart update from 42 to 56. The example needs no datasource.

Before you start

  • Open an Explore you can edit. If you are new to the app, start with Get started in the app.
  • For this practice calculation, use an empty notebook or work where unit_price and order_total are not already defined. Use separate work if you need to preserve the original analysis.
  • For SQL, you also need a configured datasource and query access. Editing an Explore does not grant database access; see Datasources and credentials.

1. Open the notebook for editing

From the Explore's View, select Edit, then Notebook. View lets you run existing cells, but editing their source requires Edit. For separate editable work from a View follow-up, use Explore from a board.

On an existing analysis, use Expand code to read the source behind a result. Check its inputs and dependent cells before changing it. A displayed result may come from an earlier run.

If controls are hidden, select Show side panel, open Settings, and enable Add cell row and Cell actions. Cell names and Last run time can help you identify cells and check execution. These settings do not grant edit access.

If you see Already open for editing or Automation using this explore, use Back to view. Finish your other editor or wait for the automation before trying again.

2. Inspect and change a calculation

In an empty notebook, choose Add Python cell. In a notebook with other work, hover beneath a cell to reveal the add row. Enter the price in its own cell:

unit_price = 6

Select Run cell. Add a second Python cell and run it:

order_total = unit_price * 7
order_total

The last expression displays 42. The first cell owns the price; the second depends on it. If either cell reports an error, resolve that before continuing.

Add a third Python cell for a chart, then run it:

import altair as alt

alt.Chart(
    alt.Data(values=[{"label": "Order total", "usd": order_total}])
).mark_bar().encode(x="label:N", y="usd:Q")

Check that the chart represents 42. Now return to the first cell, read its current source, and replace it with:

unit_price = 8

Run the price cell. Check that the total cell still contains order_total = unit_price * 7, its new output is 56, and the chart now represents 56. Check the affected cells for errors and compare their source, output, and recorded run times. Typing alone does not run or save a change, and an earlier output is not proof of a new calculation.

Dependencies determine what runs, regardless of the cells' visual order. Run all cells submits every cell, including any database queries, so use it deliberately. See How analysis works for the dependency model.

If the result stays at 42

Inspect the price cell's source, execution errors, and disabled ancestors. A disabled upstream cell can leave older dependent values and outputs visible. In Code Mode, even succeeded=true can have no executed cell IDs: inspect run_cell_ids and the affected cells. An idle status alone does not prove that this edit ran. See status and error rules.

3. Check the saved edit

Notebook changes and execution results save through the editing session. Wait for execution to finish and resolve any saving or connection error before leaving. This does not promise that every unrun keystroke was saved.

Give the Explore a recognizable title. Leave and reopen it from Explores or its saved URL, then select Edit and Notebook. Confirm that the price source is unit_price = 8 and the total source is unchanged.

Stored output can reappear without a new run. Rerun when you need a new computation, then inspect its execution and result. For company data, also check the data's freshness and query behavior; see Verify an answer.

4. Add explanation, SQL, or inputs

Use a Markdown cell to explain what a result means. Select Add markdown cell, enter the following in its Markdown editor, run it, and check the rendered text:

## Example order
Seven units at the current unit price. Check the calculated total.

Markdown and SQL editors show the body of a Python helper call; their surrounding source is visible when you inspect the code.

To addWhat to check
Add SQL cellEdit the query body. Check the selected datasource, table, filters, and returned rows. The SQL helper returns a dataframe and displays it by default.
Add input cellChoose a control such as Dropdown, Number input, or Slider. Put calculations that read its value in a separate cell. Add filters to a board so teammates can explore the results themselves.

Nonempty cell templates can execute when added. Inspect their source and result before relying on them. Use your actual datasource and schema for SQL; the price example needs neither. See Notebooks for helper syntax and input controls.

5. Present the result as a board

Once the title, total, and chart are checked, choose those notebook cells for a board. The board uses the same cells and should show 56 in both the total and chart. The board guide covers placement, preview, and sharing.

Choose a chart for other analyses

After checking the calculation, choose a chart for the comparison you need. Specify the metric and aggregation, grouping, date range and time grain, units, and sort order. For example: "Show monthly paid revenue in USD for this year, split by region, excluding refunds."

TaskChart to requestWhat to check
Rank or compare categoriesBarThe aggregation and category order, such as revenue sorted descending.
Compare periods or groups within each categoryGrouped barThe same metric and units for each group; separate bars rather than an accidental stack.
Follow a metric over timeLineThe time grain, chronological order and missing periods.
Compare two numeric measures or find outliersScatter or bubbleBoth axes' units and, for bubbles, what size and color represent.
Compare composition over timeStacked areaCategory totals, stack order and whether values are amounts or normalized shares.
Compare two categorical dimensionsHeatmapRow/column categories, aggregation and the color scale's units.
Compare a measure with a target or another related markLayered chartCompatible units and legible marks; explain any independent scales.
Compare the same pattern across groupsFaceted chartThe same metric and comparable scales in every panel.
Show a simple part-to-whole snapshotDonut or pieNonnegative values, a defined whole and categories that do not overlap.
Inspect a numeric distributionHistogramBin boundaries and width; counts rather than an accidental sum of the values.

Keep one focused chart per cell. Request a combined view explicitly when you need layers or facets; two independent charts can stay in separate cells. Run the result and inspect every mark or panel in the actual notebook and board. A chart specification that validates does not establish that its layout, labels or interactions work in the app.

Style and check the chart

For a separate practice Explore, add a Python cell with this synthetic grouped comparison. It calculates revenue per order from each row and adds formatted tooltips and explicit category colors:

import altair as alt

comparison_rows = alt.Data(values=[
    {"region": "East", "period": "Previous", "revenue": 80, "orders": 8},
    {"region": "East", "period": "Current", "revenue": 120, "orders": 10},
    {"region": "West", "period": "Previous", "revenue": 100, "orders": 5},
    {"region": "West", "period": "Current", "revenue": 90, "orders": 5},
])

alt.Chart(comparison_rows).transform_calculate(
    revenue_per_order="datum.orders > 0 ? datum.revenue / datum.orders : null"
).mark_bar().encode(
    x=alt.X("region:N", title="Region"),
    xOffset=alt.XOffset("period:N", sort=["Previous", "Current"]),
    y=alt.Y("revenue_per_order:Q", title="Revenue per order (USD)"),
    color=alt.Color("period:N", scale=alt.Scale(
        domain=["Previous", "Current"], range=["#64748b", "#2563eb"]
    )),
    tooltip=[
        alt.Tooltip("region:N", title="Region"),
        alt.Tooltip("period:N", title="Period"),
        alt.Tooltip("revenue:Q", title="Revenue", format="$,.0f"),
        alt.Tooltip("orders:Q", title="Orders", format=",.0f"),
        alt.Tooltip("revenue_per_order:Q", title="Revenue per order", format="$,.2f"),
    ],
).properties(title="Synthetic revenue per order")

Expect East to change from 10 to 12 USD per order, and West from 20 to 18. Check four bars, the period legend, axis units and each tooltip against the source rows. This example needs no database query. Its calculation is a ratio per input row; aggregating real rows to a different grain can change the metric.

  • Tooltips: choose the fields, titles and numeric/date formats needed to explain a mark. Check the actual hover result, not just its code.
  • Colors: use an explicit color encoding, such as color=alt.value("#2563eb") for a fixed color or alt.condition(...) for a threshold. Mark-level colors can be overridden by the Querio theme. Keep labels or tooltips so meaning does not depend on color alone, and inspect the result in the current theme.
  • Labels and annotations: prefer tooltips for detail. If you explicitly need a combined chart with text labels or a target rule, check their values, units, placement and overlap. Labels do not verify the underlying metric.
  • Calculated fields: name the denominator, filters and grouping for a ratio; specify ordering for a rank or running total. A chart transform does not refresh its upstream query. Compare transformed values with an independent calculation before using them.

Current formatting can fail for an inline-data chart that maps a field to color but omits tooltips, even when Altair validates it. If this occurs, stop and report the error to Querio.

If the chart is blank, reports an error or differs from the expected values, inspect the cell's source, inputs and execution before changing its styling. Recheck the displayed result after each change; see Verify an answer and Notebooks for the shared output and execution boundaries.

To find or refer to an offered notebook cell, use cell mentions and Tag in chat.

To mark a reusable result, bookmark its cell.

If an edit fails

ProblemNext action
Duplicate variable definitionFind the cell that already owns the name and edit it, or choose a new descriptive name for independent work.
Syntax error or failed upstream cellFix that source, run it, then check dependent cells and their new outputs.
A disabled ancestor leaves old resultsInspect the ancestor's configuration and why it is disabled before deciding what should run. Do not reuse the old result as current.
SQL access denied or credentials conflictReview datasource access and credential assignment. Changing the notebook does not grant access.
Connection loss, timeout or interruptionInspect existing source and outputs before retrying. Completed writes or other effects may remain.
Saving fails after executionKeep the session open and resolve saving. Do not recreate cells or replay authoring code to retry a save.

An execution failure does not guarantee rollback of the edit or its effects. Execution and sessions covers the lifecycle and saving boundaries.

After verifying the calculation, present its results as a board or share the Explore.

Was this page helpful?

Last updated on October 27, 2026

On this page