The rooms schema has one row per room type and night: the room nights
sold, available and blocked, and each night's share of its stay's room
revenue. Use it for occupancy, ADR, RevPAR and what is on the books for the
nights ahead.
Use cases
- Room KPIs. Show
occupancy,adrandrevparbyroom_type, against the same weekdays last year withCOMPARE TO stly. - Channel mix. Split
room_nights_sold,room_revenueandadrbychannelorsales_channel. Occupancy has no channel, because empty rooms weren't sold through one. - On the books. Query a future range, such as
next_90_days, for the nights already sold. AddAS OFto see how it stood on an earlier day. - Blocked rooms. Count
room_nights_blockedbyroom_block_type. - Weekday patterns. Group
occupancyandadrbyday_of_week.
Examples
Weekly management report
FROM rooms
SHOW occupancy, adr, revpar, room_revenue
DURING last_week
COMPARE TO stly
WITH PERCENT_CHANGERoom types against last year
FROM rooms
SHOW occupancy, adr, revpar
DURING last_month
GROUP BY room_type
COMPARE TO stly
WITH TOTALS, PERCENT_CHANGEChannel mix
FROM rooms
SHOW room_nights_sold, room_revenue, adr
DURING last_month
GROUP BY channel
WITH TOTALS
ORDER BY room_revenue DESCThe next three months on the books
FROM rooms
SHOW occupancy, room_nights_sold, room_revenue
DURING next_90_days
GROUP BY monthWhy rooms were blocked this year
room_block_type only applies to blocked nights. HAVING hides the row of
sold and available nights, which have no block type.
FROM rooms
SHOW room_nights_blocked
DURING this_year
GROUP BY room_block_type
HAVING room_nights_blocked > 0What it counts
Room nights sold, available and blocked per room type and stay night, with each night's share of the stay's room revenue.
Dates
Rows are dated by stay_night (default) or booking_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 rooms.
-
room_nights_sold· NumberNights of stays that are neither cancelled nor discarded, including unassigned stays and no-shows.
Groups and filters only by
room_type,channel,sales_channel,packageand time dimensions. -
room_nights_available· NumberActive rooms on each night less rooms a block covers, as rooms and blocks stand today.
Dated by
stay_nightonly. Groups and filters only byroom_typeand time dimensions. -
room_nights_blocked· NumberRooms covered by a room block (maintenance, owner stay, group hold, staff or other) on each night, as blocks stand today. Group by room_block_type for why.
Dated by
stay_nightonly. Groups and filters only byroom_type,room_block_typeand time dimensions. -
occupancy· PercentRoom nights sold divided by room nights available. Can exceed 100% when stays sit in blocked or inactive rooms.
Dated by
stay_nightonly. Groups and filters only byroom_typeand time dimensions. Doesn't add up over time, soWITH CUMULATIVEcan't take it. -
room_revenue· MoneyNet room revenue (excluding VAT) after package allocation, spread over the stay's nights. Add-ons such as breakfast are not included.
Groups and filters only by
room_type,channel,sales_channel,packageand time dimensions. -
room_revenue_gross· MoneyRoom revenue including VAT, spread over the stay's nights.
Groups and filters only by
room_type,channel,sales_channel,packageand time dimensions. -
adr· MoneyAverage daily rate. Room revenue divided by room nights sold.
Groups and filters only by
room_type,channel,sales_channel,packageand time dimensions. Doesn't add up over time, soWITH CUMULATIVEcan't take it. -
revpar· MoneyRevenue per available room. Room revenue divided by room nights available.
Dated by
stay_nightonly. Groups and filters only byroom_typeand time dimensions. Doesn't add up over time, soWITH CUMULATIVEcan't take it. -
guest_nights· NumberAdults and children per sold room night. Infants are not counted.
Groups and filters only by
room_type,channel,sales_channel,packageand time dimensions. -
arrivals· NumberStays arriving, counted on their first night.
Groups and filters only by
room_type,channel,sales_channel,packageand time dimensions.
Dimensions
Dimensions you can group and filter by in FROM rooms.
-
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. -
package· TextThe package a line was sold in, if any.
-
room_block_type· TextWhy rooms were blocked: maintenance, owner_stay, group_hold, staff or other, as blocks stand today. A room in two blocks on one night counts under the block made first. Sold and available room nights have none, so grouping room_nights_blocked by it adds a row with no block type and 0; HAVING room_nights_blocked > 0 hides it.
Values:
maintenance,owner_stay,group_hold,staff,other.