How-To Guides¶
Goal-oriented guides for specific tasks with DuckDB Semantic Views.
Modeling
How to Use FACTS for Reusable Row-Level Logic – Define reusable row-level expressions that can be referenced inside metric aggregations.
How to Compose Metrics with Derived Metrics – Compose metrics from other metrics using arithmetic without repeating aggregate logic.
How to Model Role-Playing Dimensions – Join the same physical table multiple times under different aliases for distinct relationships.
How to Understand and Avoid Fan Traps – Understand, detect, and resolve fan traps that inflate aggregation results in multi-table views.
Advanced Metrics
How to Use Semi-Additive Metrics – Define metrics with NON ADDITIVE BY for snapshot data like account balances and inventory levels.
How to Use Window Function Metrics – Define window function metrics for rolling averages, lag comparisons, and rankings using OVER clauses.
Data & Queries
How to Use Different Data Sources – Connect semantic views to CSV, Parquet, Iceberg, and database tables.
How to Query Facts Directly – Query facts directly as row-level columns without aggregation.
How to Use Wildcard Selection – Select all dimensions, metrics, or facts for a table alias using wildcard patterns in queries.
Operations
How to Use Metadata Annotations – Add comments, synonyms, and access modifiers to dimensions, metrics, facts, and tables.
How to Use Materializations – Declare materializations that route matching queries to pre-aggregated tables.
How to Import and Export YAML Definitions – Import and export semantic view definitions as YAML for version control and migration.