Clinical Trials & Research Analytics Path · Mission 3 of 25Easy

Withdrawal reasons breakdown

Filter on a status enum and group on a TEXT reason column. Practice WHERE on a categorical status field, GROUP BY on a free-text dimension, and ranked output — the standard data-quality and patient-retention diagnostic.

The Brief

Lin ParkClinical Research Coordinatorslack-dm

DSMB meets Friday and they always ask about withdrawals. From fact_enrollments, give me a breakdown of every distinct withdrawal_reason for patients with status = 'withdrawn' — withdrawal_reason and withdrawn_count, sorted by count descending, then reason ascending as tiebreaker. Skip the 'screen_fail' status — those are pre-randomization and tracked separately on the screening report. We only want post-randomization withdrawals here.

You'll practice

WHERE filterGROUP BYNULL handling

Tables & columns available

fact_enrollmentsfact8 columns
ColumnTypeKey
enrollment_idINTPK
trial_idINTFK → dim_trials
protocol_idINTFK → dim_protocols
patient_idINTFK → dim_trial_patients
site_idINTFK → dim_sites
enrolled_dateTEXT
statusTEXT
withdrawal_reasonTEXT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Single-table filtered aggregate. fact_enrollments has a status enum; the briefing's 'withdrawn' is one specific value of it (case-sensitive). Other statuses (screen_fail, completed, active) are excluded.

Hint 2

Group on the withdrawal_reason TEXT column. Aggregate is a row count; name it for the metric.

Hint 3

Sort by the count descending, with the reason text as the alphabetic tiebreaker. Six to eight distinct reasons appear in practice.