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.

Recommended models

claudegpt-4ogemini

More in Data Analysis & SQL