ccdw_fact_promotion_line_item

This table records the application of promotions to individual line items. Each row represents a promotion line item in an order.

Column AliasData TypeKeyDescriptionIndex?
promotion_line_item_idBIGINTPKSurrogate key uniquely identifying this promotion line item. Use for joins and deduplication.Yes
promotion_idINTEGERFKForeign key to ccdw_dim_promotion. Use for promotion-level reporting and attribution.Yes
sku_idINTEGERFKForeign key to ccdw_dim_product for the SKU affected by the promotion. Use for product- or SKU-level promotion analysis.Yes
promotion_instance_idVARCHAR(50)Unique key for one application of a promotion within an order. A single order-level promotion can generate multiple instances (one per qualifying line).No
line_item_idBIGINTFKForeign key to ccdw_fact_line_item. Links to the fact line item for quantity, unit price, and other line-level details.No
nline_item_idVARCHAR(50)Natural key for the line item in the source system, for example, OCAPI/SCAPI line item identifier). Normalized for cross-system use.No
order_idBIGINTFKSurrogate key for the order. Use to join with ccdw_fact_line_item and other order-level facts.Yes
norder_idVARCHAR(50)Natural key for the order in the source system, for example, order number or document ID).No
utc_submit_timestampTIMESTAMPUTC timestamp when the promotion was applied to the line item. Use for exact-time filtering and incremental loads.Yes
utc_submit_day_idSMALLINTFKForeign key to ccdw_dim_date for the UTC submission day. Use for UTC-based date partitioning and calendar joins.Yes
utc_submit_time_idSMALLINTFKForeign key to ccdw_dim_time for the UTC submission time. Use for time-of-day analysis in UTC.No
utc_update_timestampTIMESTAMPLast modified UTC timestamp for this record. Use for incremental loads or change detection.Yes
std_submit_timestampTIMESTAMPTimestamp when the promotion was applied, expressed in the realm's standard (reporting) time zone.No
std_submit_day_idSMALLINTFKForeign key to ccdw_dim_date for the standard submission day. Use for reporting-date partitioning and day-level reporting.Yes
std_submit_time_idSMALLINTFKForeign key to ccdw_dim_time for the standard submission time. Use for time-of-day analysis in reporting time zone.No
std_timezone_idSMALLINTFKForeign key to ccdw_dim_timezone for the time zone used to derive std_submit_* date and time columns (realm reporting time zone).No
locale_idSMALLINTFKForeign key to ccdw_dim_locale (language and country). Represents the session locale when the promotion was applied.Yes
site_idSMALLINTFKForeign key to ccdw_dim_site for the site where the order was placed (submission site).Yes
business_channel_idSMALLINTFKForeign key to ccdw_dim_business_channel, for example, storefront, call center). Use for channel-level reporting.Yes
user_agent_idINTEGERFKForeign key to ccdw_dim_user_agent. Represents device or browser context when the promotion was applied.Yes
campaign_idINTEGERFKForeign key to ccdw_dim_campaign for the marketing campaign associated with this promotion, if any. Nullable.No
source_code_group_idINTEGERFKForeign key to ccdw_dim_source_code_group. Use for source code or affiliate attribution. Nullable.No
coupon_idINTEGERFKForeign key to ccdw_dim_coupon for the coupon applied with this promotion line item, if any. Null when no coupon was used.No
visitor_idVARCHAR(100)Anonymous or persistent visitor identifier from the session. Use for visit-level or anonymous-user analysis.No
customer_idBIGINTFKForeign key to ccdw_dim_customer. Use for customer-level promotion analysis. Might reference guest or registered customer.Yes
buyer_emailVARCHAR(256)Email address of the buyer.No
is_anonymousBOOLEANIndicates whether customer is anonymous or registered.No
do_not_trackBOOLEANIndicates whether the customer has opted out of tracking.No
lcl_currency_idSMALLINTFKForeign key to ccdw_dim_currency for the tendered (local) currency—the currency in which the order was placed.No
std_currency_idSMALLINTFKForeign key to ccdw_dim_currency for the realm's reporting currency. All std_* monetary values in this row are converted to this currency.No
shipping_geography_idINTEGERFKForeign key to ccdw_dim_geography for the shipping address (region/country). Use for geographic reporting.No
invoice_geography_idINTEGERFKForeign key to ccdw_dim_geography for the invoice or billing address (region/country).No
customer_geography_idINTEGERFKForeign key to ccdw_dim_geography for the customer's address (region/country).No
quantityNUMERICNumber of units of the line item to which this promotion application applies (quantity purchased for this line).No
lcl_li_promo_discNUMERICLine-item-level promotional discount amount in tendered (local) currency.No
lcl_li_promo_disc_order_allocNUMERICPortion of an order-level promotional discount allocated to this line item (prorated), in tendered currency.No
lcl_li_promo_disc_ship_allocNUMERICPortion of a shipping-level promotional discount allocated to this line item (prorated), in tendered currency.No
lcl_li_manual_discNUMERICLine-item-level manual discount amount in tendered (local) currency.No
lcl_li_manual_disc_order_allocNUMERICPortion of an order-level manual discount allocated to this line item (prorated), in tendered currency.No
lcl_li_manual_disc_ship_allocNUMERICPortion of a shipping-level manual discount allocated to this line item (prorated), in tendered currency.No
lcl_li_taxNUMERICLine-item-level tax amount in tendered (local) currency.No
lcl_li_tax_order_allocNUMERICPortion of order-level tax allocated to this line item (prorated), in tendered currency.No
lcl_li_shippingNUMERICLine-item-level shipping charge in tendered (local) currency.No
lcl_li_shipping_order_allocNUMERICPortion of order-level shipping allocated to this line item (prorated), in tendered currency.No
lcl_li_gross_merchandise_valueNUMERICGross Merchandise Value (GMV) of the line item in tendered currency allocated to the promotion line item.No
std_li_promo_discNUMERICLine-item-level promotional discount in standard (reporting) currency. Converted from tendered currency for cross-currency reporting.No
std_li_promo_disc_order_allocNUMERICPortion of order-level promotional discount allocated to this line item (prorated), in standard reporting currency.No
std_li_promo_disc_ship_allocNUMERICPortion of shipping-level promotional discount allocated to this line item (prorated), in standard reporting currency.No
std_li_manual_discNUMERICLine-item-level manual discount in standard (reporting) currency. Converted from tendered currency.No
std_li_manual_disc_order_allocNUMERICPortion of order-level manual discount allocated to this line item (prorated), in standard reporting currency.No
std_li_manual_disc_ship_allocNUMERICPortion of shipping-level manual discount allocated to this line item (prorated), in standard reporting currency.No
std_li_taxNUMERICLine-item-level tax in standard (reporting) currency. Converted from tendered currency.No
std_li_tax_order_allocNUMERICPortion of order-level tax allocated to this line item (prorated), in standard reporting currency.No
std_li_shippingNUMERICLine-item-level shipping charge in standard (reporting) currency. Converted from tendered currency.No
std_li_shipping_order_allocNUMERICPortion of order-level shipping allocated to this line item (prorated), in standard reporting currency.No
std_li_gross_merchandise_valueNUMERICGross Merchandise Value (GMV) of the line item in standard currency allocated to the promotion line item.No