1

I have the issue that the customer wants to see an overview of sent email count and bounced count by Business Unit (and they will have thousands).

So I created Queries for that which work fine for _Bounce but they don't for _Sent and I have no idea where the difference would be. Here comes the two queries:

Bounce (works fine):

SELECT OYBAccountID, count(SubscriberKey) as BounceCount 
FROM _Bounce 
WHERE AccountID = '6270127' AND BounceType = 'Hard bounce' 
GROUP BY OYBAccountID

Sent (fails):

SELECT OYBAccountID, count(SubscriberKey) as SentCount 
FROM _Sent 
WHERE AccountID = '6270127' 
GROUP BY OYBAccountID

Any idea?

2
  • welcome to sfse Carsten! I took the liberty to make your question a little bit more readable. Code/queries can be formatted by using the {} button in the editor. Commented Jul 3, 2014 at 11:11
  • Can you post the exact error you're getting?
    – Timothy
    Commented Jul 3, 2014 at 13:59

1 Answer 1

1

Actually, the bounce query should include 'BounceCategory', and not 'BounceType' as it does not provide info on Hard or Soft bounces but instead will report on whether the bounce occured as 'delayed' or 'immediate'. The help documentation on bounces illustrates 'BounceCategory' as the field which will record the 5 specific bounce type categories.

SELECT OYBAccountID, count(SubscriberKey) as BounceCount 
FROM _Bounce 
WHERE AccountID = '6270127' AND BounceCategory = 'Hard bounce'
GROUP BY OYBAccountID

As for the SentCount per OYBAcountID, the query looks fine and should work if you use the correct data types for the fields (OYBAccountID and SentCount) in the resultant data extensions. If your query's 'update type' is set to 'overwrite' and number is set as the datatype for both fields, make both fields as 'nullable' in the data extension.

You must log in to answer this question.

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