Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Answering KPI questions in natural language

Turn a quarterly KPI question into a governed, cited answer: inspect the schema, run the query, verify the metric and source.

You have a vetted product and a key performance indicator (KPI) question: "what was quarterly revenue by customer segment?" This recipe turns that into a governed answer, with the metric and source model cited, so you can trust and reproduce the number. The journey is inspect schema → run the governed query → slice further → confirm it was governed.

What this enables:

Prerequisites: a connected client and a product you already trust. If you have not vetted one, start with Discovering the right Data Product in natural language.

Steps

Example responses below are illustrative: exact wording, fields, and figures depend on your catalog, your data, and your permissions.

1. Inspect the schema

Before asking for numbers, find out what the product can answer, so you ask for measures that exist and slice by dimensions it supports:

What metrics and measures does orders360 expose?
Sample response

Orders360 (stg tenant) exposes 4 semantic models with 23 measures, 62 dimensions, 4 time dimensions, 7 segments, and 2 top-level business metrics.

Metrics: order_volume (daily order volume by product category/customer segment), revenue_trend (daily revenue trend by customer/product category).

Key measures by model:

  • orders: total_orders, total_revenue, average_order_value, total_quantity_sold, total_discount_amount, total_shipping_cost, total_tax_collected

  • customer: total_customers, active_customers, platinum_customers, average_loyalty_score

  • customer_orders_enriched: avg_orders_per_customer, total_orders_metric, m_count, m_count_distinct, max/min_credit_score

  • products: total_products, active_products

Segments: high_value_customers, at_risk_customers, recent_signups, discounted_orders, high_value_orders, recent_orders, high_rated_products.

Dimensions span customer attributes (segment, loyalty tier, signup date), order details (date, discount, tax, shipping), and product attributes (category, brand, price, rating), plus behavioral/fraud fields (device, risk_score, is_fraud, feedback_rating).

Sample response

Yes: orders.total_revenue joins many-to-one to both customer and products, so you can slice by dimensions in any of the three.

From orders itself: order_date, quantity, unit_price, discount, tax, shipping_cost, total_amount, customer_id, product_id (plus order_date_timestamp for time granularity, and segments like discounted_orders/high_value_orders/recent_orders).

From customer (joined): customer_segment, account_status, loyalty_score, signup_date, full_name, email; plus segments like high_value_customers, at_risk_customers, recent_signups.

From products (joined): category, subcategory, brand, color, size, price, rating, stock_quantity, discontinued; plus segment high_rated_products.

So yes: orders.total_revenue sliced by customer.customer_segment is a valid query (e.g., revenue by Platinum/Gold/Silver/Bronze).

Note the packaged revenue_trend metric only exposes ts (day) as its default dimension; for a customer_segment slice you'd query the raw orders.total_revenue measure directly rather than the revenue_trend metric.

The assistant returns the queryable surface: the measures, the dimensions you can slice by, and which models join to which. Think of it as the menu before you order. This is the schema part of Understand in natural language.

2. Run the governed query

Ask the business question in plain language:

Example response:

Quarter
Customer segment
Revenue

Q1 2025

Platinum

$842,300

Q1 2025

Gold

$511,200

Q2 2025

Platinum

$901,150

Q2 2025

Gold

$529,800

The assistant translates it into a governed query against the semantic layer, applies the joins and access policies, and returns the result. Because it goes through the semantic layer, the number uses the product's own definition of revenue, not an ad-hoc recalculation. If the underlying result set is larger than the platform's row limit, the response states that output was capped, so you know to slice further rather than treat it as the full set.

3. Slice further

Follow up to refine, without rebuilding anything:

Example response:

Quarter
Product category
Revenue (Platinum)

Q1 2025

Electronics

$410,900

Q1 2025

Home & Garden

$267,400

Q1 2025

Apparel

$164,000

Same measure and joins as before, now filtered to orders.CUSTOMER_SEGMENT = 'Platinum' and grouped by orders.PRODUCT_CATEGORY.

Each follow-up reuses the same governed measures and joins, so the numbers stay consistent across slices.

4. Confirm it was governed

Trust comes from knowing where the answer came from. Ask the assistant to cite it:

Example response:

orders.TOTAL_REVENUE = SUM(orders.TOTAL_AMOUNT), from the orders semantic model, joined to customers on customer_id for the segment dimension. Filters applied: order_date in 2025, customer_segment = 'Platinum'.

A governed answer names the measure and the source model, so you can reproduce it.

Troubleshooting

Issue
Resolution

The assistant returns a limitation instead of a number

The question cannot be answered from the product's semantic surface rather than a wrong number being invented. Re-check step 1's measures and dimensions and rephrase around what is actually exposed.

A measure or dimension you expect is missing

It is not exposed on this product's semantic model. Ask What metrics and measures does <product> expose? again to confirm the current list, or check a different product with Discovering the right Data Product in natural language.

Slicing by a dimension gives an error or no result

That dimension may not join to the measure you asked for. Ask Which dimensions can I use with <measure>? before slicing.

The number doesn't match a figure from another source

Ask step 4's citation question. Differences usually trace to a different metric definition, filter, or time window, not a broken query.

The response says output was capped

The result set exceeded the platform's row limit. Narrow the question (a shorter date range, a specific segment) or slice further as in step 3, rather than treating the capped response as the complete answer.

The assistant returns an authentication or authorization error

Ask your administrator for the mcp-tool-read grant under use-mcp-service, or a tenant role such as data_consumer or data_developer. See Governance and trust.

Outcome

You turned a KPI question into a governed answer, computed from the product's own metric definition and cited to its source model, so you can slice it further and reproduce the number.

Outcome

You turned a KPI question into a governed answer, computed from the product's own metric definition and cited to its source model, so you can slice it further and reproduce the number.

References

Last updated

Was this helpful?