PromptMake
2026-06-25·17 min read

AI Prompts for Data Analysis: Structured Insights from Raw Data

JSON schema output, hypothesis-first vs explore-first prompts, sanity checks, and [VERIFY] flags — turn CSV paste into trend, anomaly, and cohort insights with Claude Opus 4.8 and Gemini.

text-promptsguidechatgptclaudegemini

Generate optimized prompts for ChatGPT, Claude & more

Free prompt generator — no account needed.

Try Prompt Generator →

Paste a CSV into ChatGPT and ask "what trends do you see?" You get a confident narrative about growth in Q3. Your spreadsheet has no Q3 column. The model narrated a plausible story over noise. Data analysis prompting in 2026 means structured output, explicit schemas, sanity checks, and [VERIFY] flags — not open-ended "analyze this." This guide covers JSON schema output, model routing (Claude Opus 4.8 / Gemini 3.1 Pro for hard analysis, Gemini 3.5 Flash for extract/classify), CSV paste constraints, hypothesis-first vs explore-first prompts, sanity check steps, analysis templates, and FAQ.

Two analysis modes

Hypothesis-first: you state expected patterns; model tests against data. Reduces narrative hallucination. Explore-first: you want open discovery; model must label confidence and flag unverified claims. Default to hypothesis-first for stakeholder reports. Explore-first for EDA with technical audience who will verify.

JSON schema output — non-negotiable for pipelines

Unstructured prose hides invented metrics. Schema forces explicit fields. Example schema: { "summary": "string", "metrics": [{ "name": "string", "value": "number|string", "calculation": "string", "verify": "boolean" }], "trends": [{ "description": "string", "evidence_rows": "string", "confidence": "high|medium|low" }], "anomalies": [{ "description": "string", "row_refs": "string", "verify": true }], "data_quality_issues": ["string"], "cannot_determine": ["string"] } Rule: Any metric without row evidence → verify: true and [VERIFY] in summary. GPT-5.5 structured output mode enforces schema. Claude Opus 4.8 follows schema in prompt when json in fences specified.

CSV paste constraints

Models miscount rows and misparse delimiters. Paste header: DATA FORMAT: CSV, comma-separated, UTF-8 ROWS: [state count — e.g. 1,247 data rows excluding header] COLUMNS: [list names and types] DATE RANGE: [min date] to [max date] if applicable MISSING VALUES: represented as empty cell / NA / null — specify which Then paste data or attach file. Add: If row count after parse ≠ stated ROWS, halt and report PARSE ERROR. For large CSV: sample stratified rows + full column stats computed externally, or use code interpreter / API — not raw 500k-row paste.

Sanity check step

Before analysis output, model runs: SANITY CHECK: - Row count matches? - Column names match spec? - Date range within stated bounds? - Any duplicate primary keys? Output sanity block first. If fail → stop, no insights. Catches 80% of garbage-in-garbage-out before narrative starts.

[VERIFY] flags

Any claim the model cannot tie to specific rows/cells gets [VERIFY]. Prompt: You may not state numeric facts without citing row numbers or column aggregates shown in your work. Show calculation steps for every metric in metrics[].calculation. Human analyst confirms all [VERIFY] items before deck goes to exec.

Hypothesis-first prompt template

DATA: [CSV with constraints header] HYPOTHESES TO TEST: H1: [e.g. churn increased MoM after March price change] H2: [e.g. enterprise segment drives ARPU lift] RULES: - For each H: SUPPORTED | REFUTED | INSUFFICIENT DATA with evidence - Show SQL-like or pandas-like logic in plain English with row refs - JSON matching schema: [paste schema] - cannot_determine lists hypotheses data cannot test Claude Opus 4.8 for rigorous hypothesis testing. Gemini 3.1 Pro for wide tables.

Explore-first prompt template

DATA: [CSV with constraints] TASK: Exploratory analysis — patterns, anomalies, data quality RULES: - confidence on every trend (high/medium/low) - No causal claims — correlation language only - [VERIFY] on any aggregate you did not show calculation for - JSON schema: [paste]

Explore-first produces more [VERIFY] flags — expected, not failure.

Trend analysis template

METRIC: [e.g. weekly active users]

DIMENSION: [optional segment column]

PERIOD: [granularity]

OUTPUT JSON trends[] with:

  • direction (up/down/flat)
  • magnitude (% change with formula)
  • evidence_rows or date range
  • seasonality note if visible

Add: If < 8 periods, mark seasonality INSUFFICIENT DATA.

Anomaly detection template

Scan column [X] for outliers using IQR or z-score — state method.

For each anomaly:

  • row id(s)
  • value vs expected range
  • possible data quality vs genuine outlier (label, do not conclude)

Never delete anomalies in prompt — flag only.

Cohort analysis template

COHORT DEFINITION: [e.g. users by signup month]

