data // SQLPRODUCTION

CASE-Based Business Segmentation

Translate explicit business rules into a readable segment label.

sqlcasesegmentationbusiness rules
Context Pack →Open Workspace →
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.

EvidencePRODUCTION
Difficultyfoundation
Verified2026-10-05
Use when

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]
Why it works

CASE keeps business precedence visible in one expression and is easy to review with stakeholders.

Operational notes

CASE is evaluated top-down. Put the most specific or highest-priority condition first.