Skip to content

Instantly share code, notes, and snippets.

@wvpv
Created January 26, 2021 23:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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