dq_explain_metric_change
Explains why a metric changed by comparing a window with its baseline and attributing the shift to dimension segments, so you can distinguish data problems like missing feeds from business changes.
Instructions
Explain why a metric moved: compare a window with its baseline, then attribute the change to segments.
For "revenue dropped 35% yesterday": gives the overall change and, per dimension, which segments account for it. A segment flagged 'missing in current window' usually means a feed did not load, which is a data problem rather than a business one.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "<table>",
"time_column": "<time_column>"
},
"name": "dq_explain_metric_change"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Segments to return per dimension. | |
| table | Yes | Table name from dq_list_sources, e.g. 'orders' or 'warehouse.main.orders'. | |
| metric | No | 'count', or 'sum:col', 'avg:col', 'min:col', 'max:col', 'count_distinct:col'. E.g. 'sum:revenue'. | count |
| dimensions | No | Columns to segment by, e.g. ['country', 'channel', 'source_system']. Each is analysed separately. | |
| current_end | No | ISO date/time where it ends (exclusive). Defaults to one day after current_start. | |
| time_column | Yes | Timestamp/date column that defines the windows. | |
| current_start | No | ISO date/time where the window under investigation starts. Defaults to the latest day in the data. | |
| baseline_windows | No | Baseline = mean of this many preceding windows of the same length. Use 7 with a 1-day window for a weekly-smoothed baseline. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||