Life-Time Value Code

This page provides detailed instructions on the Life-Time Value Code transform code block and what should be added to the Script Manifest file in order to execute the code

Script Manifest File (YML)

Upstream Transformation Dependencies

This code block is dependent on the following upstream code blocks being implemented:

  • Initialization

  • UOS

  • Order Status

  • Order Channel and Marketing

  • Order and Order Line Revenue

  • Customer

Transformation Code Requirements

The following code should be added to the main workflow in the appropriate position, after Reviews and before Returns per the Transform Code Sequence - DRP page

  #--------------------------------------------------------------------------------------------------------------------
  # SECTION: 5100_LTV
  # DEPENDENCIES:
  #   - Section: 0500_UOS
  #   - Section: 2700_ORDER_STATUS
  #   - Section: 4300_ORDER_LINE_REVENUE
  #   - Section: 4600_CUSTOMER
  # REQUIRED: No
  # PURPOSE: This code the DRP tables for life time value and customer segments and should be enabled once the
  # upstream blocks are enabled
  #--------------------------------------------------------------------------------------------------------------------
  ltv and segments:
    integrations:
    scripts:
      - "github://platform-sql-shared/scripts/pro/5100_life_time_value/5110_LTV_BAS_ltv_time_series.sql"
      - "github://platform-sql-shared/scripts/base/5100_life_time_value/5120_LTV_BAS_ltv_cac.sql"

Life-Time Value

Add this code to enable LTV analysis and determine LTV to CAC ratios by creating the following tables:

  • [drp.ltv_time_series]

  • [drp.ltv_cac]

Create the [drp.ltv_time_series] table

Create the [drp.ltv_cac] table

Last updated