Added nbr og nights to avoid calculation in PBI

This commit is contained in:
Joaquin Ossa 2024-12-12 11:27:48 +01:00
parent 85a02f8a1e
commit e18750d720
4 changed files with 16 additions and 0 deletions

View file

@ -24,6 +24,7 @@ select
c.checkin_date_utc, c.checkin_date_utc,
c.checkin_time_utc, c.checkin_time_utc,
c.checkout_date_utc, c.checkout_date_utc,
c.checkout_date_utc - c.checkin_date_utc as number_of_nights,
c.listing_name, c.listing_name,
c.listing_address, c.listing_address,
c.listing_address_line_2, c.listing_address_line_2,

View file

@ -88,6 +88,13 @@ models:
tests: tests:
- not_null - not_null
- name: number_of_nights
data_type: integer
description: Number of nights for the booking.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 1
- name: listing_name - name: listing_name
data_type: text data_type: text
description: Name of the listing associated with the check-in. description: Name of the listing associated with the check-in.

View file

@ -20,6 +20,7 @@ select
checkin_date_utc as checkin_date_utc, checkin_date_utc as checkin_date_utc,
checkin_time_utc as checkin_time_utc, checkin_time_utc as checkin_time_utc,
checkout_date_utc as checkout_date_utc, checkout_date_utc as checkout_date_utc,
number_of_nights as number_of_nights,
listing_name as listing_name, listing_name as listing_name,
listing_address as listing_address, listing_address as listing_address,
listing_address_line_2 as listing_address_line_2, listing_address_line_2 as listing_address_line_2,

View file

@ -88,6 +88,13 @@ models:
tests: tests:
- not_null - not_null
- name: number_of_nights
data_type: integer
description: Number of nights for the booking.
tests:
- dbt_expectations.expect_column_values_to_be_between:
min_value: 1
- name: listing_name - name: listing_name
data_type: text data_type: text
description: Name of the listing associated with the check-in. description: Name of the listing associated with the check-in.