{{ config( materialized="incremental", unique_key="page_view_id" -- This line is the key to replace duplicates ) }} with events as ( select * from {{ source('schema', 'table') }} {% if is_incremental() %} where collector_tstamp >= ( select dateadd('day', -3, max(max_collector_tstamp)) from {{ this }} {% endif %} )