Project 05 · CRM + ERP Integration
Connect business data with confidence.
Integrate customer and operational records into reliable sales reporting.
The brief
- The business question
- Follow extraction reconciliation, authoritative integration, date quarantine, quality gates, stable keys, replay-safe loads, and atomic promotion. Finish with a customer-grain capstone and field-level lineage.
- What you’ll deliver
- Reconciled source data, stable keys, historical versions and a validated reporting refresh.
- Skills
- Integration · Incremental loading · Data quality
- Scope
- Advanced level · 12 milestones · 16 tables
Available data
Fictional extracts, load counts, invalid dates, versioned dimensions, refresh staging and a data catalog. The foundation project is latest-state; separate history and incremental labs demonstrate extensions.
crm_people
source_rowintegerPKcustomer_idtextnametextgendertextupdated_attext
| # | source_row | customer_id | name | gender | updated_at |
|---|---|---|---|---|---|
| 1 | 1 | C001 | Alice | F | 2025-01-01 |
| 2 | 2 | C001 | Alice Nguyen | F | 2025-01-05 |
| 3 | 3 | C002 | Ben | n/a | 2025-01-02 |
| 4 | 4 | C003 | Cara | F | 2025-01-03 |
| 5 | 5 | C004 | Dev | NULL | 2025-01-04 |
erp_people
erp_idtextgendertextbirth_datetext
| # | erp_id | gender | birth_date |
|---|---|---|---|
| 1 | NASC001 | Male | 1990-05-12 |
| 2 | NASC002 | Male | 1988-02-29 |
| 3 | NASC003 | Female | 2028-01-01 |
| 4 | NASC004 | Other | 1995-06-20 |
| 5 | NASC999 | Female | 1980-01-01 |
erp_locations
erp_idtextcountry_codetext
| # | erp_id | country_code |
|---|---|---|
| 1 | C-001 | USA |
| 2 | C-002 | GB |
| 3 | C-003 | UK |
| 4 | C-004 | IND |
load_manifest
source_nametextPKexpected_rowsinteger
| # | source_name | expected_rows |
|---|---|---|
| 1 | CRM | 6 |
| 2 | ERP | 5 |
product_versions
version_idintegerPKproduct_idtextnametextcostrealvalid_fromtext
| # | version_id | product_id | name | cost | valid_from |
|---|---|---|---|---|---|
| 1 | 1 | P01 | Notebook | 8 | 2024-01-01 |
| 2 | 2 | P01 | Notebook | 9 | 2025-02-01 |
| 3 | 3 | P02 | Desk lamp | 30 | 2024-01-01 |
| 4 | 4 | P02 | Desk lamp | 32 | 2025-03-01 |
raw_dates
row_idintegerPKraw_datetext
| # | row_id | raw_date |
|---|---|---|
| 1 | 1 | 20250115 |
| 2 | 2 | 20250230 |
| 3 | 3 | 0 |
| 4 | 4 | 20240229 |
| 5 | 5 | 20251301 |
dq_sales
line_idintegercustomer_keyintegerproduct_keyintegerquantityintegersalesreal
| # | line_id | customer_key | product_key | quantity | sales |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 2 | 24 |
| 2 | 2 | 999 | 1 | 1 | 12 |
| 3 | 3 | 2 | 999 | 1 | 80 |
| 4 | 4 | 2 | 3 | 0 | 0 |
| 5 | 1 | 1 | 1 | 2 | 24 |
customer_history
version_keyintegerPKcustomer_idtextcountrytextvalid_fromtextvalid_totext
| # | version_key | customer_id | country | valid_from | valid_to |
|---|---|---|---|---|---|
| 1 | 101 | C001 | United States | 2024-01-01 | 2025-02-01 |
| 2 | 102 | C001 | Canada | 2025-02-01 | NULL |
| 3 | 103 | C002 | United Kingdom | 2024-01-01 | NULL |
incoming_people
customer_idtextPKnametextupdated_attext
| # | customer_id | name | updated_at |
|---|---|---|---|
| 1 | C001 | Alice New | 2025-02-01 |
| 2 | C002 | Ben stale | 2024-01-01 |
| 3 | C006 | Finn | 2025-02-02 |
current_people
customer_keyintegerPKcustomer_idtextnametextupdated_attext
| # | customer_key | customer_id | name | updated_at |
|---|---|---|---|---|
| 1 | 1 | C001 | Alice Nguyen | 2025-01-05 |
| 2 | 2 | C002 | Ben | 2025-01-02 |
published_totals
customer_idtextPKtotal_salesreal
| # | customer_id | total_sales |
|---|---|---|
| 1 | C001 | 289 |
| 2 | C002 | 116 |
refresh_stage
customer_idtexttotal_salesreal
| # | customer_id | total_sales |
|---|---|---|
| 1 | C001 | 300 |
| 2 | C002 | 120 |
warehouse_catalog
object_nametextcolumn_nametextmeaningtextsource_objecttextruletext
| # | object_name | column_name | meaning | source_object | rule |
|---|---|---|---|---|---|
| 1 | integrated_customers | customer_id | Normalized natural customer identifier | crm_people.customer_id | Trim; latest updated_at then source_row |
| 2 | integrated_customers | gender | Customer gender under agreed source authority | crm_people.gender + erp_people.gender | Meaningful CRM first, ERP fallback, otherwise Unknown |
| 3 | integrated_customers | country | Country display name | erp_locations.country_code | Normalize ERP key and map codes |
| 4 | integrated_customers | birth_date | Validated birth date | erp_people.birth_date | Valid calendar date; no future dates at 2025-04-01 |
| 5 | built_sales | sale_key | One source sales line | bronze_sales.row_id | Unique and not null |
bronze_sales
row_idintegerPKcustomer_idtextproduct_idtextquantitytextsalestextorder_datetext
| # | row_id | customer_id | product_id | quantity | sales | order_date |
|---|---|---|---|---|---|---|
| 1 | 1 | C001 | P01 | 2 | 24 | 2025-01-01 |
| 2 | 2 | C002 | P03 | 1 | 80 | 2025-01-02 |
| 3 | 3 | C001 | P02 | 1 | 45 | 2025-01-15 |
| 4 | 4 | C003 | P04 | 2 | 240 | 2025-02-01 |
| 5 | 5 | C004 | P03 | 2 | 160 | 2025-02-05 |
dim_customer
customer_keyintegerPKcustomer_idtextnametextcountrytext
| # | customer_key | customer_id | name | country |
|---|---|---|---|---|
| 1 | 1 | C001 | Alice Nguyen | United States |
| 2 | 2 | C002 | Ben | United Kingdom |
| 3 | 3 | C003 | Cara | United Kingdom |
| 4 | 4 | C004 | Dev | India |
| 5 | 5 | C005 | Elena | Canada |
dim_product
product_keyintegerPKproduct_idtextnametextcategorytextpricereal
| # | product_key | product_id | name | category | price |
|---|---|---|---|---|---|
| 1 | 1 | P01 | Notebook | Stationery | 12 |
| 2 | 2 | P02 | Desk lamp | Home | 45 |
| 3 | 3 | P03 | Keyboard | Tech | 80 |
| 4 | 4 | P04 | Headphones | Tech | 120 |
Milestones
Start1 · Land the sources
2 · Integrate and validate
3 · Quality gates and stable keys
4 · History and safe loading
Project report
How a data warehouse is built
This project follows the standard layers: understand source data → load raw records (Bronze) → clean and validate (Silver) → build reporting tables (Gold) → produce reports.
Source contract
Structured fictional CRM, ERP and sales extracts. The foundation keeps latest state. Confirm source ownership, extraction counts, key formats, grain and refresh expectations before choosing architecture.
Bronze · preserve evidence
Raw source-shaped records retain spaces, sentinels, duplicates and malformed values. Compare extraction counts, inspect column alignment, and retain source row identity for replay and diagnosis.
Silver · standardize with explicit rules
Latest CRM row wins with a deterministic source_row tie-breaker. Normalize ERP keys under its format contract. Validate calendar dates, quarantine failures and reconcile every source row.
Gold · integrate business entities
CRM owns meaningful gender; ERP supplies fallback and country. Stable dimension keys link each validated sales line. Choose current-state or effective-time semantics before reporting. Views or stored tables are workload choices.
Reports · declare the metric
Customer totals use one row per customer and preserve zero-activity entities. Northstar sales means positive quantity × catalog price under a stated teaching rule, not an automatic accounting correction.