gold.dim_customer
The customer dimension provides a complete view of customer master data, combining CRM and ERP sources to create a single, authoritative customer record.View Definition
Business Key
The dimension uses a composite business key strategy:- customer_number (
cst_key): Natural business identifier from source systems - customer_id (
cst_id): System-generated identifier - customer_key: Surrogate key generated via
ROW_NUMBER()for join optimization
Fields
Surrogate key generated using ROW_NUMBER() ordered by customer_id. Used for efficient joins with fact tables.
System-generated customer identifier from the CRM system (cst_id). Primary business key.
Natural business key (cst_key) used across CRM and ERP systems for customer identification.
Customer’s first name from CRM customer information.
Customer’s last name from CRM customer information.
Customer’s marital status code from CRM records.
Customer gender with fallback logic: uses CRM gender if available and not ‘n/a’, otherwise falls back to ERP gender, defaulting to ‘n/a’ if unavailable.
Customer’s date of birth from ERP customer records (erp_cust_az12).
Timestamp when the customer record was created in the CRM system.
gold.dim_product
The product dimension contains current product catalog information, including category hierarchies and cost data. This view excludes discontinued products (whereprd_end_dt is not null).
View Definition
Business Key
The dimension uses multiple identifiers:- product_number (
prd_key): Natural business identifier from product master data - product_id (
prd_id): System-generated product identifier - product_key: Surrogate key generated via
ROW_NUMBER()for join optimization
Data Filter
This view only includes active products where
prd_end_dt IS NULL. Discontinued products are excluded from analytical queries.Fields
Surrogate key generated using ROW_NUMBER() ordered by product_start_date and product_number. Used for efficient joins with fact tables.
System-generated product identifier from the CRM product catalog.
Natural business key (prd_key) used across systems for product identification.
Descriptive product name from the CRM product catalog.
Foreign key to the product category hierarchy (links to erp_px_cat_g1v2).
Top-level product category name from ERP category master data.
Secondary level product category for more granular classification.
Maintenance classification or flag from the ERP category data.
Standard cost of the product from CRM product records.
Product line grouping for portfolio management and reporting.
Date when the product became available in the catalog.