Prompt file imported from andreas-andra/data-academy-case (
.github/prompts/new-use-case.prompt.md). Copyright stays with the author.
Create a new use case for the analytics warehouse. This requires four deliverables:
Steps
-
Understand the grain — What is the primary business question? What grain does it need (year, municipality, industry, or a combination)?
-
Write the gold model — Create
dbt/models/gold/fact_<name>.sqlfollowing the project convention:- CTE aliases:
b,dim_m,dim_i,dim_y - Left joins to shared dimensions
- Foreign keys + measures only in the fact
- Reference existing silver models via
{{ ref('silver_statfin_<source>') }}
- CTE aliases:
-
Write the use-case doc — Create
docs/use-cases/<name>.mdwith:- Business Question
- Business Value
- Gold Model reference (name, grain, schema style)
- Dimensions used
- Core Metrics
- Example Genie Questions (at least 5 natural language questions)
-
Write the star-schema doc — Create
docs/architecture/star-schema-<name>.mdwith:- Fact table name and grain
- Dimension references
- Why it's a star schema
- Diagram reference
-
Write the DBML diagram — Create
docs/diagrams/<name>.dbmlwith:- Dimension table definitions (only those used)
- Fact table with all columns, types, and unique index
- Ref lines for all foreign keys
Reference
Check existing examples for style: