lightdash / dbt2looker

Generate lookml for views from dbt models
https://lightdash.com
MIT License
177 stars 46 forks source link

Support model level measures #50

Open yu-iskw opened 2 years ago

yu-iskw commented 2 years ago

Motivation

We technically implement a measure with multiple columns under a column meta. But, it would be more natural to implement such measures as model-level.

models:
  - name: ubie_jp_lake__dm_medico__hourly_score_for_nps
    description: |
      {{ doc("ubie_jp_lake__dm_medico__hourly_score_for_nps") }}
    meta:
      measures:
        total_x_y_z:
          type: number
          description: 'Summation of total x, total y and total z'
          sql: '${total_x} + ${total_y} + ${total_z}'