Analyze Sample Orders in a Notebook
Start with 12 fictional service orders. Load the file into a table, query it in a notebook, and calculate the change in revenue in Python. The same table feeds the Data Flows tutorial and the Dashboards tutorial.
Load the sample table
You need access to Studio, a warehouse with query access, and an existing catalog and schema where you may create a tutorial table. You can complete the SQL checks in the SQL editor if a Python notebook runner is unavailable.
- Download studio-orders.csv. It contains one row per order for January and February of 2025 and 2026.
- Open Upload, select the CSV, and wait for the file to finish uploading. Open Load into table for that file.
- Preview the file with the first row treated as headers. Choose Create new table and enter a fully qualified name such as
your_catalog.your_schema.studio_orders. Use a unique name if the table already exists. - Review the inferred types.
order_dateshould be a date,regionandserviceshould be text, andorder_id,report_year,revenue, andprofitshould be numeric. Confirm the load result shows 12 rows.
Use your own qualified table name wherever the snippets show your_catalog.your_schema.studio_orders.
Create and run the notebook
- Open Notebooks and choose New notebook. Name it
Service orders review. - Add a Markdown cell with the title
Service orders reviewand a note that both periods cover January and February. - Add a SQL cell below it and run the query:
SELECT report_year,
COUNT(*) AS order_count,
SUM(revenue) AS total_revenue,
SUM(profit) AS total_profit
FROM your_catalog.your_schema.studio_orders
GROUP BY report_year
ORDER BY report_year;
| Year | Orders | Revenue | Profit |
|---|---|---|---|
| 2025 | 6 | $5,250 | $1,150 |
| 2026 | 6 | $7,000 | $1,550 |
- Add a Python cell immediately below the SQL cell. The notebook exposes the latest SQL result as
_sqldf:
revenue = _sqldf.set_index('report_year')['total_revenue'].astype(float)
prior = revenue.loc[2025]
current = revenue.loc[2026]
print(f'Revenue change: ${current - prior:,.0f}')
print(f'Percentage change: {(current / prior - 1):.1%}')
Expect Revenue change: $1,750 and Percentage change: 33.3%.
- Choose Save, then Run all. In Runs, open the finished run and check that its Python output matches the interactive result.
If a result differs
| What you see | What to check |
|---|---|
| Table or schema missing | Confirm the qualified name, connection, and grants. Check that the upload finished loading into a table. |
| SQL returns more than 12 source rows | Confirm you used Create new table for the fixture. Use a fresh qualified name if you appended the sample more than once. |
Python cannot find _sqldf | Run the SQL cell successfully before Python, or use Run all with the cells in order. |
report_year cannot be found in Python | Inspect the SQL result column names and confirm the Python cell follows the intended query. |
Next, build a regional revenue flow to turn the same orders into a reusable comparison.