live wire
▸dbt remote MCP lets read-only users query metrics with a shared warehouse credentialdbt Labs documentation▸SchemaGate drops unqualified BIRD Mini-Dev No. 1 claim after benchmark updateSchemaGate / GitHub▸Databricks previews AI_MASK v2 with built-in classifiers and per-row errors; v1 stays the defaultDatabricks documentation▸FedTriCD reports about 20 rounds vs F3KM’s 1,000 on MNIST; its 50× speedup was a separate centralized testNie et al. / arXiv▸BigQuery previews EmbeddingGemma 2 in AI.EMBED with per-token and query compute chargesGoogle Cloud documentation▸Fabric Warehouse previews on-demand billing with workspace queues and a rolling 24-hour capMicrosoft Fabric Updates Blog▸BigQuery makes TabFM 1.1 the default for AI.PREDICT and TabFM evaluations in AI.EVALUATEGoogle Cloud documentation▸Decision columns matched dense retrieval’s product-matching F1 with a shared verifier, but lagged in standalone searchKannan, Bruckner and Bernstein / arXiv▸BigQuery makes regional controls for reservation overrides and blocking on-demand query billing generally availableGoogle Cloud documentation▸Databricks adds beta lineage impact analysis; Genie Code can export affected assets and owners to CSVDatabricks documentation▸AskWise’s four-call replay scored 56.60% with original data first versus 48.77% with candidate pairs firstAskWise / GitHub▸SchemaGate v1.19.0 makes join-graph ranking opt-in after mixed schema retrieval resultsSchemaGate / GitHub▸AWS Quick adds Meta ads analytics via MCP and asks for permission before changing campaigns or budgetsAWS Artificial Intelligence Blog▸Dex v1.18.4 generates freshness and continuity tests from declarations and estimates their per-run costExmergo / GitHub▸dbt remote MCP lets read-only users query metrics with a shared warehouse credentialdbt Labs documentation▸SchemaGate drops unqualified BIRD Mini-Dev No. 1 claim after benchmark updateSchemaGate / GitHub▸Databricks previews AI_MASK v2 with built-in classifiers and per-row errors; v1 stays the defaultDatabricks documentation▸FedTriCD reports about 20 rounds vs F3KM’s 1,000 on MNIST; its 50× speedup was a separate centralized testNie et al. / arXiv▸BigQuery previews EmbeddingGemma 2 in AI.EMBED with per-token and query compute chargesGoogle Cloud documentation▸Fabric Warehouse previews on-demand billing with workspace queues and a rolling 24-hour capMicrosoft Fabric Updates Blog▸BigQuery makes TabFM 1.1 the default for AI.PREDICT and TabFM evaluations in AI.EVALUATEGoogle Cloud documentation▸Decision columns matched dense retrieval’s product-matching F1 with a shared verifier, but lagged in standalone searchKannan, Bruckner and Bernstein / arXiv▸BigQuery makes regional controls for reservation overrides and blocking on-demand query billing generally availableGoogle Cloud documentation▸Databricks adds beta lineage impact analysis; Genie Code can export affected assets and owners to CSVDatabricks documentation▸AskWise’s four-call replay scored 56.60% with original data first versus 48.77% with candidate pairs firstAskWise / GitHub▸SchemaGate v1.19.0 makes join-graph ranking opt-in after mixed schema retrieval resultsSchemaGate / GitHub▸AWS Quick adds Meta ads analytics via MCP and asks for permission before changing campaigns or budgetsAWS Artificial Intelligence Blog▸Dex v1.18.4 generates freshness and continuity tests from declarations and estimates their per-run costExmergo / GitHub
nl2sql.ai
guideSQL AGENT FIELD GUIDE

A Snowflake SQL agent can turn 75% of sales into 100% by filtering too early

To answer “What share of nationwide sales came from the West?”, keep the nationwide rows in the calculation and filter only the result.

By The News Desk· Nov 24, 2026the quick take — two AI hosts go live when you do

A user asks a SQL agent, “What share of nationwide sales came from the West last month?” Suppose the West sold $750 and the East sold $250. The answer is 75%. But a Snowflake query that filters to the West before computing RATIO_TO_REPORT can return 100%. The query runs successfully; it just answers a different question.

Snowflake defines RATIO_TO_REPORT as the current row’s value divided by the sum of values in its window partition. If the input to the window contains only the West’s $750, the denominator is $750. If the input contains both regions, the denominator is $1,000. Snowflake’s own example shows how the denominator changes when the comparison changes from a whole chain to a single province: one store contributes 25% of the chain’s profit but 100% of its province’s profit.

Filter the dates first. Filter the displayed regions last.

For this question, the date range defines what belongs in the denominator. The region defines what the reader wants to see. The example below assumes region_sales already contains one row per region for the requested month. Its $750 and $250 are illustrative, not measured data.

WITH shares AS (
  SELECT region,
         sales,
         SUM(sales) OVER () AS nationwide_sales,
         100 * RATIO_TO_REPORT(sales) OVER () AS pct_of_nationwide
  FROM region_sales
)
SELECT region, sales, nationwide_sales, pct_of_nationwide
FROM shares
WHERE region = 'West';

This returns the West row with $750 in sales, $1,000 in nationwide sales, and a 75% share. Put the West filter inside shares instead and the expected result is $750 for both sales and the denominator, with a 100% share. Showing the denominator makes the error easier to catch than displaying the percentage alone.

Give the agent a test that forces the distinction

Use a two-region fixture like the one above. Ask both “What share of nationwide sales came from the West?” and “What share of Western sales came from each Western store?” The first answer must retain other regions in the denominator even if it displays only the West. The second should restrict the comparison to Western stores. Check the denominator as well as the percentage. And keep a separate zero-total test: Snowflake documents that RATIO_TO_REPORT returns NULL when the partition sum is zero, not 0%.

Filed by The News Desk. Corrections: desk@nl2sql.ai · Our standards →

comments · 0

    Comments are moderated before they appear. Your email is used once to confirm it is you — never shown, never sold. Corrections and questions get an answer from the desk when we have one.