View: product_affinity

Source Tables Used In Script

Schema Table (or Derived Table) Name Table Type Purpose
drp order_line_revenue database Primary
drp order_status database Lookup
drp_staging olr_orders_updated database Incremental functionality
drp_staging product_affinity database Pre-insert

SQL Flow

Calculated and Derived Fields

Target Column Target Column Data Type Source schema.table Source Column Transformation/Logic
product_affinity_id CHAR drp order_line_revenue.product_name Combines and encrypts first and second order product_name, product_id, sku and sequence_number into a unique id
days_between_order_tiers VARCHAR drp order_line_revenue.order_date If first order_date - second order_date > 0 then assign a bucket to the order sequence. ex: 1-10 day, 41-50 days

 

All content © Daasity 2021. Do not copy, share or distribute.