This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
e.SubscriberId, | |
e.Status, | |
e.DateJoined, | |
e.DateUnsubscribed, | |
e.EmailAddress, | |
e.BounceCount AS Bounces, | |
COUNT(d.SubscriberID) AS 'Sent' | |
FROM _Subscribers e | |
LEFT JOIN _Sent d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
e.SubscriberID, | |
g.AllClicks, | |
r.AllOpens, | |
a.UniqueOpens, | |
y.UniqueClicks | |
FROM _Subscribers e | |
JOIN ( | |
SELECT SubscriberID, COUNT(SubscriberID) AS 'AllClicks' FROM _Click GROUP BY SubscriberID | |
) g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SubscriberID, | |
CAST(UniqueOpens AS DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'UniqueOpenRate', | |
CAST(UniqueClicks AS DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'UniqueCTR', | |
CAST(AllOpens AS DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'AllOpenRate', | |
CAST(AllClicks AS DECIMAL(18,2)) / CAST(Sent AS DECIMAL(18,2)) * 100 AS 'AllCTR' | |
FROM Performance_Subscriber | |
WHERE Sent > 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat="server"> | |
Platform.Load("core", "1.1.1"); | |
var api = new Script.Util.WSProxy(); | |
try { | |
var FolderName = "Reporting"; | |
var FolderAttributes = Folder.Retrieve({ Property: "Name", SimpleOperator: "equals", Value: FolderName }); | |
var FolderID = FolderAttributes[0].ID; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
FORMAT(DATEADD(d,-1,GETDATE()),'MMM dd yyyy') AS 'Date', | |
DATEADD(d,-1,GETDATE()) AS 'DateStamp', | |
FORMAT(DATEADD(d,-1,GETDATE()),'MMMM, yyyy') AS 'Month', | |
(SELECT COUNT(SubscriberID) FROM _Subscribers WHERE DateJoined >= DATEADD(d,DATEDIFF(day, 1, GETDATE()),0) AND DateJoined < DATEADD(d,DATEDIFF(day, 0, GETDATE()),0)) AS 'NewSubscribers', | |
(SELECT COUNT(SubscriberID) FROM _Subscribers WHERE DateUnsubscribed >= DATEADD(d,DATEDIFF(day, 1, GETDATE()),0) AND DateUnsubscribed < DATEADD(d,DATEDIFF(day, 0, GETDATE()),0)) AS 'Unsubscribes', | |
(SELECT COUNT(SubscriberID) FROM _Subscribers WHERE Status = 'active' AND DateJoined < DATEADD(d,DATEDIFF(day, 1, GETDATE()),0)) AS 'ActiveSubscribers', | |
(SELECT COUNT(SubscriberID) FROM _Sent WHERE EventDate >= DATEADD(d,DATEDIFF(day, 1, GETDATE()),0) AND EventDate < DATEADD(d,DATEDIFF(day, 0, GETDATE()),0)) AS 'Sent', | |
(SELECT COUNT(SubscriberID) FROM _Open WHERE EventDate >= DATEADD(d,DATEDIFF(day, 1, GETDATE()),0) AND EventDate < DATEADD(d,DATEDIFF(day, 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 9223372036854775807 | |
NewSubscribers, Date, Unsubscribes, Sent, Opens, Clicks, Bounces, DateStamp, Month, ActiveSubscribers | |
FROM Account_Health_Daily | |
ORDER BY DateStamp DESC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
Month, | |
SUM(SentCount) AS 'Sent', | |
SUM(NewSubscribers) AS 'NewSubscribers', | |
SUM(Unsubscribes) AS 'Unsubscribes', | |
SUM(BounceCount) AS 'Bounces', | |
SUM(NewSubscribers) - SUM(Unsubscribes) AS 'NetGrowth', | |
MIN(DateStamp) AS 'MonthStamp' | |
FROM Account_Health_Daily | |
GROUP BY Month |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT e.ActiveSubscribers, d.Month | |
FROM Account_Health_Daily e | |
INNER JOIN Account_Health_Monthly d | |
ON d.MonthStamp = e.DateStamp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
e.Month, | |
CAST(SUM(d.Opens) as DECIMAL(18,2)) / CAST(SUM(d.Sent) AS DECIMAL(18,2)) * 100 AS 'UniqueOpenRate', | |
CAST(sum(d.Clicks) AS DECIMAL(18,2)) / CAST(SUM(d.Sent) AS DECIMAL(18,2)) * 100 AS 'UniqueCTR', | |
CAST(e.NetGrowth AS DECIMAL(18,2)) / CAST(e.ActiveSubscribers AS Decimal(18,2)) * 100 AS 'PercentGrowth' | |
FROM Account_Health_Monthly e | |
JOIN Account_Health_Daily d | |
ON e.Month = d.Month | |
WHERE d.SentCount > 0 | |
GROUP BY e.Month, e.NetGrowth, e.ActiveSubscribers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Top 1 | |
FORMAT(DATEADD(d,-1,e.DateStamp),'MMM dd yyyy') AS 'Date', | |
DATEADD(d,-1,e.DateStamp) AS 'DateStamp', | |
FORMAT(DATEADD(d,-1,e.DateStamp),'MMMM, yyyy') AS 'Month', | |
(SELECT COUNT(SubscriberID) FROM _Subscribers WHERE DateJoined >= DATEADD(d,DATEDIFF(day, 1, e.DateStamp),0) AND DateJoined < DATEADD(d,DATEDIFF(day, 0, e.DateStamp),0)) AS 'NewSubscribers', | |
(SELECT COUNT(SubscriberID) FROM _Subscribers WHERE DateUnsubscribed >= DATEADD(d,DATEDIFF(day, 1, e.DateStamp),0) AND DateUnsubscribed < DATEADD(d,DATEDIFF(day, 0, e.DateStamp),0)) AS 'Unsubscribes', | |
(SELECT COUNT(SubscriberID) FROM _Subscribers WHERE Status = 'active' AND DateJoined < DATEADD(d,DATEDIFF(day, 0, e.DateStamp),0)) AS ActiveSubscribers, | |
(SELECT COUNT(SubscriberID) FROM _Sent WHERE EventDate >= DATEADD(d,DATEDIFF(day, 1, e.DateStamp),0) AND EventDate < DATEADD(d,DATEDIFF(day, 0, e.DateStamp),0)) AS 'Sent', | |
(SELECT COUNT(SubscriberID) FROM _Open WHERE EventDate >= DATEADD(d,DATEDIFF(day, 1, e.DateStamp),0) AND EventDate < D |
OlderNewer