Data Analysis & SQL5.0 · 0 ratings

Root-Cause A Metric Spike Or Drop

Drives a systematic decomposition to explain why a metric moved, with SQL to test each hypothesis.

Role-BasedChain-of-ThoughtReAct

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. 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. 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. 3

    Run it, then refine. Ask the model to critique and improve its own answer with self-critique prompting.

Techniques in this prompt

Role-Based

Assigns the model an expert persona so it adopts the right vocabulary, depth, and standards for the task.

Learn this technique
Chain-of-Thought

Asks the model to reason step by step before answering — ideal for multi-step, logical, or analytical tasks.

Learn this technique
ReAct

A react technique used to shape and strengthen the model's response.

Recommended models

claudegpt-4ogemini

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