Setting Up Jinja Variables
Learn how to use the set instruction and the if statement in Jinja.
We'll cover the following...
We'll cover the following...
Jinja variables
In addition to project and environment variables, dbt allows us to define variables at the file level. This is done using the set instruction.
The variable can then be rendered using double curly brackets:
The default filter
If we’re not sure that the variable is defined, we can pass a default value using the default filter.
If the variable name is not defined, this will render as:
Variable types
Jinja is written in Python, therefore, the variables can have any of the native Python data types, such as: ...