3060_CHN_BAS_order_channel_source_insert Transformation

Target Database Table


Script Description and Logic

Pulls in the records generated by order_channel_influencer_discount_code, order_channel_influencer_utm and order_channel_discount_code_mapping from drp_staging.order_channel_source and inserts them into drp.order_channel_source table.

Incremental functionality is included such that only the records that require an update or are new get inserted into the final drp.order_channel_source table. The records in staging are compared to those in the final table.

Any orders that match are removed from the final table and updated by way of insertion from staging (upsert). The records that appear in staging, but not in the final table are inserted into drp.order_channel_source.

Source Tables Used In Script

Schema Table (or Derived Table) Name Table Type Purpose
drp_staging order_channel_source database Primary

SQL Flow

To View Larger Image, Right Click and Choose Open Image In New Tab.

3060_CHN_BAS_order_channel_source_insert Transformation

Calculated and Derived Fields


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