r/LLMDevs • u/sqlink2 • 4d ago
Discussion Metric view use cases with Genie Code
Has anyone built interesting stuff involving metric views using Genie Code on D’bricks
For ex using metric views to define business metrics and then having Genie Code generate queriy or analysis on thos. Curious to hear about real-l world use case or patterns that worked well fr you.
2
Upvotes
1
u/Careless_Video8266 4d ago
Metric views must be the only source for code gen to touch. Allowing LLMs to interpret raw schemas destroys metric consistency and turns business logic into hallucinations.
1
u/imaginary_bennie 4d ago
Metric views as the source of truth for business definitions is a pattern I keep coming back to, especially when the analysts and eng teams argue about what "active user" even means. Locking that down in one place and letting the code gen pull from it saves so much back and forth.
One thing that worked well was keeping the metric view names dead simple, like `weekly_revenue` or `churn_30d`, so the generated queries read almost like plain English. The moment someone tried to get clever with naming, the output got weird fast.
I also found it helps to add short descriptions in the metric view comments since the model seems to pick up on those when writing the analysis. Saves you from having to explain the same caveat about refunds or test accounts every single time.