dbt + BigQuery Starter for Retail Sales Forecasting

A production-shaped dbt project on BigQuery that turns raw Corporación Favorita grocery data into clean, tested, forecast-ready models. Clone it, point it at your warehouse, and you have a working analytics-engineering layer in an afternoon.

Primary Outcome

A tested, documented dbt + BigQuery transformation layer that turns raw retail data into forecast-ready tables.

Solution

A version-controlled dbt project that cleans, tests, and documents the data once, so every downstream model and dashboard reads from the same trustworthy tables.

Deliverables

  • A complete dbt project structured into staging, intermediate, and marts layers

  • Sources defined against the Favorita tables (sales, stores, items, transactions, oil, holidays)

  • Schema and data tests (unique, not_null, relationships, accepted_values) on every key model

  • Auto-generated dbt docs with a full lineage graph

  • A marts table that joins sales to store, item, and calendar context, ready for modeling

Strategic Context

Most forecasting projects fail before the model is even trained — they fail on data quality. The transformation layer is where you decide whether your numbers are trustworthy. dbt makes that layer testable, documented, and reviewable like any other code, which is the difference between a one-time analysis and a system your team can rely on.

Technical Architecture

Most forecasting projects fail before the model is even trained — they fail on data quality. The transformation layer is where you decide whether your numbers are trustworthy. dbt makes that layer testable, documented, and reviewable like any other code, which is the difference between a one-time analysis and a system your team can rely on.

Problem Statement

Raw retail data is messy: duplicate rows, inconsistent grain, missing reference joins, and SQL scattered across notebooks and BI tools. Nobody trusts it, and every new analysis starts from scratch.

What's Included

The full dbt project: dbt_project.yml, source definitions, staging models for each raw table, intermediate models that resolve grain and joins, mart models for analysis and forecasting, plus YAML tests and documentation throughout.

FAQs

Do I need the Favorita dataset to use this?

No. The Favorita data is the worked example, but the structure and patterns transfer to any retail or transactional warehouse — swap the sources and reuse the layering.

Does this work on warehouses other than BigQuery?

The patterns do. The profiles and a few functions are BigQuery-specific, but porting to Snowflake or Postgres is mostly a matter of adapter and syntax tweaks.

Is this beginner-friendly?

If you know basic SQL and have used dbt once, yes. It's foundational by design.

Tech Stack

Tool 1

Tool 4

Tool 4

Tool 3

Tool 2

Tool 4

Primary Outcome

A tested, documented dbt + BigQuery transformation layer that turns raw retail data into forecast-ready tables.

Problem Statement

Raw retail data is messy: duplicate rows, inconsistent grain, missing reference joins, and SQL scattered across notebooks and BI tools. Nobody trusts it, and every new analysis starts from scratch.

Solution

A version-controlled dbt project that cleans, tests, and documents the data once, so every downstream model and dashboard reads from the same trustworthy tables.

Deliverables

  • A complete dbt project structured into staging, intermediate, and marts layers

  • Sources defined against the Favorita tables (sales, stores, items, transactions, oil, holidays)

  • Schema and data tests (unique, not_null, relationships, accepted_values) on every key model

  • Auto-generated dbt docs with a full lineage graph

  • A marts table that joins sales to store, item, and calendar context, ready for modeling

What's Included

The full dbt project: dbt_project.yml, source definitions, staging models for each raw table, intermediate models that resolve grain and joins, mart models for analysis and forecasting, plus YAML tests and documentation throughout.

Strategic Context

Most forecasting projects fail before the model is even trained — they fail on data quality. The transformation layer is where you decide whether your numbers are trustworthy. dbt makes that layer testable, documented, and reviewable like any other code, which is the difference between a one-time analysis and a system your team can rely on.

FAQs

Do I need the Favorita dataset to use this?

No. The Favorita data is the worked example, but the structure and patterns transfer to any retail or transactional warehouse — swap the sources and reuse the layering.

Does this work on warehouses other than BigQuery?

The patterns do. The profiles and a few functions are BigQuery-specific, but porting to Snowflake or Postgres is mostly a matter of adapter and syntax tweaks.

Is this beginner-friendly?

If you know basic SQL and have used dbt once, yes. It's foundational by design.

Technical Architecture

Most forecasting projects fail before the model is even trained — they fail on data quality. The transformation layer is where you decide whether your numbers are trustworthy. dbt makes that layer testable, documented, and reviewable like any other code, which is the difference between a one-time analysis and a system your team can rely on.

Tech Stack

Tool 1

Tool 4

Tool 4

Tool 3

Tool 2

Tool 4