Bird
0
0

Which syntax correctly calls a macro named calculate_total from a project named sales_project?

easy📝 Syntax Q12 of 15
dbt - Jinja in dbt
Which syntax correctly calls a macro named calculate_total from a project named sales_project?
A{{ sales_project.calculate_total() }}
B{{ calculate_total() }}
C{% sales_project.calculate_total() %}
D{{ sales_project->calculate_total() }}
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct macro call syntax

    Macros from other projects are called using {{ project_name.macro_name() }}.
  2. Step 2: Match the syntax to the options

    {{ sales_project.calculate_total() }} uses the correct dot notation and double curly braces.
  3. Final Answer:

    {{ sales_project.calculate_total() }} -> Option A
  4. Quick Check:

    Use dot notation inside {{ }} = {{ sales_project.calculate_total() }} [OK]
Quick Trick: Use {{ project_name.macro_name() }} to call macros [OK]
Common Mistakes:
MISTAKES
  • Using {% %} instead of {{ }} for macro calls
  • Missing the project name before the macro
  • Using incorrect symbols like ->

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes