I am trying to bring in sql query a number of Clicks and Opens per Subscriberkey in a Journeyname, for example. So far, I did something like bellow, but I couldn't group by Subscriberkey and bring the clicks/opens.
Could anyone help me? Thanks a lot! :)
SELECT distinct
job.JobID AS JobID,
ja.JourneyActivityObjectID AS JourneyActivityObjectID,
s.SubscriberID AS SubscriberID,
s.SubscriberKey AS SubscriberKey,
sub.EmailAddress AS EmailAddress,
sub.Status AS SubscriptionStatus,
j.JourneyName AS JourneyName,
job.EmailName AS EmailName,
job.EmailSubject AS EmailSubject,
job.FromName AS FromName,
job.FromEmail AS FromEmail,
s.TriggererSendDefinitionObjectID as TriggererSendDefinitionObjectID,
s.TriggeredSendCustomerKey as TriggeredSendCustomerKey,
s.EventDate AS DataEnvio,
job.DeliveredTime AS DataEntrega,
c.IsUnique
FROM _Sent s
LEFT JOIN _Job AS job
ON job.JobID = s.JobID
LEFT JOIN _JourneyActivity AS ja
ON ja.JourneyActivityObjectID = s.TriggererSendDefinitionObjectID
LEFT JOIN _Journey AS j
ON j.VersionID = ja.VersionID
LEFT JOIN _Subscribers AS sub
ON sub.SubscriberKey = s.SubscriberKey
LEFT JOIN _Click AS c
ON c.JobID = job.JobID and IsUnique = 1
WHERE j.JourneyName = 'Journey_Name'