RETENTION WINDOW: [weeks 0–12]

OUTPUT:

cohort_table: rows=cohort month, cols=period, values=retention %

calculation: unique users active in period / cohort size

Flag cohorts with < 30 users as SMALL N.

Show cohort table in JSON + markdown for readability.

Extract and classify (Flash tier)

Gemini 3.5 Flash for high-volume row labeling:

For each row, classify support_ticket_text into: billing | bug | feature | other

Output: row_id | category | confidence

Batch 100 rows per call. Aggregate counts externally.

Do not ask Flash for multi-step statistical inference — extract/classify only.

Hard analysis (Opus / Gemini 3.1 Pro tier)

Claude Opus 4.8: multi-hypothesis testing, complex cohort logic, sanity + JSON in one pass

Gemini 3.1 Pro: very wide CSV (50+ columns), multi-file joins described in prompt

GPT-5.5: structured output pipelines, dashboard-ready JSON

Route: Flash extract → Pro/Opus analyze aggregated outputs.

Show your work pattern

Before JSON insights, require:

WORK:

  • Parsed row count: N
  • Aggregations performed: [list]
  • Sample calculations: [2–3 worked examples with row refs]

Then INSIGHTS JSON.

Reduces silent arithmetic errors.

Before vs after

Weak:

Analyze this sales data and give me insights.

[CSV paste]

Output: generic growth narrative, wrong totals, no row citations.

Strong:

Constraints header + hypothesis list + JSON schema + sanity check + [VERIFY] rules.

Output: 3 supported/refuted hypotheses, 2 trends with calculations, 4 [VERIFY] flags for human follow-up.

Data quality block in prompts

Ask model to report first:

  • Missing value counts per column
  • Obvious type mismatches (dates in number fields)
  • Duplicate keys

Populate data_quality_issues[] before insights.

Dirty data → insights labeled low confidence by default.

Segmentation analysis

SEGMENT BY: [column]

METRIC: [aggregate]

Compare segments: table with segment | metric | n | vs overall

Rule: Segments with n < 30 → label SMALL N, no ranking.

Time series pitfalls in prompts

State timezone for timestamps.

Specify fiscal vs calendar quarter.

Prompt: Do not assume complete periods — flag partial last period.

Incomplete March if data ends March 15 → note PARTIAL PERIOD.

Combining multiple CSVs

DATASET A: [schema + paste] — primary key: user_id

DATASET B: [schema + paste] — foreign key: user_id

JOIN: left join A.user_id = B.user_id

Report join match rate before analysis.

Unmatched keys → data_quality_issues.

Common failures

No row count → model guesses scale wrong

Unstructured output → invented percentages in slides

Explore-first without [VERIFY] → false causal stories

Flash for final exec summary → arithmetic errors

Pasting PII without redaction

Asking for prediction without holding out data — label SPECULATIVE

Common mistakes

Trusting confidence: high from model without checking work block

One-shot on 100k rows — sample or use code execution

Ignoring cannot_determine array in JSON

Not repeating schema at end of long prompts

Skipping human review on [VERIFY] flags

PromptMake workflow

PromptMake /text: describe columns + hypothesis → generates schema + sanity-check prompt wrapper.

Guest: 3/day. Registered: 5/day. Paste redacted sample rows only on public tier.

Export JSON schema to reuse across weekly reports.

FAQ

Hypothesis-first or explore-first?

Hypothesis-first for exec decks and decisions. Explore-first for analyst EDA with verification bandwidth.

Which model for CSV analysis?

Claude Opus 4.8 or Gemini 3.1 Pro for analysis. Gemini 3.5 Flash for extract/classify steps only.

How much CSV can I paste?

Practical limit ~2–10k rows in chat depending on columns. Larger: aggregate first or use code interpreter/API.

What are [VERIFY] flags?

Marks claims the model could not prove from cited rows. Human must confirm before publishing.

Can AI replace SQL?

AI drafts logic; analyst validates. Run equivalent SQL in warehouse to confirm aggregates.

JSON schema required?

Required for automation and to reduce hallucination. Optional prose addendum for narrative summary after JSON.

How to handle missing data?

Specify NA representation in constraints. Model reports missing counts and excludes or flags in calculations.

Can GPT-5.5 enforce schema?

Yes — use structured output / json_schema mode with strict validation.

What if sanity check fails?

Stop. Fix data or constraints. Do not proceed to insights on parse mismatch.

How to prompt trend vs anomaly in one run?

Single JSON schema with both trends[] and anomalies[]. One sanity block upfront.

Monthly reporting chain

Week 1: extract/classify with Gemini 3.5 Flash.

Week 2: aggregate CSV externally (or code interpreter).

Week 3: hypothesis-first JSON analysis on Claude Opus 4.8.

Week 4: exec narrative from verified JSON only.

Each step output feeds the next — never skip sanity block between steps.

