How to Script Dimensions with data build tool (dbt) Macros
In this article, we’ll revisit the dimension models we created. We wrote the entire SQL statement for the dimension by hand, and the dimensions themselves were very rudimentary; they lacked a surrogate key and there were no audit columns (such as insert date and update date). We’ll show you how we can expand the dimensions using Jinja, but also how we can minimize development effort by baking reusable patterns into the Jinja code.
2025-09-03