dbt_scd_id creation logic in check strategy

Hi ,

I am a happy dbt core user and the most loved tool I am using is the snapshot for scd-type-2 dimension table. (Btw I am using check strategy) The problem I am facing is that the project I am in is a migration project and that means there is old data to be migrated also. So I want to backfill the snapshot table with previous data but the problem is I don’t know the logic behind creating the dbt_scd_id.

Can you help me please or at least recommend me a way to overcome this problem.

Best,
Hakan

I found the solution

md5( customerbkey || ‘|’ || cast(dbt_updated_at as string) ) in spark sql to replicate the logic

I did not know that I had to put the pipeline char in between when concatenating the two fields

Thanks anyways

1 Like

Thanks, it also helped me a lot!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.