Skip to content

Commit

Permalink
add conference mapping model and metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiz-bozai-dbt committed Sep 5, 2023
1 parent b02a440 commit 28523b8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
4 changes: 4 additions & 0 deletions models/beginner_examples/conference_mapping.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select
*

from {{ ref('stg_conference_mapping') }}
File renamed without changes.
15 changes: 15 additions & 0 deletions models/staging/nfl/conference_mapping_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
semantic_models:
- name: conference_mapping
description: Mapping for NFL teams and the conference they belong to.
defaults:
model: ref('conference_mapping')

entities:
- name: team
type: primary
expr: team

dimensions:
- name: conference
type: categorical
expr: conference
4 changes: 3 additions & 1 deletion models/staging/nfl/nfl_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ sources:

tables:
- name: passing_stats
description: Passing data from the 2021 season.
description: Passing data from the 2021 season.
- name: conference_mapping
description: Team-conference mapping.
17 changes: 17 additions & 0 deletions models/staging/nfl/stg_conference_mapping.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
with source as (

select * from {{ source('nfl', 'conference_mapping') }}

),

renamed as (

select
tm as team,
conf as conference

from source

)

select * from renamed

0 comments on commit 28523b8

Please sign in to comment.