Business Intelligence Information Systems · Week 2 · Tableau lab 1 of 5
What is in the data, and what sells?
A 70-minute lab in 7 steps (the first one you do at home, before class). You work in Tableau with the real bookings of two hotels in Portugal (119,388 bookings, 2015–2017). Every step ends with a checkpoint: type the number you see in Tableau and the page tells you whether you are on the right track. Your progress is saved in this browser.
1. Before the lab: software and data (at home, 15 min)
The lab runs on your own laptop. You need two things before you come to class, because the Tableau licence takes 1–2 days to be approved.
A. Tableau
RECOMMENDED · TABLEAU DESKTOPFree for students for one year through Tableau for Students. Apply with your university e-mail (uom.edu.gr); when approved, download Tableau Desktop and enter the key. Saves locally (.twbx) and connects to anything.
ALTERNATIVE · TABLEAU PUBLICFree for everyone, no application: public.tableau.com. Almost the same interface. Since 2024 it also saves locally; anything you publish is public. Fine for the lab, not for real company data.
B. The data
Download hotel_bookings.csv (18 MB) and save it in a folder you will find again, e.g. Documents/Tableau. It holds 119,388 bookings of a resort hotel (Algarve) and a city hotel (Lisbon), July 2015 – August 2017; one row = one booking. It is one of the best-known open hotel datasets (Antonio, de Almeida & Nunes, 2019), lightly cleaned for the course. We use the same file in all five labs.
Data dictionary (hotel_bookings.csv)
Column
Meaning
Booking ID
Sequential booking number. We count bookings by counting these.
Hotel
Resort Hotel (Algarve) or City Hotel (Lisbon)
Canceled
Yes if the booking was cancelled, No if the guest arrived
Arrival Date / Year / Month
Arrival date, plus year and month as separate columns
Lead Time (days)
Days between booking and arrival
Nights, Weekend Nights
Nights in total and at the weekend
Adults, Children, Guests
Adults, children, total people
Meal
Bed & Breakfast, Half Board, Full Board, Self Catering
Country
Guest's country of origin
Market Segment
Online TA, Offline TA/TO, Direct, Groups, Corporate, Complementary, Aviation
Distribution Channel
TA/TO (travel agents and tour operators), Direct, Corporate, GDS
Repeated Guest
Yes if the guest has stayed before
Deposit Type
No Deposit, Non Refund, Refundable
Customer Type
Transient (individual), Transient-Party, Contract, Group
Room Type
Code of the room type booked (A–L)
ADR
Average Daily Rate: average price per night, in euro. The basic price indicator in hotels.
Revenue
ADR × Nights: the revenue of the booking. For cancelled bookings, the revenue that was lost.
Special Requests
Number of special requests (high floor, twin beds…)
Reservation Status
Check-Out, Canceled, No-Show
Ready?
2. Connect and look around: dimensions and measures (10 min)
Tableau does not "open" files like Excel does; it connects to data sources: files, databases, cloud services. The first thing you see is the Data Source page, where you check that it understood the columns correctly.
Open Tableau. On the start screen, under Connect › To a File, choose Text file and select hotel_bookings.csv.
On the Data Source page you see the columns and the first rows. Above each column there is a type icon: Abc text, # number, 📅 date, 🌐 geographic.
Check that Arrival Date has a date icon and Country a globe. If not, click the icon and change the type.
Click Sheet 1 at the bottom left. This is a worksheet, where views are built.
The most important idea in Tableau
In the Data pane on the left, the fields come in two colours:
BLUE · DIMENSIONSCategories that slice the data: HotelCountryMarket SegmentArrival Date. They answer "per what?".
GREEN · MEASURESNumbers that are aggregated: ADRRevenueNightsLead Time (days). They answer "how much?". Tableau sums them (SUM) unless you say otherwise (AVG, COUNT…).
Every view is a combination: one or more measures, per one or more dimensions. "Revenue per month", "bookings per country", "average price per hotel and month".
WATCH OUTBooking ID is a number, so Tableau lists it as a measure. Summing it is meaningless. We use it with COUNT to count bookings: drag it to the dimensions (above the line) or just change the aggregation to Count whenever you need it.
Checkpoint 1
How many bookings are in the file?
3. The first view: bookings and cancellations per hotel (10 min)
In Tableau you build views by dragging fields onto shelves: Columns (horizontal), Rows (vertical) and the Marks card (colour, size, label).
Drag Hotel to Columns.
Drag Booking ID to Rows. Right-click the pill › Measure › Count. You see two bars.
Drag Canceled onto Color on the Marks card. The bars split into two colours.
Drag Booking ID again onto Label (Count again) to show the numbers.
Double-click the Sheet 1 tab at the bottom and rename it Bookings per hotel. Name every sheet you make; you will reuse them.
TRY ITClick Show Me at the top right. It shows which chart types fit the fields you have selected. Try "stacked bar" and "side-by-side bar", then come back with Ctrl+Z.
Checkpoint 2
How many City Hotel bookings were cancelled?
Compare with the Resort Hotel. The city hotel loses more than 4 in 10 bookings, the resort fewer than 3 in 10. Why? Keep the question; in Lab 4 we will answer it with data.
4. What sells? Revenue per market segment (12 min)
The question of the day. "What sells" needs a measure of money (Revenue) and a dimension that describes how the hotel sells (Market Segment: online travel agents, tour operators, direct bookings, groups…). One problem: cancelled bookings have a Revenue value too, but that money never arrived. We must leave them out.
New worksheet (New Worksheet icon at the bottom, or Ctrl+M).
Drag Market Segment to Rows and Revenue to Columns. Horizontal bars, one per segment.
Drag Canceled to the Filters shelf. In the dialog tick only No › OK. The bars shrink: this is realised revenue.
Sort: hover over the Revenue axis and click the sort icon, or use the toolbar sort button. Largest at the top.
Drag Revenue onto Label. Right-click the label pill › Format › Numbers › Currency (Custom), 0 decimals, prefix €.
Rename the sheet Revenue per segment.
Checkpoint 3
What is the realised revenue of the Online TA segment?
5. Drill down: segment × hotel × meal (10 min)
One dimension gives an overview; a second one explains it. We add Hotel and then Meal to see which product the segments buy.
Duplicate the sheet: right-click the Revenue per segment tab › Duplicate. Rename the copy Revenue by hotel and meal.
Drag Hotel to Rows, to the left of Market Segment. Every segment is now split per hotel. Notice the nesting: the headers read Hotel › Market Segment.
Replace Market Segment with Meal: drag Meal onto the Market Segment pill on Rows (it swaps). Now: revenue per hotel and meal plan.
Click Swap Rows and Columns in the toolbar (Ctrl+W) and back. Decide which orientation reads better for long category names.
Sort within each hotel: click the sort icon on the Revenue axis. The sort happens inside each hotel because the pills are nested.
Checkpoint 4
Realised revenue of Half Board at the Resort Hotel?
Write down one sentence: what is the difference in the product mix between the two hotels? You will need it at the end.
6. SUM or AVG? The price question (10 min)
"What sells" has a second half: at what price. ADR is the average price per night of each booking. Tableau will SUM it by default, and a sum of prices means nothing. This step is about choosing the aggregation deliberately.
New worksheet. Hotel to Columns, ADR to Rows. You get SUM(ADR): two tall, meaningless bars.
Right-click the SUM(ADR) pill › Measure › Average. Now the bars show the typical price per night.
Add Canceled to Filters, keep only No (prices of stays that actually happened).
Drag ADR to Label, set it to Average as well, format with 2 decimals.
Try Measure › Median on the same pill. Is it higher or lower than the average? What does that tell you about the distribution of prices?
Rename the sheet Average price per hotel.
Checkpoint 5
Average ADR of the City Hotel (non-cancelled bookings)?
7. Filters are questions: where do the guests come from? (10 min)
A filter is not a technical setting; it is a way of asking a narrower question. Here we let the user of the view ask it, with a filter card.
New worksheet. Country to Rows, Booking ID (Count) to Columns. Sort descending. 177 countries: too many.
Drag Country to Filters › tab Top › By field › Top 10 by Count of Booking ID › OK. Ten bars remain.
Add Canceled to Filters, keep No. Then right-click that pill › Show Filter. A filter card appears on the right: tick Yes, untick No, and watch the view change. This is how a dashboard user will explore.
Add Hotel to Color. Which countries prefer the resort, which the city?
Rename the sheet Top 10 countries.
Checkpoint 6
How many non-cancelled bookings came from the United Kingdom?
ONE MORESelect the Portugal bar, click Exclude. Portugal is the domestic market and dwarfs everything else; without it the foreign markets become comparable. Then remove the exclusion (drag the pill off the Filters shelf): hiding the biggest category is a decision you must state, not a default.
8. Before you leave, and homework (8 min)
You have five named sheets. Save your work and hand in the small deliverable before leaving the room; the homework is one paragraph.
File › Save As › Surname_Lab1.twbx (packaged workbook, includes the data). In Tableau Public: File › Save locally, or Save to Tableau Public.
Open the sheet Revenue per segment › Worksheet › Export › Image › save as PNG.
Upload the .twbx and the PNG to eClass before you leave.
HOMEWORK (BY NEXT LECTURE, ~15 MIN)
One paragraph in eClass, three sentences: (1) one finding from today's views that a hotel manager would want to know, with the number; (2) the difference in the product mix between the two hotels (your sentence from step 5); (3) one question about the data that you could not answer yet with what you know.
Checkpoint 7
How many named sheets does your workbook have?
Next lecture
Lab 2: how do I see it? Encoding with colour, size and shape; scatter plots of price against lead time; highlight tables. Bring your .twbx; we build on it.