Get started
A first notebook on the example project, in a quarter of an hour: a question, two OAX steps on the model, a chart in C# and the answer in a sentence. Every result below is what these steps give.
Before you start
You need OpenBI Studio (see Install OpenBI Studio) and the Example Brewery project: File › Open the example project. It has two years of a brewery’s sales by month, shop and product, with measures such as [Liters sold] and [Revenue].
1. Make the notebook
Choose Prediction on the left, then + by its list and Clean slate, and name it Liters by month. Any of the four analytics views will do for exploring: the view says what the notebook saves later, a model, a plan, a valuation or a network.
2. Say the question
Add a Text step with the buttons at the end of the steps and write the question. It is the first thing anyone reads, and the paper’s abstract:
# Liters by month
How have liters sold moved month by month, and which product grew most from 2024 to 2025?
3. Read the model
Add an OAX step, name it monthly in its header, and write the query. Ctrl+Enter runs it (⌘+Enter on a Mac):
// liters per month and product, with the model's own measure
EVALUATE
SUMMARIZECOLUMNS (
Sales[Month],
Products[Product],
"Liters", [Liters sold]
)
ORDER BY Sales[Month], Products[Product]
| Month | Product | Liters |
|---|---|---|
| 2023-11-01 | Cider | 7,549 |
| 2023-11-01 | IPA | 8,097 |
| 2023-11-01 | Lettøl | 4,265 |
| 2023-11-01 | Pils | 24,192 |
| 2023-12-01 | Cider | 6,991 |
| 2023-12-01 | IPA | 7,476 |
The first 6 of its 144 rows.
Its rows are now the variable monthly, a Table every later step can use. The Variables pane on the right lists it.
4. Use the model’s measures
The model already has the yearly figures as measures, [Liters 2024], [Liters 2025] and [Liters change]. A query that uses them gives the numbers the report pages give:
// the model has the yearly figures as measures: use them, so the notebook says what the reports say
EVALUATE
SUMMARIZECOLUMNS (
Products[Product],
"2024", [Liters 2024],
"2025", [Liters 2025],
"Change", [Liters change]
)
ORDER BY [Change] DESC
| Product | 2024 | 2025 | Change |
|---|---|---|---|
| Pils | 325,106 | 334,877 | 9,771 |
| Cider | 97,001 | 101,510 | 4,509 |
| Lettøl | 54,465 | 56,630 | 2,165 |
| IPA | 109,599 | 110,336 | 737 |
5. Draw it
A C# step makes a line per product from monthly. A step’s last expression, without a semicolon, is what it shows:
// one line per product over the months
var months = monthly.Rows.Select(r => r.Date("Month")).Distinct().OrderBy(d => d).ToList();
var labels = months.Select(d => d.ToString("yyyy-MM")).ToList();
var series = monthly["Product"].Distinct()
.Select(p => new ChartSeries(p, months.Select(m => monthly.Rows
.Where(r => r.Text("Product") == p && r.Date("Month") == m).Sum(r => r.Number("Liters"))).ToList()))
.ToArray();
Chart.Line("Liters sold by month", labels, series)
6. Say what it found
A step can end with a sentence too, written from the rows:
var top = growth[0];
$"{top.Text("Product")} grew most: {top.Number("Change"):N0} liters more in 2025 than in 2024"
Pils grew most: 9,771 liters more in 2025 than in 2024
Then a last Text step says it in your words, for whoever reads the notebook or its paper.
7. Run it all, and look at it whole
- Run all runs the steps in order from a fresh start, and stops at the first that fails.
- The Flow tab draws the steps as boxes, with an arrow for each variable from the step that makes it to those that use it:
monthlyto the chart,growthto the sentence. - Paper typesets the notebook as a PDF beside it: the question as the abstract, the tables and the chart numbered, the code in an appendix (see Paper).
The notebook is saved as you type, as notebook.ipynb in the project’s predictions\Liters by month\ folder, and goes into the project’s next version with everything else.
Where next
- Steps and the kernel: parameters, errors and their hints, interrupting and restarting.
- Data in and out: SQL steps, joins, dates, and results back into the model.
- Learning: a model that predicts, judged honestly.