Teardown: the NLQ box in analytics, done right
A teardown of the “Ask data” box. How to turn quick NLQ answers into auditable claims with tests, costs, and robustness checks.

This is a teardown of the “Ask data” box in analytics. It is for product managers who use natural-language queries and want fast, actionable answers without weak signals. By the end, you will have a workflow that turns each answer into a claim you can audit, test, and stress. You will also see how to balance speed with correctness.
- Separate the claim from its provenance. Show the minimal SQL and data slices that produced it.
- Require a hypothesis and trigger a small confirmatory test. Do not ship on a single free-text answer.
- Use quick approximations for triage. Use exact, auditable queries for ship decisions.
- Show counterfactuals and simple robustness checks next to the answer.
- Surface query cost, latency, and row-count so you can weigh speed vs correctness.
What goes wrong with ‘Ask data’
- Plausible stories hide sampling, joins, and attribution rules.
- Lookbacks and windows are implicit. A result flips when the window shifts.
- Labels are messy. A single
utm_campaigncan be used in many ways. - Bias sneaks in. Heavy users dominate. Internal traffic slips through.
- Latency and cost are invisible. You do not know if the answer is a sketch or the truth.
Steps to rebuild the NLQ workflow
Always render answers in two parts. First, a one-line claim. Second, the minimal SQL and filters that produced it. Include the exact window, attribution rule, and any sampling notes. Keep it short enough to scan.
Replace free-text with a prompt that asks for a testable hypothesis. For example: “Is X associated with the spike?” picks a pre-built association test and the correct slice.
Use sketches to narrow suspects. Approximate counts, sampled joins, and pre-aggregates are fine for first pass. Label them as such and show the row-count used.
When the decision matters, run the exact, auditable query. Show the full row-count. Log the SQL. Make it easy to rerun.
Auto-run two or three toggles: change the window, exclude the top 1% of users, and try an alternative attribution rule. Show how the claim moves.
Surface query cost, latency, and the rows scanned. Let the PM choose faster vs stricter runs. Do not hide the trade-off.
Mark when answers depend on derived fields or lookbacks longer than 30 days. Show a warning if labels are sloppy or merged.
List the top contributing cohorts. Give counts, not only percentages. This helps spot bias from heavy users or internal traffic.
Good vs bad: NLQ answer design
| Pattern | Good | Bad |
|---|---|---|
| Claim format | One-line claim + provenance panel | Free-form paragraph with no query |
| Query detail | Minimal SQL slice, window, attribution rule | Hidden joins, unknown sampling |
| Hypothesis | Template prompts trigger a specific test | Open-ended chat invites story time |
| Robustness | Counterfactuals and quick toggles shown | Single number with no checks |
| Cost and latency | Visible and selectable by the PM | Opaque; speed and accuracy mixed |
| Output units | Counts and percents, both | Percents only, no N |
Worked example: “Why did signups spike on Nov 3?”
You ask the NLQ box: “Why did signups spike on Nov 3?” The system does not answer with a story alone. It returns a claim and its slice, then shows quick checks.
Spike driven by referral campaign.
- 64% of spike-day signups had
utm_campaign = 'nov-launch'. - Sample N = 1,842; p-value for difference = 0.03.
Association test on spike-day signups vs 7-day baseline.
-- minimal slice, parameterized spike day
WITH spike AS (
SELECT user_id, utm_campaign
FROM signups
WHERE signup_date = :spike_day
), baseline AS (
SELECT user_id, utm_campaign
FROM signups
WHERE signup_date BETWEEN :spike_day - INTERVAL '7 day'
AND :spike_day - INTERVAL '1 day'
)
SELECT utm_campaign,
COUNT(*) AS spike_count,
-- compare to baseline share using a proportion test
proportion_test(spike.utmc_share, base.utmc_share) AS p_value
FROM spike JOIN ... -- minimal join if needed
GROUP BY utm_campaign
ORDER BY spike_count DESC;
Attribution: last non-direct touch. Sampling: none.
- Exclude internal traffic: result unchanged.
- Extend window ±3 days: effect drops to 36%.
- Alternative attribution (first touch): shown alongside.
- Top contributing cohort: referral campaign users.
- Heavy-user exclusion toggle available.
- Row-count displayed with each slice.
First, a fast sampled scan for triage. Then, an exact rerun for ship. Cost, latency, and rows scanned are surfaced so you can pick.
What to do with this result. In triage, you can brief marketing and check the campaign settings. For a ship decision, rerun the exact query, record the SQL, and include the robustness panel in the note. The move from 64% to 36% under a wider window is a sign to treat the claim as context, not proof.
Trade-offs to copy
- Show provenance with each claim.
- Offer 2–3 quick robustness tests by default.
- Indicate cost, latency, and row-count for each run.
- Require a hypothesis template for confirmatory queries.
- Full natural-language answers that omit the query.
- Single-number explanations without counts.
- Hiding sampling and filters.
- Treating NLQ outputs as definitive without tests.
Common mistakes to watch
- Trusting small-sample patterns. Ask for N every time.
- Ignoring attribution windows. Test first-touch vs last-touch.
- Overfitting to labels.
utm_campaignand others are often sloppy. - Shipping features based on a single NLQ result.
Checklist: what the system must return
- SQL or engine-level filters for the exact slice used.
- Two auto-run robustness checks with their outcomes.
- Sample size and the top contributing cohorts.
- Flags if the answer depends on derived fields or lookbacks longer than 30 days.
- Visible query cost, latency, and rows scanned.
How to put this into your product
- Change the answer view to a two-pane layout: Claim and Provenance.
- Swap the chat box for hypothesis templates that map to tests.
- Add a triage mode (sampled) and a ship mode (exact).
- Bake in three toggles: window, heavy-user exclusion, attribution rule.
- Show cost, latency, and row-count chips for each run.
- Log the SQL and settings with each saved insight.
Do this and your “Ask data” box stops telling tidy stories. It starts producing claims you can defend, test, and revisit. That is what you need when the stakes are real.


