What I mean by closing the record is use the value in a soft deleted column like deleted_at, in the dbt_valid_to field rather than the current_timestamp.
Hi Harsh - if you have a soft delete column in the table, you can create a view on top of the snapshot to give you the custom logic you want. case when soft_delete_flag = ‘Y’ then dbt_updated_at else dbt_valid_to end as dbt_valid_to. Or something like that…
We use a view to provide user friendly active flags and start/end dates for end user consumption.
The timestamp strategy will work out of the box, if your updated_at field is set when the records are soft deleted.
Otherwise, a check strategy will work, by including the deleted_at or is_deleted field in the check_cols list, like: check_cols=["updated_at", "deleted_at"].