Merged PR 4665: Projected Bookings to the end of the current month
# Description Computes projected Bookings to the end of the current month per dimension and dimension value KPIs changes: * Adds a int_kpis__agg_daily_created_bookings model. This is a standard KPIs model that computes created bookings at a daily level per dimension and dimension value. Projected KPIs (NEW): * Adds a new folder named projected within KPIs. This includes a simple Readme. * Adds a default dimension dates model that ranges from the past 3 complete months to the end of the current month, that is in the future. * Adds 2 projected models for created bookings: The daily one, that handles the logic of the projection (same month + last 7 days) and the monthly one, that retrieves the end of month projected value as well as some indicators of how good or bad this was for previous months. How good is the projection at 11th of March (so 10 days in the month)? `select * from intermediate.int_kpis_projected__agg_monthly_created_bookings order by actual_created_bookings desc`  # Checklist - [X] The edited models and dependants run properly with production data. - [X] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [X] I have checked for DRY opportunities with other models and docs. - [X] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #28251
This commit is contained in:
parent
a0b2f9b657
commit
9ca9c827fe
7 changed files with 899 additions and 0 deletions
|
|
@ -836,6 +836,72 @@ models:
|
|||
Count of accumulated bookings created in a given month up to the
|
||||
given date and per specified dimension that have not been cancelled.
|
||||
|
||||
- name: int_kpis__agg_daily_created_bookings
|
||||
description: |
|
||||
This model computes the dimension aggregation for
|
||||
Daily Created Bookings.
|
||||
|
||||
The primary key of this model is end_date, dimension
|
||||
and dimension_value.
|
||||
|
||||
data_tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- date
|
||||
- dimension
|
||||
- dimension_value
|
||||
|
||||
columns:
|
||||
- name: date
|
||||
data_type: date
|
||||
description: |
|
||||
The start and end date of the time range considered for
|
||||
the metrics in this record.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: dimension
|
||||
data_type: string
|
||||
description: The dimension or granularity of the metrics.
|
||||
data_tests:
|
||||
- assert_dimension_completeness:
|
||||
metric_column_names:
|
||||
- created_bookings
|
||||
- cancelled_created_bookings
|
||||
- not_cancelled_created_bookings
|
||||
- accepted_values:
|
||||
values:
|
||||
- global
|
||||
- by_number_of_listings
|
||||
- by_billing_country
|
||||
- by_business_scope
|
||||
- by_deal
|
||||
|
||||
- name: dimension_value
|
||||
data_type: string
|
||||
description: The value or segment available for the selected dimension.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: created_bookings
|
||||
data_type: bigint
|
||||
description: The daily created bookings for a given date, dimension and value.
|
||||
|
||||
- name: cancelled_created_bookings
|
||||
data_type: bigint
|
||||
description: |
|
||||
The daily cancelled created bookings for a given date, dimension and value.
|
||||
|
||||
- name: not_cancelled_created_bookings
|
||||
data_type: bigint
|
||||
description: |
|
||||
The daily not cancelled created bookings for a given date, dimension and value.
|
||||
|
||||
- name: cancelled_created_bookings_rate
|
||||
data_type: decimal
|
||||
description: |
|
||||
The daily rate of cancelled created bookings for a given date, dimension and value.
|
||||
|
||||
- name: int_kpis__agg_monthly_created_bookings
|
||||
description: |
|
||||
This model computes the dimension aggregation for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue