Merged PR 3127: (3/3) Revenue renaming - KPIs by deal
# Description Main changes: * Guest revenue is now guest payments. PBI uses Guest revenue, so alias is changed at reporting level, while it uses guest_payments_in_gbp field. * Removal of Waiver Amount Paid back to Host to Guest revenue and Total revenue. # Checklist - [X] The edited models and dependants run properly with production data. - [NA] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [NA] I have checked for DRY opportunities with other models and docs. - [NA] 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: #22688
This commit is contained in:
parent
745f00bad2
commit
52f01adc11
2 changed files with 4 additions and 42 deletions
|
|
@ -89,16 +89,10 @@ select
|
|||
) as waiver_net_fees_in_gbp,
|
||||
guest_payments.checkin_cover_fees_in_gbp,
|
||||
guest_payments.total_guest_payments_in_gbp,
|
||||
nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_waiver_paid_back_to_host_in_gbp, 0),
|
||||
0
|
||||
) as total_guest_revenue_in_gbp,
|
||||
|
||||
-- TOTAL REVENUE --
|
||||
nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_waiver_paid_back_to_host_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_apis_net_fees_in_gbp, 0),
|
||||
0
|
||||
|
|
@ -111,32 +105,16 @@ select
|
|||
guest_payments.total_guest_payments_in_gbp / nullif(
|
||||
guest_journeys.paid_guest_journeys, 0
|
||||
) as guest_payments_per_paid_guest_journey,
|
||||
nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_waiver_paid_back_to_host_in_gbp, 0),
|
||||
0
|
||||
) / nullif(
|
||||
guest_journeys.completed_guest_journeys, 0
|
||||
) as guest_revenue_per_completed_guest_journey,
|
||||
nullif(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_waiver_paid_back_to_host_in_gbp, 0),
|
||||
0
|
||||
) / nullif(
|
||||
guest_journeys.paid_guest_journeys, 0
|
||||
) as guest_revenue_per_paid_guest_journey,
|
||||
|
||||
-- TOTAL REVENUE WEIGHTED METRICS --
|
||||
(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_waiver_paid_back_to_host_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_apis_net_fees_in_gbp, 0)
|
||||
)
|
||||
/ nullif(bookings.created_bookings, 0) as total_revenue_per_created_booking,
|
||||
(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_waiver_paid_back_to_host_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_apis_net_fees_in_gbp, 0)
|
||||
) / nullif(
|
||||
|
|
@ -144,7 +122,6 @@ select
|
|||
) as total_revenue_per_created_guest_journey,
|
||||
(
|
||||
coalesce(guest_payments.total_guest_payments_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_waiver_paid_back_to_host_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_operator_net_fees_in_gbp, 0)
|
||||
+ coalesce(invoicing.xero_apis_net_fees_in_gbp, 0)
|
||||
) / nullif(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue