🚀 Welcome to Anirvan Decodes! 🚀
In this video we will learn how to use Jinja in DBT.
Using Jinja you can turn your dbt project into a programming environment for SQL, giving you the ability to do things that aren't normally possible in SQL
Resources:
CSV file : https://github.com/dbt-labs/jaffle_sh...
SQL statement
{% set payment_methods = ["bank_transfer", "credit_card", "gift_card"] %}
select
order_id,
{% for payment_method in payment_methods %}
sum(case when payment_method = '{{payment_method}}' then amount end) as {{payment_method}}_amount
{% if not loop.last %},{% endif %}
{% endfor %}
from {{ ref('raw_payments') }}
group by 1
dbt macro,jinja sql,jinja if,jinja for loop,dbt variables,jinja template,dbt macros,dbt data,jinja else if,dbt log,dbt docs,jinja comment,dbt utils,what is jinja,dbt post hook,dbt core,Jinja and macros,Using Jinja
Rock Angel by Joakim Karud
/ joakimkarud
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
http://creativecommons.org/licenses/b...
Music promoted by Audio Library
• Video
–––
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Music: Uplifting And Inspiring Acoustic Corporate by Wavecont
https://protunes.net
Video Link:
• Wavecont - Uplifting And Inspiring Ac...
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