Merged PR 3562: Reduce dates for guest KPIs

# Description

Reduce dates for guest KPIs
Payments considered up to yesterday and all guest journey metrics up to 1 year in the future, this to reduce a little the amount of time displayed in the report since there are records with check-in in 2050.
Added report to exposure but still missing the link to Power BI

# 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.
- [ ] I have checked for DRY opportunities with other models and docs.
- [ ] 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: #23998
This commit is contained in:
Joaquin Ossa 2024-11-18 07:53:42 +00:00
commit ef03c0b60f
2 changed files with 21 additions and 0 deletions

View file

@ -38,6 +38,7 @@ with
sum(gp.checkin_cover_fees_in_gbp) as checkin_cover_fees_in_gbp, sum(gp.checkin_cover_fees_in_gbp) as checkin_cover_fees_in_gbp,
sum(gp.total_guest_payments_in_gbp) as total_guest_payments_in_gbp sum(gp.total_guest_payments_in_gbp) as total_guest_payments_in_gbp
from {{ ref("int_kpis__metric_daily_guest_payments") }} gp from {{ ref("int_kpis__metric_daily_guest_payments") }} gp
where gp.date < current_date
group by gp.date, gp.has_id_check group by gp.date, gp.has_id_check
), ),
guest_kpis as ( guest_kpis as (
@ -68,6 +69,9 @@ with
on gp.date = dd.date_day on gp.date = dd.date_day
and gp.has_id_check = dd.has_id_check and gp.has_id_check = dd.has_id_check
and dd.has_payment = {{ has_payment_true }} and dd.has_payment = {{ has_payment_true }}
-- Restricts the records by date being in the past or in the next following 12
-- months
where dd.date_day <= current_date + interval '1 year'
) )
select select

View file

@ -264,3 +264,20 @@ exposures:
owner: owner:
name: Oriol Roqué name: Oriol Roqué
email: oriol.roque@superhog.com email: oriol.roque@superhog.com
- name: guest_kpis
label: Guest KPIs
type: dashboard
maturity: medium
url: to_be_defined
description: |
A PBI report that displays the main KPIs followed by the
guest Squad. This includes guest journey metrics and revenue
by guest payments by a set of dimensions with a daily granularity.
depends_on:
- ref('kpis__product_guest_daily_metrics')
owner:
name: Joaquin Ossa
email: joaquin.ossa@superhog.com