Correlation vs causation guardrail

Prompt line: Correlation phrasing only unless randomized experiment column present.

If no control group: tag all causal language as [SPECULATIVE].

Example allowed: "Churn rate rose in same month as price change (correlation)."

Example banned: "Price change caused churn" without experiment design column.

Date parsing and timezone block

DATES: column created_at, ISO 8601, timezone UTC.

Fiscal calendar: Q1 = Feb–Apr (non-standard — state explicitly).

Prompt: Parse dates programmatically in work block; report min/max after parse.

Partial months: exclude or flag — never annualize partial month without label.

Duplicate detection prompt

PRIMARY KEY: order_id (must be unique).

TASK: Count duplicates, list top 5 duplicate keys with row refs.

If duplicates > 0: halt insights; populate data_quality_issues first.

Unit consistency checks

Columns with units: revenue_usd, weight_kg — state in constraints.

Prompt: Flag mixed units in same column (e.g. dollars and cents conflated).

Show unit assumption in every metric calculation string.

Retention curve interpretation

OUTPUT: retention by period with SMALL N flags on tail periods.

Prompt: Do not extrapolate beyond observed periods.

Survival analysis vocabulary only if censoring column explained in constraints.

Metric definition library

Maintain reusable METRIC DEFS block in prompt library:

ARPU = revenue / active_users (define active).

Churn = churned_subs / subs_start_of_period.

Paste same defs every analysis — prevents definition drift week to week.

Stakeholder question translation

Before analysis, prompt:

STAKEHOLDER QUESTION: "Are enterprise customers happier?"

TRANSLATE TO TESTABLE: Compare NPS or CSAT by segment=enterprise vs SMB; state metric column.

If no sentiment column: add to cannot_determine before running analysis.

A/B test analysis template

VARIANT A vs B columns or filtered rows.

METRIC: conversion rate = conversions / visitors.

OUTPUT: variant | metric | value | n | lift vs control | [VERIFY] if n < 100.

Rule: distinguish percentage points vs relative percent lift — show formula.

Prompt: Do not claim significance unless chi-square or z-test calculation shown in work block.

Funnel conversion template

STEPS: visit → signup → activate → pay (define column per step).

OUTPUT: step | count | step conversion % | cumulative % | drop-off vs prior step.

Flag if step definitions overlap or user can skip steps in data.

RFM segmentation template

Recency, Frequency, Monetary columns specified.

Define quintile rules in prompt or provide pre-computed scores.

OUTPUT: segment | definition | count | avg monetary | [VERIFY] on thresholds.

Code interpreter workflow

For >10k rows: upload CSV to GPT-5.5 code interpreter or run Python locally.

Prompt generates pandas script → execute → paste summary stats back into hypothesis prompt.

AI writes code; executed results are ground truth — not model mental math.

Worked example: SaaS churn CSV

Weak: "Churn improved in Q2 due to onboarding changes."

Strong: churn_rate = churned/customers_start; Q2 4.2% vs Q1 5.1% (calc shown); onboarding column not in data → cannot_determine causal link.

Executive narrative from JSON

After validated JSON insights, second prompt:

INPUT: [verified JSON only — no raw CSV]

TASK: 150-word exec summary. Every number must appear in INPUT JSON.

BAN: new metrics not in JSON.

Separates analysis rigor from storytelling.

Percent vs percentage point rule

Prompt: When comparing rates, state "X pp" for absolute difference and "Y% relative" for proportional change — never conflate.

Example: 5% → 6% is +1 pp and +20% relative — label both.

PII redaction in data prompts

Redact emails, names, account IDs before public AI paste.

Use hashed user_id in constraints. Note REDACTION APPLIED in header.

Related articles

Structured output prompting — json_schema details

Summarization prompts — citation patterns for report narratives

Claude vs ChatGPT vs Gemini — model routing

The constraints header is your data contract with the model: ROWS, COLUMNS, MISSING VALUES, and PRIMARY KEY should be as explicit as a schema migration doc. Ambiguous specs produce fluent insights that do not survive a five-minute spot-check in Excel.

For recurring dashboards, version the JSON schema and sanity-check block in git beside the SQL that produces the CSV. When a metric definition changes, update both query and prompt — not one alone.

Gemini 3.5 Flash classifies and extracts; Claude Opus 4.8 or Gemini 3.1 Pro validates hypotheses on aggregated outputs. Skipping that tier boundary is how confident wrong arithmetic reaches executive slides.

Bottom line

Data analysis prompts need constraints header, JSON schema, sanity check, show-your-work, and [VERIFY] flags.

Hypothesis-first for decisions. Opus 4.8 or Gemini 3.1 Pro for hard analysis. Flash for extract/classify. Human confirms every [VERIFY] before the deck ships.

Ready to generate your own prompts?

Free. No sign-up required. Works with all major AI models.

Related articles