data // SQLPRODUCTION
CASE-Based Business Segmentation
Translate explicit business rules into a readable segment label.
sqlcasesegmentationbusiness rules
Trust & provenancePRODUCTION
Evidence tierPRODUCTIONOfficial sources0Other sources0Last verified2026-10-05
Evidence tier describes my hands-on relationship with the content. Official sources describe platform contracts/documentation. Production observations should not automatically be treated as official limits.
A target DE needs one auditable classification per row.
SELECT
SubscriberKey,
CASE
WHEN Clicked120D = 1 THEN 'ENGAGED_CLICK'
WHEN Opened120D = 1 THEN 'ENGAGED_OPEN'
WHEN Status = 'Unsubscribed' THEN 'UNSUBSCRIBED'
ELSE 'INACTIVE'
END AS Segment
FROM [Customer_Engagement]CASE keeps business precedence visible in one expression and is easy to review with stakeholders.
CASE is evaluated top-down. Put the most specific or highest-priority condition first.