analytics-dictionary / term / transformation & metrics
dbt macro
A dbt macro is a reusable piece of SQL logic written with Jinja templating.
Written by Reflective Data experts · updated Oct 5, 2026
Macros remove copy-paste: a common calculation, such as converting currencies or generating surrogate keys, is written once and called everywhere. They also let packages share logic.
Use them to reduce repetition, but keep them readable.
related
// how we can help
We build tested data models and semantic layers, or host them for you. Data build and semantic layers → · Hosted dbt on the platform