I'm doing segments based on SQL and UNIONs, so ie.
- first I determine everyone having interest in product group X based on 'website interaction'
- next I determine everyone having interest in product group X based on 'social media interaction'
This functions nicely but so far I've only collected values for these fields
the id (primary key)
the email
using this SQL
SELECT
id,
email
FROM subscribers (...)
UNION
SELECT
id,
email
FROM subscribers (...)
Now I'd like to extend my Data Extension with a field for each source telling me why each subscriber actually qualifies - ending up with these fields
the id (primary key)
the email
the sourceWebsite
the sourceSocialMedia
using this SQL
SELECT
id,
email,
'YES' AS sourceWebsite,
'' AS sourceSocialMedia
FROM subscribers (...)
UNION
SELECT
id,
email,
'' AS sourceWebsite,
'YES' AS sourceSocialMedia
FROM subscribers (...)
I'm not quite there yet. This gives me a YES in either sourceWebsite or in sourceSocialMedia.
Would I be able to re-write my SQL UNION exemplified above differently in order for me to know if a subscriber qualifies from both sourceWebsite and sourceSocialMedia?
Thank you so much :)