Bird
0
0

Consider this metric YAML snippet: metrics: - name: avg_price model: ref('products') type: average expression: price What will be the result type when querying this metric?

medium📝 Predict Output Q5 of 15
dbt - Advanced Patterns
Consider this metric YAML snippet: metrics: - name: avg_price model: ref('products') type: average expression: price What will be the result type when querying this metric?
ASum of all prices
BMaximum price value
CCount of price entries
DAverage price as a decimal number
Step-by-Step Solution
Solution:
  1. Step 1: Identify metric type

    The metric type is 'average', which calculates the mean value.
  2. Step 2: Understand output

    Querying returns the average price as a decimal number.
  3. Final Answer:

    Average price as a decimal number -> Option D
  4. Quick Check:

    Average metric returns mean value [OK]
Quick Trick: Average type returns mean decimal value [OK]
Common Mistakes:
MISTAKES
  • Confusing average with sum or count
  • Expecting integer count instead of decimal
  • Assuming maximum value is returned

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes