Skip to content

Instantly share code, notes, and snippets.

@wvpv
Created January 26, 2021 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvpv/1f5073822feb8f3bc28d80b168c6a5f0 to your computer and use it in GitHub Desktop.
Save wvpv/1f5073822feb8f3bc28d80b168c6a5f0 to your computer and use it in GitHub Desktop.
SFMC unsubscribes per business unit
select
u.BusinessUnitID businessUnitMID
, u.SubscriberKey
, u.subscriberId
, 'unsubscribed' Status
, u.UnsubDateUTC DateUnsubscribed
, case
when u.businessUnitID = 1 then 'Business Unit Name 1'
when u.businessUnitID = 2 then 'Business Unit Name 2'
when u.businessUnitID = 3 then 'Business Unit Name 3'
when u.businessUnitID = 4 then 'Business Unit Name 4'
when u.businessUnitID = 5 then 'Business Unit Name 5'
end businessUnitName
FROM _BusinessUnitUnsubscribes u
/* name: subscribers_all_unsubs */
/* target: subscribers_all */
/* action: update */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment