Aftermarket_Reporting_Master - Step 1

PHOTO EMBED

Tue Feb 14 2023 21:55:14 GMT+0000 (Coordinated Universal Time)

Saved by @rogerstamara

SELECT s.SubscriberKey, s.eventdate AS SendDate, LanguageCode,

CASE 
WHEN Additional_Information__c  = 'Financing Options' THEN  'Finance'
WHEN  Additional_Information__c = 'Extended Protection' THEN 'Protection'
WHEN  Additional_Information__c = 'Extended Protection or Insurance Options' THEN 'Protection'
WHEN  Additional_Information__c = 'Parts Information' THEN 'Parts'
WHEN  Additional_Information__c = 'Service Options' THEN 'Service'
WHEN  Additional_Information__c is null THEN 'Default'
ELSE 'Default' END as EmailType,

EmailName, s.TriggeredSendCustomerKey

FROM _Sent s
LEFT JOIN _Job j ON j.JobID = s.JobID
LEFT JOIN [ep_en_us_aftermarket_nurture_p-2511_0221] m ON m.SubscriberKey = s.SubscriberKey

Where s.TriggeredSendCustomerKey in ('80510','142092','142093')
AND DATEDIFF(m,getdate(),s.eventdate) = -1
content_copyCOPY