Bird
0
0

Which of the following is the correct syntax to set a variable named threshold to 10 in dbt Jinja?

easy📝 Syntax Q3 of 15
dbt - Jinja in dbt
Which of the following is the correct syntax to set a variable named threshold to 10 in dbt Jinja?
A{% var threshold = 10 %}
B{{ set threshold = 10 }}
C{% threshold = 10 %}
D{% set threshold = 10 %}
Step-by-Step Solution
Solution:
  1. Step 1: Recall the syntax for setting variables in Jinja

    Variables are set using the {% set variable = value %} syntax.
  2. Step 2: Check each option

    {% set threshold = 10 %} uses correct syntax. Options A, B, and D use invalid or incorrect syntax.
  3. Final Answer:

    {% set threshold = 10 %} -> Option D
  4. Quick Check:

    Variable set syntax = {% set %} [OK]
Quick Trick: Use {% set var = value %} to assign variables [OK]
Common Mistakes:
MISTAKES
  • Using {{ }} instead of {% %} for setting variables
  • Using var keyword incorrectly
  • Omitting set keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes