Skip to content

Commit

Permalink
add nfl metrics, remove unused resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiz-bozai-dbt committed Aug 30, 2023
1 parent 9701515 commit b02a440
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 25 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 1 addition & 6 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ models:
account_usage:
+materialized: view
+schema: stg_account_usage
jaffle_shop:
+materialized: view
+schema: stg_jaffle_shop
mls:
+materialized: view
+schema: stg_mls
Expand All @@ -86,9 +83,7 @@ models:
tpch:
+materialized: view
+schema: stg_tpch
weathersource:
+materialized: view
+schema: stg_weathersource


seeds:
ramiz_snowflake_github_demo_local:
Expand Down
18 changes: 16 additions & 2 deletions models/beginner_examples/nfl_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,25 @@ semantic_models:
defaults:
agg_time_dimension: season_year
model: ref('my_first_model')
primary_entity: player

entities:
- name: player_name
type: foreign
expr: player_name
- name: team
type: foreign
expr: team

measures:
- name: count_distinct_players
description: Unique number of players.
expr: player_name
agg: count_distinct
- name: average_completion_rate
description: Average completion rate.
expr: completion_pct
agg: average

dimensions:
- name: position
Expand All @@ -27,9 +35,15 @@ semantic_models:


metrics:
- name: calculated_dist_players
- name: count_distinct_players
type: simple
type_params:
measure: count_distinct_players
label: "calcd_players"
label: "Count distinct of players"
- name: average_completion_rate
type: simple
type_params:
measure: average_completion_rate
label: "Average completion rate for QBs"


3 changes: 0 additions & 3 deletions models/sample_model/countries.sql

This file was deleted.

3 changes: 0 additions & 3 deletions models/sample_model/customers.sql

This file was deleted.

8 changes: 0 additions & 8 deletions models/sample_model/sources.yml

This file was deleted.

3 changes: 0 additions & 3 deletions models/sample_model/transactions.sql

This file was deleted.

24 changes: 24 additions & 0 deletions models/utils/metricflow_time_spine.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{
config(
materialized = 'table',
)
}}

with days as (

{{
dbt_utils.date_spine(
'day',
"to_date('01/01/2000','mm/dd/yyyy')",
"to_date('01/01/2027','mm/dd/yyyy')"
)
}}

),

final as (
select cast(date_day as date) as date_day
from days
)

select * from final

0 comments on commit b02a440

Please sign in to comment.