2

i have been trying to work on a query which returns subscribers who have not opened an email within the last 60 days. However my query returns all the opens they have done in the last 60 days.

i am using the _open data view.

i think i have to do a join to another view to determine have they been sent and have they opened in the last X days.

Hope someone can point me in the right direction TIA

3 Answers 3

5

Try this:

SELECT 
  s.SubscriberKey,
  s.EventDate AS Sent_Date,
  'False' AS Opened
FROM _Sent s
LEFT JOIN _Open o
ON s.SubscriberKey = o.SubscriberKey
  WHERE o.SubscriberKey IS NULL 
        AND CAST(s.EventDate AS DATE) >= CAST(DATEADD(dd, -60, CURRENT_TIMESTAMP) AS DATE) 
        AND CAST(s.EventDate AS DATE) < CAST(CURRENT_TIMESTAMP AS DATE)

This will return all sent emails in the last 60 days that have not opened any emails.

What it does is it brings in the last 60 days worth of sends and LEFT JOINS the _Sent data view with the _Open data view where there is no match, In theory this would mean the subscriber never opened an email in the last 60 days because they did not exist in the _Open data view.

2
  • Happy to help @AndrewC Commented Aug 15, 2017 at 2:31
  • I have three questions on this solution: 1. Is the CAST call required? As the field types are already DATE/TIME 2. Is the last call required? Since the first data statement covers the second as well? 3. Does this take FOREVER to run? Commented Sep 21, 2017 at 18:19
0

You are right. _Open only captures the Open events. It will not have the 'not-opened' ones. So you'll have to do a MINUS between _Sent and _Open on the combination of JobID and SubscriberId

0
-1

SELECT DISTINCT s.SubscriberKey, s.SubscriberId AS EmailId, s.jobid

FROM _Sent s LEFT JOIN _Open o ON s.SubscriberKey = o.SubscriberKey AND o.IsUnique = 1 WHERE o.SubscriberKey IS NULL

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jul 22 at 7:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .