malloy-analysis-pitfalls

Detects common Malloy query construction and result interpretation errors during data analysis.

Updated Jun 3, 2026
One-click install
npx skills add https://github.com/credibledata/credible-plugin --skill malloy-analysis-pitfalls-credibledata
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: malloy-analysis-pitfalls
Source: https://github.com/credibledata/credible-plugin/tree/main/codex/skills/malloy-analysis-pitfalls
Command: npx skills add https://github.com/credibledata/credible-plugin --skill malloy-analysis-pitfalls-credibledata

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Analysts querying semantic models often produce silently wrong results: fan-out from joins inflates aggregates, mismatched filter values return zero rows, and nulls distort averages. This Skill provides a checklist of common pitfalls to catch these errors before presenting an answer. ## Core Features & Use Cases - Query Construction Checks: Covers wrong grain and fan-out, invented field names, mismatched filter values, missing filters, misinterpreted entities, fragile ad-hoc definitions, and hidden filters in views. - Result Interpretation Checks: Flags implausible magnitudes, nulls distorting aggregations, count vs. count distinct confusion, ambiguous percentage denominators, and time period mismatches. - Verification Signals: Validates that parts sum to the whole, row counts make sense, and zero-row results are investigated rather than reported as missing data. - Use Case: After running a Malloy query breaking down revenue by region, use this checklist to confirm the regional totals sum to the overall total and that no join fan-out inflated the numbers. ## Quick Start Review my Malloy query and its results against the analysis pitfalls checklist before I present the answer.

Frequently Asked Questions about malloy-analysis-pitfalls

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I avoid fan-out errors in Malloy queries?

Fan-out occurs when dimensions from a finer-grained joined source multiply rows and inflate aggregates. Compare count(key_field) to count() in your query; if the row count far exceeds the distinct key count, you likely have fan-out and should restructure the query.

Why does my Malloy filter return zero rows?

Zero rows usually mean a mismatched filter value, not missing data. Dimensional values are case-sensitive and format-specific, so run a distinct-values query on the dimension to confirm the exact value before filtering.

What is the difference between count and count distinct in Malloy?

count() counts rows, while a measure defined with count(field) counts distinct values of that field. Using a row count when you need distinct values inflates numbers, especially when the query touches joined sources.

How do null values affect aggregations in query results?

Nulls are silently excluded from avg() and can lower sum() results. Compare the total row count to a count of non-null values for the key field to gauge how much data is missing before interpreting aggregates.

When should I check for hidden filters in Malloy views?

Check whenever a view name implies a subset, such as recent_orders or active_customers, since views can have built-in where clauses. Read the view definition if available, or query the base source directly and apply filters explicitly.