Skip to main content

2 posts tagged with "sop"

View All Tags

Forecast the What-If, Not the Copy: Scenario Branches Meet Time-Series Forecasting

· 7 min read
Joachim Rosskopf
AnoFox Development Team

Two queries. One word different. Two futures.

FROM ts_forecast_by('sales',       product_id, date, quantity, 'AutoETS', 7, '1d')
FROM ts_forecast_by('promo.sales', product_id, date, quantity, 'AutoETS', 7, '1d')

The first forecasts your actual demand. The second forecasts a promotional scenario that exists nowhere on disk. Neither one copied a row.

Git Branches for Your Database: What-If Analysis in DuckDB Without Copying Tables

· 9 min read
Joachim Rosskopf
AnoFox Development Team

Every analyst has written this line. Nobody is proud of it.

CREATE TABLE sales_promo_v2_FINAL AS SELECT * FROM sales;

There is a better move. Branch the table instead:

CALL scenario_create('promo_q2');
ATTACH 'promo_q2' AS promo (TYPE scenario);

UPDATE promo.sales SET quantity = quantity * 1.25 WHERE product_id = 'product_1';

sales is untouched. promo.sales shows the what-if. Nothing was copied.

🍪 Cookie Settings