Root-Cause A Metric Spike Or Drop
Drives a systematic decomposition to explain why a metric moved, with SQL to test each hypothesis.
Prompt
ROLE: You are an analyst leading an investigation into an unexpected metric movement. CONTEXT: [METRIC_NAME] [rose/fell] by [MAGNITUDE] between [PERIOD_A] and [PERIOD_B]. Available tables: [SCHEMA]. Known recent changes (releases, pricing, marketing, data pipeline): [KNOWN_CHANGES]. Engine: [DATABASE_ENGINE]. TASK (reason explicitly): 1. First rule out a data/instrumentation artifact (pipeline delay, tracking change, dedup change, timezone shift). Give a SQL check for each. 2. Decompose the metric into its drivers (e.g., revenue = users x conversion x AOV) and quantify which driver moved most. 3. Segment the move by dimension (geo, platform, plan, new vs returning) to localize it. 4. Form a ranked list of hypotheses with a SQL test for each and the result that would confirm or reject it. 5. State the most likely cause and your confidence, plus what evidence would change your mind. OUTPUT FORMAT: Artifact checks -> Driver decomposition table -> Segmentation findings -> Ranked hypotheses with tests -> Conclusion & confidence. CONSTRAINTS: Always check for data artifacts before behavioral explanations. Quantify contributions; do not hand-wave. Distinguish correlation from cause. Note any segment too small to be significant.
How to use this prompt
- 1
Copy the prompt above and paste it into ChatGPT, Claude, or Gemini — or open it in the visual Studio to edit each part on a canvas and run it with your own key.
- 2
Replace any bracketed placeholders with your specifics. The more concrete your context and constraints, the sharper the result — see the 5-part prompt structure.
- 3
Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.
Techniques in this prompt
Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.
Learn this techniqueAsks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.
Learn this techniqueA react technique used to shape and strengthen the model's response.
Recommended models
Build on this prompt
Open it in the visual Studio to wire it into a full workflow with your own API key — or learn the craft behind prompts like this.
More in Data Analysis & SQL
Translate Business Questions Into SQL
Turns a plain-English stakeholder question into a correct, well-commented SQL query against a known schema.
Optimize A Slow SQL Query
Diagnoses why a query is slow and rewrites it with targeted, explained optimizations and an index plan.
Debug A SQL Query That Returns Wrong Results
Systematically finds the logic error producing incorrect numbers and delivers a corrected, verified query.
Explain An Unfamiliar SQL Query In Plain English
Reverse-engineers a complex inherited query into a clear narrative, business meaning, and risk list.