Skip to content

Commit

Permalink
Lookback one additional day in incremental dbt model
Browse files Browse the repository at this point in the history
  • Loading branch information
fnery committed May 15, 2024
1 parent 8944467 commit 70b160d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transform/models/fct_steps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ select
timestamp_trunc(current_timestamp(), second) as transformed_at,
from {{ source('fitbit_ingest', 'steps') }}
{% if is_incremental() %}
where date(date_time) >= (select max(day) from {{ this }})
where date(date_time) >= (select date_sub(max(day), interval 1 day) from {{ this }})
{% endif %}

0 comments on commit 70b160d

Please sign in to comment.