Merged PR 2221: Computes (paid) guest revenue metric - fixed
IMPORTANT: this PR was merged and reverted. The division by 0 error has been fixed in the last commit Adds the following metrics: - Guest Revenue by both visions (global and by deal id) It creates 2 new models: - int_mtd_guest_revenue_metrics - int_monthly_guest_revenue_history_by_deal the approaches are similar in the sense that we retrieve the information from the int_core__verification_payments and a filter by a PAID status. I checked and the aggregated volumes of the figures correspond to the decimal as what is reported to the guest_payments dashboard (aggregating the information from the currency tab) Same as last PR, this one does not exposes the data since a refactor of how the code is structured will follow shortly. Related work items: #18107
This commit is contained in:
parent
e214641b9f
commit
d2b0afdca6
3 changed files with 210 additions and 0 deletions
|
|
@ -131,3 +131,41 @@ models:
|
|||
DWH, this will be the point in time when we made the assumption.
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: int_mtd_guest_revenue_metrics
|
||||
description: |
|
||||
This model contains the historic information regarding the guest revenue in an aggregated manner.
|
||||
It's used for the business KPIs. Data is aggregated at the last day of the month and in the
|
||||
days necessary for the Month-to-Date computation of the current month.
|
||||
|
||||
columns:
|
||||
- name: date
|
||||
data_type: date
|
||||
description: The date for the month-to-date guest revenue-related metrics.
|
||||
tests:
|
||||
- not_null
|
||||
- unique
|
||||
|
||||
- name: int_monthly_guest_revenue_history_by_deal
|
||||
description: |
|
||||
This model contains the historic information regarding the guest revenue for each deal id.
|
||||
It's used for the business KPIs in the view by deal id. Data is aggregated at the last
|
||||
day of the month, or up to yesterday if it's the current month.
|
||||
tests:
|
||||
- dbt_utils.unique_combination_of_columns:
|
||||
combination_of_columns:
|
||||
- date
|
||||
- id_deal
|
||||
|
||||
columns:
|
||||
- name: date
|
||||
data_type: date
|
||||
description: The last day of the month or yesterday for historic guest revenue metrics.
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: id_deal
|
||||
data_type: character varying
|
||||
description: Id of the deal associated to the host.
|
||||
tests:
|
||||
- not_null
|
||||
Loading…
Add table
Add a link
Reference in a new issue