BaşlayınÜcretsiz başlayın

Macros with Jinja

You've noticed that to calculate profit, you need to subtract the cost of goods from the revenue.

Previously, you've created data tests to make sure that no part of this equation can be NULL. However, that resulted in you repeatedly applying COALESCE() SQL functions to columns, followed by rounding.

Given the repeated nature of this logic, it feels more and more like you should create a Jinja macro (function) out of this use case.

Bu egzersiz, kursun bir parçasıdır

Case Study: Building E-Commerce Data Models with dbt

Kursa Göz Atın

Uygulamalı etkileşimli egzersiz

Teoriyi etkileşime dönüştürün, interaktif egzersizlerimizden biriyle

Egzersize başla