# Modeling the Three Statements

Use Roll forward and Derived strategies to connect balance-sheet and cash-flow lines to your model's drivers, such as capex, depreciation, drawdowns, and repayments.

## Why these lines need a different setup

Income-statement lines, such as revenue or operating expenses, are **flows**: amounts that add up over time. The ML models can forecast flows directly from their history.

Balance-sheet and cash-flow lines are connected **across time**. A balance, or **stock**, accumulates its flows, and a cash-flow line is often the change in a balance from one period to the next. If you forecast each line independently, the statements won't tie.

Instead, you tell Galdera how the lines relate. Galdera then calculates the connected lines so that **every stock's change equals its flows, in every period**.

## Before you start

* Your balance-sheet lines are loaded as measures, with actuals for at least the last period before the forecast starts. Each roll-forward stock needs this last actual balance as its starting point.

## Set up the model

### 1. Mark your stocks

On the [Targets](/targets/what-are-targets) page, set the **Type** toggle to **Stock** for every balance, such as PP\&E, Inventory, Debt, and Cash. Quarters and years then show the period-end balance instead of a sum. For more on flows and stocks, see [Metrics vs. Measures](/concepts/metric-vs-measure).

### 2. Define driver metrics that look across periods

Some lines are best forecast through a ratio, such as a depreciation rate. These ratios are ordinary [metrics](/targets/creating-metrics). Build them with the formula builder's time options, such as **Previous period**, a trailing sum, or year to date. For example, a depreciation rate is D\&A ÷ previous-period PP\&E.

### 3. Assign a strategy to each line

In [the forecast version's measure table](/forecasting/configuring-a-forecast-version), give each statement line the strategy that matches how it behaves:

| Line behaves like… | Strategy |
|---|---|
| A flow the business controls or the model can learn | **Independent** (ML-forecast), or an ingested plan |
| A flow best explained by a ratio | **Dependent (via Metric)**, using a driver metric |
| A stock | **Roll forward**: the last actual balance plus signed flow terms |
| A formula of other lines | **Derived**, with previous-period references allowed |

## Worked example: PP\&E, capex, and D\&A

PP\&E, capex, and depreciation and amortization (D\&A) form the classic three-way link between the statements. Here is how to set them up:

| Line | Strategy | Definition |
|---|---|---|
| Capex | Independent | Forecast from its own history |
| PP\&E (stock) | Roll forward | Last actual + Capex − D\&A |
| Depreciation rate (metric) | Not applicable | D\&A ÷ previous-period PP\&E |
| D\&A | Dependent (via Metric) | Forecast depreciation rate × previous-period PP\&E |

When you run the version:

1. The ML models forecast capex and the depreciation rate.
2. Galdera walks forward one period at a time. Each month's D\&A is that month's depreciation rate × last month's PP\&E.
3. PP\&E rolls forward by adding that month's capex and subtracting that month's D\&A.

The movement in PP\&E equals its flows exactly, so depreciation on the income statement, PP\&E on the balance sheet, and capex on the cash-flow statement all tie.

The same pattern covers other statement links, for example:

* Inventory rolling forward with change in inventory.
* Debt rolling forward with drawdowns and repayments.
* Interest expense driven by an average-rate metric applied to previous-period debt.

## What Galdera guarantees, and what it doesn't

A roll-forward stock's change equals the signed terms you configure, period by period, including after an overlay runs. A Derived line follows its formula. These rules do not check whether your definitions represent the right business relationships.

Galdera does **not** check that your whole balance sheet balances. That remains your responsibility.

## Overlays on a three-statement model

Adjust the **drivers**, not the calculated lines. For example, an overlay on capex flows through to PP\&E and the lines that depend on it when the overlay runs.

Overlays can't target roll-forward or derived lines directly. Setting PP\&E to a new value while capex stays unchanged would break the consistency this setup provides. Deciding which lines to keep as drivers in a version is the same as deciding which lines people can adjust.

## Checks the configuration runs for you

* **Starting balances**: a roll-forward stock needs a starting balance, called its anchor, in your actuals. The strategy pane shows anchor coverage for each slice of the data.
* **Loops**: a loop where every reference is in the same period, for example D\&A from PP\&E and PP\&E from D\&A, both in the same month, is rejected when you save. The error names the loop. Loops that cross periods are allowed; that is how stocks accumulate.
* **An ML-forecast line**: at least one measure must be forecast directly or via a driver metric. The strategy picker protects the last Independent measure from being changed to another strategy.
