Fun with Loops and Lists in dbt (and Jinja2)
One thing I really like about dbt is Jinja. The fact that there is a built-in templating language, complete with modern control structures like if-then-else and for loops, makes writing SQL more meta than ever before. Today, I want to talk about bridging the divide between dbt variables defined in your project YAML file, and the (SQL) model files where you want to use them. (By the way, this blog post was inspired by a question on the dbt Slack org.
Read on →