OpenBI Docs Buy

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]
MonthProductLiters
2023-11-01Cider7,549
2023-11-01IPA8,097
2023-11-01Lettøl4,265
2023-11-01Pils24,192
2023-12-01Cider6,991
2023-12-01IPA7,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
Product20242025Change
Pils325,106334,8779,771
Cider97,001101,5104,509
Lettøl54,46556,6302,165
IPA109,599110,336737

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)
Liters sold by monthCiderIPALettølPils653.719,97639,2972023-112024-032024-072024-112025-032025-072025-112026-032026-07
Liters sold by month, a line per product.

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: monthly to the chart, growth to 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

Last updated · OpenBI Studio 0.3.78