PlaybookPrompts

Reconstruct the calculation logic behind a reported number

Data & Analysis metric-definitionsqldocumentationdata-governance

Inherited dashboards often show metrics with no documentation of how they are calculated. Before you can trust or replicate a number, you need to reverse-engineer the logic—this prompt walks through that systematically.

Prompt
I have a reported metric that I need to understand and replicate, but there is no documentation for how it is calculated. Here is what I know:

- Metric name as it appears in the report: {{METRIC_NAME}}
- The value(s) reported: {{REPORTED_VALUES}} (include date range or segment if known)
- Data sources I have access to: {{AVAILABLE_DATA_SOURCES}}
- Any related metrics shown alongside it in the same report: {{RELATED_METRICS}}
- Business context (what team owns this, what decision it informs): {{BUSINESS_CONTEXT}}

Please do the following:

1. Based on the metric name and context, propose 2–3 plausible calculation definitions (e.g., for 'active users': distinct users with any event vs. users with a qualifying event vs. users with sessions above a length threshold).
2. For each definition, write the corresponding SQL pseudocode using placeholder table names so I can adapt it to my actual schema.
3. Suggest a verification approach: how would I know which definition is correct? Describe what test or cross-check I should run (e.g., compare the result against a related metric, ask a specific question to the original report owner).
4. List the 5 most common reasons a replicated metric diverges from the original (timezone handling, deduplication logic, inclusion of nulls, filter order, etc.) so I can check each one.
5. Produce a one-paragraph documentation draft I can save once I confirm the correct definition, written so a new analyst can understand it without asking follow-up questions.
Variables to fill in
  • {{METRIC_NAME}}
  • {{REPORTED_VALUES}}
  • {{AVAILABLE_DATA_SOURCES}}
  • {{RELATED_METRICS}}
  • {{BUSINESS_CONTEXT}}

How to use this prompt

  1. Copy the prompt above (Copy button on the top-right).
  2. Replace each {{VAR}} with your own value. Variables: {{METRIC_NAME}}{{REPORTED_VALUES}}{{AVAILABLE_DATA_SOURCES}}{{RELATED_METRICS}}{{BUSINESS_CONTEXT}}.
  3. Paste it into one of the recommended tools below.
  4. Iterate: tighten constraints in the prompt if the output is generic.

Why this prompt is structured this way

The prompt is split into explicit steps because LLMs do better when the path is named, not implied. Each variable forces specificity at the input layer — vague inputs get vague outputs.

Heads up: some of the links on this page are affiliate links — meaning we may earn a commission if you sign up after clicking, at no extra cost to you. We only recommend tools we'd put on our own stack. You can see our full affiliate disclosure here.

Pair this prompt with a tool

The PlaybookPrompts weekly

One short email per week. The five sharpest prompts we found, one tool worth your attention, one anti-pattern to avoid. Unsubscribe in one click.

Newsletter signup is not configured. Set PUBLIC_NEWSLETTER_USERNAME in the build env.