Merged PR 4874: Daily model for Total and Retained Revenue
# Description Daily model for Total and Retained Revenue metrics. I opted for keeping both Total Revenue alongside of Revenue Retained and Revenue Retained Post-Resolutions within the same model. Please, verify that you're happy with the naming of `total_and_retained_revenue`, before continuing with the usual monthly/mtd metric/aggregated models. # 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: #28946
This commit is contained in:
parent
57626f266a
commit
adcb8d2231
2 changed files with 212 additions and 2 deletions
|
|
@ -7753,7 +7753,7 @@ models:
|
|||
data_type: bigint
|
||||
description: |
|
||||
The count of deals with services offered by the end of a given month, dimension and value.
|
||||
|
||||
|
||||
- name: int_kpis__agg_daily_new_dash_accommodation_offered_services
|
||||
description: |
|
||||
This model computes the dimension aggregation for Daily Accommodation Offered Services.
|
||||
|
|
@ -7910,4 +7910,96 @@ models:
|
|||
- name: accommodation_with_offered_service_count
|
||||
data_type: bigint
|
||||
description: |
|
||||
The count of accommodations with services offered by the end of a given month, dimension and value.
|
||||
The count of accommodations with services offered by the end of a given month, dimension and value.
|
||||
|
||||
- name: int_kpis__metric_daily_total_and_retained_revenue
|
||||
description: |
|
||||
This model computes the Daily Total Revenue and Revenue Retained metrics
|
||||
at the deepest granularity.
|
||||
|
||||
The logic behind this model is to combine the daily revenue and payouts
|
||||
from different sources:
|
||||
- Guest Revenue (from int_kpis__metric_daily_guest_payments)
|
||||
- Invoiced Revenue and Payouts (from int_kpis__metric_daily_invoiced_revenue)
|
||||
- Host Resolutions Payouts (from int_kpis__metric_daily_host_resolutions)
|
||||
in order to compute Total Revenue, Retained Revenue and Retained Revenue Post-Resolutions.
|
||||
|
||||
The unique key corresponds to the deepest granularity of the model,
|
||||
in this case:
|
||||
- date,
|
||||
- id_deal,
|
||||
- business_scope.
|
||||
|
||||
data_tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- date
|
||||
- id_deal
|
||||
- business_scope
|
||||
|
||||
columns:
|
||||
- name: date
|
||||
data_type: date
|
||||
description: Date of when the document was issued.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: id_deal
|
||||
data_type: string
|
||||
description: Unique identifier of an account.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: business_scope
|
||||
data_type: string
|
||||
description: |
|
||||
Business scope identifying the metric source.
|
||||
data_tests:
|
||||
- not_null
|
||||
- accepted_values:
|
||||
values:
|
||||
- "Old Dash"
|
||||
- "New Dash"
|
||||
- "API"
|
||||
- "UNSET"
|
||||
|
||||
- name: active_accommodations_per_deal_segmentation
|
||||
data_type: string
|
||||
description: |
|
||||
Segment value based on the number of listings booked in 12 months
|
||||
for a given deal and date.
|
||||
data_tests:
|
||||
- not_null
|
||||
- accepted_values:
|
||||
values:
|
||||
- "0"
|
||||
- "01-05"
|
||||
- "06-20"
|
||||
- "21-60"
|
||||
- "61+"
|
||||
- "UNSET"
|
||||
|
||||
- name: main_billing_country_iso_3_per_deal
|
||||
data_type: string
|
||||
description: |
|
||||
Main billing country of the host aggregated at Deal level.
|
||||
data_tests:
|
||||
- not_null
|
||||
|
||||
- name: total_revenue_in_gbp
|
||||
data_type: decimal
|
||||
description: |
|
||||
Sum of Guest Revenue, Invoiced Operator Revenue and APIs Revenue,
|
||||
in GBP, without taxes, in a given date and per specified dimension.
|
||||
|
||||
- name: revenue_retained_in_gbp
|
||||
data_type: decimal
|
||||
description: |
|
||||
Total Revenue minus Waiver Payouts due to Host Takes Risk,
|
||||
in GBP, without taxes, in a given date and per specified dimension.
|
||||
|
||||
- name: revenue_retained_post_resolutions_in_gbp
|
||||
data_type: decimal
|
||||
description: |
|
||||
Revenue Retained minus Host Resolutions Payouts due to resolutions,
|
||||
in GBP, without taxes, in a given date and per specified dimension.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue