Merged PR 2433: Remove Deposit payments from Guest Payments metric
After discussion with Pablo on the fact that Deposits are only with status "Paid" for a given time before they get Cancelled or Refunded, we just believe it's best to remove the Deposits amount from the Guest Payments metric. In any case, this does not represent a Revenue source... This was discovered while doing the data quality assessment for revenue figures ([here](https://www.notion.so/knowyourguest-superhog/Data-quality-assessment-DWH-vs-Finance-revenue-figures-6e3d6b75cdd4463687de899da8aab6fb)) Before, `total_guest_payments_in_gbp` was a standalone metric that computed any payment by the guest with status paid. We were computing revenue based on the `total_guest_income_in_gbp`, which mainly was the sum of waiver payments, deposit fees (not deposit itself!) and check in hero fees. Mainly what I did is: - remove the existing `total_guest_payments_in_gbp` in the source models (int_core__xxx_guest_payments_xxx) - rename the already existing `total_guest_income_in_gbp` to `total_guest_payments_in_gbp` Related work items: #18787, #18914
This commit is contained in:
parent
b5e5160d67
commit
b79df1b42e
4 changed files with 17 additions and 24 deletions
|
|
@ -23,7 +23,6 @@ with
|
|||
select
|
||||
date_trunc('month', vp.payment_paid_date_utc)::date as first_day_month,
|
||||
u.id_deal,
|
||||
sum(vp.amount_in_gbp) as total_guest_payments_in_gbp,
|
||||
sum(
|
||||
case
|
||||
when
|
||||
|
|
@ -71,13 +70,12 @@ select
|
|||
nullif(gpym.deposit_fees_in_gbp, 0) as deposit_fees_in_gbp,
|
||||
nullif(gpym.waiver_payments_in_gbp, 0) as waiver_payments_in_gbp,
|
||||
nullif(gpym.checkin_cover_fees_in_gbp, 0) as checkin_cover_fees_in_gbp,
|
||||
nullif(gpym.total_guest_payments_in_gbp, 0) as total_guest_payments_in_gbp,
|
||||
nullif(
|
||||
coalesce(gpym.deposit_fees_in_gbp, 0)
|
||||
+ coalesce(gpym.waiver_payments_in_gbp, 0)
|
||||
+ coalesce(gpym.checkin_cover_fees_in_gbp, 0),
|
||||
0
|
||||
) as total_guest_income_in_gbp
|
||||
) as total_guest_payments_in_gbp
|
||||
from int_dates_by_deal d
|
||||
left join
|
||||
guest_payments_year_month gpym
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ with
|
|||
guest_payments_year_month as (
|
||||
select
|
||||
d.date,
|
||||
sum(vp.amount_in_gbp) as total_guest_payments_in_gbp,
|
||||
sum(
|
||||
case
|
||||
when
|
||||
|
|
@ -64,12 +63,11 @@ select
|
|||
nullif(gpym.deposit_fees_in_gbp, 0) as deposit_fees_in_gbp,
|
||||
nullif(gpym.waiver_payments_in_gbp, 0) as waiver_payments_in_gbp,
|
||||
nullif(gpym.checkin_cover_fees_in_gbp, 0) as checkin_cover_fees_in_gbp,
|
||||
nullif(gpym.total_guest_payments_in_gbp, 0) as total_guest_payments_in_gbp,
|
||||
nullif(
|
||||
coalesce(gpym.deposit_fees_in_gbp, 0)
|
||||
+ coalesce(gpym.waiver_payments_in_gbp, 0)
|
||||
+ coalesce(gpym.checkin_cover_fees_in_gbp, 0),
|
||||
0
|
||||
) as total_guest_income_in_gbp
|
||||
) as total_guest_payments_in_gbp
|
||||
from int_dates_mtd d
|
||||
left join guest_payments_year_month gpym on gpym.date = d.date
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue