Skip to main content

lookback

Available in the dbt Cloud "Latest" release track and dbt Core v1.9 and higher.

Definition

Set the lookback to an integer greater than or equal to zero. The default value is 1. You can configure lookback for a model in your dbt_project.yml file, property YAML file, or config block.

Examples

The following examples set 2 as the lookback config for the user_sessions model.

Example in the dbt_project.yml file:

dbt_project.yml
models:
my_project:
user_sessions:
+lookback: 2

Example in a properties YAML file:

models/properties.yml
models:
- name: user_sessions
config:
lookback: 2

Example in sql model config block:

models/user_sessions.sql
{{ config(
lookback=2
) }}
0