Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homework #8

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions models/marts/marts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,16 @@ models:
description: Date
tests:
- not_null

- name: f_immersions
columns:
- name: cost_id
description: surrogate key
tests:
- not_null
- unique:
severity: warn
- name: dt
description: Date
tests:
- not_null
26 changes: 26 additions & 0 deletions models/metrics/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ metrics:

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]

- name: actions
label: 'Actions'
model: ref('f_tracker')
description: ''

calculation_method: count
expression: event_id

timestamp: dt
time_grains: [day, week, month, quarter, year]

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]

- name: cpc
label: 'Cost per Click'
description: ''
Expand All @@ -39,3 +52,16 @@ metrics:
time_grains: [day, week, month, quarter, year]

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]

- name: cpa
label: 'Cost per Action'
description: ''

calculation_method: derived
expression: "{{ metric('costs') }} / {{ metric('actions') }}"

timestamp: dt
time_grains: [day, week, month, quarter, year]

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]

2 changes: 1 addition & 1 deletion profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mybi_dbt_showcase:

prod:
type: clickhouse
host: clickhouse
host: 127.0.0.1
port: 8123
user: default
schema: analytics
Expand Down