The bookings schema has one row per room booking (a stay), cancelled ones
included, with the days it was booked, arrives, departs and was cancelled.
Use it for how many bookings come in, how many cancel, how far ahead guests
book and how long they stay.
rooms counts nights. bookings counts the bookings themselves: a
five-night stay is five room nights in rooms and one booking here.
Use cases
- Booking volume. Count
bookingsandroom_nights_bookedbychanneland month. - Cancellations. Compare
cancellation_rateacross channels, or countcancellationsON cancellation_datebycancellation_source. - Booking window. Track
avg_lead_time_daysandavg_length_of_stay, or filter onlead_time_daysfor last-minute bookings. - Arrivals and departures. Count
staysandguestsON arrival_date, anddepartureson their own date. - Check-in. Set
checked_in_staysagainststaysON arrival_date.
Examples
Bookings and cancellations by channel
FROM bookings
SHOW bookings, cancellations, cancellation_rate
DURING last_quarter
GROUP BY channel
WITH TOTALSWho cancelled last month
FROM bookings
SHOW cancellations
ON cancellation_date
DURING last_month
GROUP BY cancellation_sourceHow far ahead guests book
FROM bookings
SHOW avg_lead_time_days, avg_length_of_stay
DURING last_year
GROUP BY sales_channelThis week's arrivals, day by day
FROM bookings
SHOW stays, guests
ON arrival_date
DURING this_week
TIMESERIES dayBookings made this year against last year
FROM bookings
SHOW bookings, room_nights_booked
DURING this_year
TIMESERIES month
COMPARE TO previous_yearWhat it counts
One row per room booking (stay), cancelled ones included, with its booking, arrival, departure and cancellation dates.
Dates
Rows are dated by booking_date (default), arrival_date, departure_date or cancellation_date. ON picks one. Without DURING or SINCE, a query covers this_month. AS OF reads what was on the books at the end of an earlier day, and covers the 12 months from that day when the query has no range.
Metrics
Metrics you can use in FROM bookings.
-
bookings· NumberRoom bookings made, including ones cancelled later.
Dated by
booking_date, or byarrival_dateordeparture_datewithON. -
stays· NumberRoom bookings that are not cancelled.
Dated by
booking_date, or byarrival_dateordeparture_datewithON. -
cancellations· NumberRoom bookings that were cancelled. Use ON cancellation_date to count by the day they were cancelled.
-
cancellation_rate· PercentCancellations divided by bookings.
Dated by
booking_date, or byarrival_dateordeparture_datewithON. Doesn't add up over time, soWITH CUMULATIVEcan't take it. -
room_nights_booked· NumberNights of the room bookings made, including cancelled ones.
Dated by
booking_date, or byarrival_dateordeparture_datewithON. -
avg_lead_time_days· DaysAverage days between booking and arrival, over bookings that are not cancelled.
Dated by
booking_date, or byarrival_dateordeparture_datewithON. Doesn't add up over time, soWITH CUMULATIVEcan't take it. -
avg_length_of_stay· DaysAverage nights per booking, over bookings that are not cancelled.
Dated by
booking_date, or byarrival_dateordeparture_datewithON. Doesn't add up over time, soWITH CUMULATIVEcan't take it. -
departures· NumberRoom bookings that are not cancelled, counted on their departure day.
Dated by
departure_dateonly. -
guests· NumberAdults and children on room bookings that are not cancelled. Infants are not counted.
Dated by
booking_date, or byarrival_dateordeparture_datewithON. -
checked_in_stays· NumberRoom bookings not cancelled that were checked in in SERVOS, dated by arrival unless ON says otherwise. AS OF a day, a stay counts as checked in from its check-in day.
Dated by
arrival_date, or bybooking_dateordeparture_datewithON.
Dimensions
Dimensions you can group and filter by in FROM bookings.
-
room_type· TextThe accommodation (room type) a stay or capacity belongs to.
-
channel· TextWhere the booking came from: an OTA such as Booking.com, POS, B2B, or Direct.
-
sales_channel· TextThe kind of channel a booking was sold on: direct, ota, pos or b2b.
Values:
direct,ota,pos,b2b. -
cancellation_source· TextWho cancelled: manual, ota, system, customer_request, or order_edit when an order edit removed the stay.
Values:
manual,ota,system,customer_request,order_edit. -
lead_time_days· NumberDays between the booking and the arrival, for every booking, cancelled ones included.
-
length_of_stay· NumberNights booked, for every booking, cancelled ones included.