The problem I’m having:
Hi! I’m trying to build a snapshot using the check strategy, but I can’t seem to make it work, and I’m not exactly sure why.
I have a source table that looks like this:
So I built a snapshot like this:
{% snapshot current_mrr_snapshot %}
{{
config(
target_schema='my_schema',
strategy='check',
unique_key='customer_id',
check_cols=['total_mrr'],
invalidate_hard_deletes=True,
)
}}
select *
from {{ref('current_mrr_by_customer')}}
{% endsnapshot %}
The context of why I’m trying to do this
The purpose of this snapshot is to have a daily record of changes in the MRR value for each customer. However, when I ran the snapshot for the first time, it only registered the current value and did not record any changes in the following days. My project runs daily using Fivetran’s DBT Transformations.
My snapshot path is configured in dbt_project.yml: snapshot-paths: ["snapshots"]