Standard query metric examples
Order line item reconciliation: Compute the relative discrepancy between line item totals and order totals. A result above 0.01 (1%) triggers an alert — catching ETL bugs where line items were loaded without the parent order record updating.> 0 for zero tolerance — any active account with a negative balance is a business rule violation.
Query metrics run with the credentials of the connected source. Ensure the service account has
SELECT access to all tables referenced in the query. Queries that modify data (INSERT, UPDATE, DELETE) are not permitted and will be rejected.Parameterized query metric examples
Rolling window checks
Goal: Run the same check for the last 7, 30, or 90 days without creating separate metrics.
Run for different windows via the popup or CLI:
Partitioned execution by date
Goal: Validate data quality for a specific partition (e.g., effective date) and re-run for historical dates independently.
Re-run for a different date by changing
effective_date in the popup — the metric definition stays the same.
Segmented KPI validation
Goal: Apply the same revenue completeness check for each sales region using one metric definition.
Both runs share the same metric ID — results are tagged with their effective parameter values.
Threshold injection (pass/fail in-query)
Goal: Encode the pass/fail decision directly into the SQL so the warehouse handles it rather than Prizm’s threshold layer.
Different teams can supply different
min_revenue thresholds for the same underlying table without duplicating metric definitions.