The revenue schema holds every order line your hotel sold: stays, add-ons,
tickets, appointments, products, passes and fees. Each line carries its
amount after discounts, its VAT split, and the channel, package and customer
it was sold to. Use it for what you earned, from what, and from whom.
Use cases
- Revenue by department. Show
net_revenueandtotal_revenuebyrevenue_categoryand month. - Discounts. Set
gross_salesagainstdiscountsandnet_revenueto see what discounts cost, per channel or package. - VAT. Split
vat_amountandnet_revenuebyvat_code,vat_rateoraccount. - Best sellers. Rank
productbynet_revenueorunits_sold. - New and returning guests. Compare
orders,customersandaverage_order_valuebynew_or_returning_customer.
Examples
Revenue and VAT by category, month by month
FROM revenue
SHOW net_revenue, vat_amount, total_revenue
DURING last_quarter
GROUP BY month, revenue_category
WITH TOTALSWhat discounts cost per channel
FROM revenue
SHOW gross_sales, discounts, net_revenue
DURING last_month
GROUP BY sales_channel
WITH TOTALSThe 20 best-selling products
FROM revenue
SHOW net_revenue, units_sold
DURING last_month
GROUP BY product
ORDER BY net_revenue DESC
LIMIT 20Order value of new and returning guests
ON booking_date counts each order on the day it was booked, not over the
nights of its stays.
FROM revenue
SHOW orders, customers, average_order_value
ON booking_date
DURING last_quarter
GROUP BY new_or_returning_customerVAT by rate and account
FROM revenue
SHOW net_revenue, vat_amount
DURING last_month
GROUP BY vat_rate, account
WITH TOTALSWhat it counts
Every order line sold, as posted after discounts and package allocation, with its VAT split. Stay lines are spread over their nights.
Dates
Rows are dated by service_date (default), posting_date 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 revenue.
-
net_revenue· MoneyRevenue excluding VAT, from each line's VAT split. Lines without a VAT split are not included.
-
gross_sales· MoneySales excluding VAT, before discounts. Gross sales less discounts is net revenue. A line paid with a pass counts as zero. Lines without a VAT split are not included.
-
discounts· MoneyDiscounts given, excluding VAT, including discounts on packages. A package priced below its parts is not a discount. A line paid with a pass counts as zero. Lines without a VAT split are not included.
-
total_revenue· MoneyRevenue including VAT, after discounts. Net revenue plus VAT, and the line total of a line without a VAT split.
-
vat_amount· MoneyOutput VAT on the lines sold.
-
units_sold· NumberItems sold (stays, tickets, appointments, products, passes). Meaningful within one revenue category.
-
orders· NumberOrders with a line in the result, each counted once per row. An order with lines on several days or in several categories counts in each of them. A cancelled order that kept a cancellation fee counts, with the fee as its revenue.
Doesn't add up over time, so
WITH CUMULATIVEcan't take it. -
average_order_value· MoneyRevenue excluding VAT, after discounts, divided by orders. An order whose lines have no VAT split counts with no revenue. ON booking_date dates each line by when it was booked, so a stay added to an order later counts on its own day; by service date, an order whose stay runs over two months counts in both.
Doesn't add up over time, so
WITH CUMULATIVEcan't take it. -
customers· NumberCustomers with an order in the result, each counted once per row. Anonymous walk-in customers aren't counted. Guests booked through an OTA often arrive as a new customer for every booking.
Doesn't add up over time, so
WITH CUMULATIVEcan't take it.
Dimensions
Dimensions you can group and filter by in FROM revenue.
-
room_type· TextThe accommodation (room type) a stay or capacity belongs to.
-
revenue_category· TextWhat was sold: Accommodation, Events, Services, Products, Passes, Fees or Other. Stands in for departments until SERVOS has them.
Values:
Accommodation,Events,Services,Products,Passes,Fees,Other. -
line_kind· TextThe kind of order line.
Values:
stay,stay_addon,ticket,appointment,appointment_addon,product,pass,fee,other. -
product· TextWhat was sold, by its current catalog name: room type, add-on, event, service, product, pass or fee.
-
product_type· TextThe product type set on catalog products.
-
activity· TextThe event or service (experience) sold.
-
activity_variant· TextThe ticket or service variant sold. In activity_capacity only seats have a variant: grouped by it, each activity adds a row with no variant and 0; HAVING seats_sold > 0 hides it.
-
event_category· TextThe category set on an event (concert, workshop, …).
-
vat_code· TextThe tax group a line was taxed under.
-
vat_rate· NumberThe VAT rate in percent, e.g. 25 or 12.
-
tax_level_code· TextThe optional code set on a tax group for the accounting system.
-
account· TextThe ledger account a line posts to, from its tax group.
-
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.
-
new_or_returning_customer· TextWhether the order was the first the customer booked (new) or a later one (returning), by booking time, so a second booking is returning even when its stay comes first. A cancelled first order still counts as the first. Empty for anonymous walk-in customers. Guests booked through an OTA are often new every time.
Values:
new,returning.