Views - Targeted Customers


Views are out-of-the-box data queries on top of the base structure of the data, providing easy access to common use cases required datasets and additional data useful to exploit the data lakes product fully.

Using views, Data lakes evolve while providing you with data contracts that will be kept and enable stable integrations with your internal platforms.



VW_TARGETED_AND_EXCLUDED_CUSTOMERS (v1.1)

-- FOR V1.1
SELECT *
FROM [SHARED_DB].[BI].[VW_TARGETED_AND_EXCLUDED_CUSTOMERS]

This view provides a more organized view of scheduled campaigns data. This view will be kept in this structure and can be used to integrate additional tools to it.

Field NameDescriptionData TypeFormat
EXECUTION_DATEDate of executionDateYYYY-MM-DD
CUSTOMER_IDUnique identifier for customersString
LIFECYCLE_STAGEStage in the lifecycleString
PLAN_IDUnique identifier for the planInteger
PLAN_DETAIL_IDUnique identifier for plan detailInteger
ACTION_NAMEName of the actionString
TAKEN_FROM_PLAN_IDPlan ID from which the action was taken. If this is NULL this is the plan this customer was targeted withInteger
EXCLUSION_REASON_IDUnique identifier for exclusion reasonInteger
EXCLUSION_REASONReason for exclusionString
EXCLUSION_REASON_DESCDescription of exclusion reasonString
LAST_UPDATED_TIMETimestamp of the last updateDateTimeYYYY-MM-DD HH:MM

Common use cases -

What campaigns are planned for next week?

SELECT DISTINCT
    PLAN_ID,
    MARKETING_ACTION_NAME,
    EXECUTION_START_DATE,
    EXECUTION_END_DATE
FROM
    VW_SCHEDULED_CAMPAIGNS
WHERE
    EXECUTION_START_DATE >= DATEADD(DAY, 7, CURRENT_DATE())
    AND EXECUTION_START_DATE < DATEADD(DAY, 14, CURRENT_DATE());

Which channels are about to execute campaigns tomorrow?

SELECT DISTINCT
    PLAN_ID,
    PLAN_DETAIL_ID,
    PLAN_DETAIL_CHANNEL_ID,
    MARKETING_ACTION_NAME,
    EXECUTION_START_DATE,
    EXECUTION_END_DATE
FROM
    YourTableName
WHERE
    EXECUTION_START_DATE = DATEADD(DAY, 1, CURRENT_DATE());