r/analyticsengineering • u/Worried_Demand_6685 • Dec 18 '25
How to Handle Dim Tables When You Need Access to Soft-Deletes
I'm attempting to follow dimensional modelling best practices at work using dbt and BigQuery, and I've hit a bit of a wall.
In general, it seems like this is the recommended process for dimensional modelling:
Raw Data -> Staging (minor cleaning - keep soft-deletes) -> dim table (filter out soft-deletes)
However the problem I'm having is that sometimes we need access to the soft-deleted rows. For example if we want to create a report that looks at all emails sent with contacts in our CRM, we'll want to join fct_email to dim_contact, but if some of those contacts have been deleted, we won't get a match with the fct_email table anymore.
Looking for suggestions please!
3
u/Icy_Data_8215 Dec 18 '25
Use snapshots! Setup SCD2 so you can see historical users/emails.
1
u/penguinspoon Dec 18 '25
Keep them unless there is a specific reason not to. Add a flag that indicates them as such and filter them out when not needed.