City University of Hong Kong · FACULTY OF INFORMATION TECHNOLOGY

IS6335 Chap.11 Tableau, R and Python Across the Lab Exercises

- one subject, every graph, every model, every mark
8 Chapters4-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 11 of 12 · IS6335

Tableau, R and Python Across the Lab Exercises

Three tools, and the job each one is introduced to do

The lab track is worth thirty per cent of the course, delivered as six exercises in weeks three to six and weeks eight and nine, with week seven given over to the milestone presentation.

Each exercise is small, submitted individually on Canvas, and earns full credit for being submitted by the deadline; late submission is described as allowed only in exceptional circumstances. The grading rule has a plain consequence.

Because the marks are for submission rather than for quality, attempting an exercise properly costs only time, while skipping one costs five per cent of the whole course.

The tools are not interchangeable across the semester. Tableau carries the early weeks because it needs little programming and works by drag and drop, so a whole class can build a dashboard in one session.

R carries the middle of the course, with ggplot2 and data.table for table work and mature packages for mapping, three dimensional plots and network layout through igraph. Python carries the advanced module, where pandas, numpy and scikit-learn lead into model training.

The course records no prerequisite of programming background, so the sequence is also a ramp.

The four Tableau objects, and why the order matters

Almost every avoidable Tableau problem comes from not knowing which object you are standing in. A workbook contains sheets, and a sheet is a worksheet, a dashboard or a story. Access runs downward only.

A worksheet holds a single view with its shelves, its legends and the data pane, and it is the only place where source data, dimensions, measures and custom fields are available. A dashboard collects views from several worksheets and cannot reach dimensions and measures directly.

A story is an ordered set of worksheets or dashboards assembled to carry one line of argument, and it reaches those but not the fields.

The practical rule follows immediately. If a mark is the wrong colour or a field is missing, the fix lives in the worksheet that produced the view, not in the dashboard that displays it.

Hunting for a field on a dashboard is the single most common way to lose half an hour of a lab session.

Dimensions and measures, and the conversion that repairs most charts

Tableau divides fields into dimensions, which cannot be aggregated and are normally used for row or column headings, and measures, which can be calculated or aggregated or used in mathematical operations and are normally what gets plotted.

The two convert into each other by dragging or by right-clicking.

That conversion maps exactly onto the attribute types from the third chapter, and it is the repair for a large family of wrong charts. A field the tool has read as a measure but which is really categorical, a year, a store number, a survey code, will be summed into nonsense until it is converted to a dimension.

The tool cannot know which it is; the attribute type is something you know and it does not.

The tutorial's own worked failure

The week two tutorial document is built around a failure it expects you to hit, and it is the right one to learn from. On connecting to the data, the data grid shows a type icon for every field. Latitude is correctly interpreted as geospatial. Longitude is treated as numerical.

The instruction is to correct it by changing the field to the geographic role of longitude, and then to check that every other field has been interpreted correctly too.

The order of the tutorial's tasks is as instructive as the repair.

Connect and stop, reading the data source page with its left pane describing the connection, its canvas where tables are related, its data grid previewing the first thousand rows and its tab you can always return to. Read the type icons before drawing anything, because they are the tool's guess at your attribute types and the guess comes from the values alone.

Repair the geographic and date fields first, since a wrong type there produces a chart that looks plausible rather than one that looks broken. Check every remaining field, which is what the tutorial asks and almost nobody does.

And only then state the question, which is exactly where the tutorial places it.

Two published limits that will decide your project tooling

The free public edition used in the lab connects to Excel and text files but not to databases, cannot save workbooks privately, puts anything saved onto a public server, allows ten million rows in a single connection and provides ten gigabytes of account space.

The middle two matter most. If your group is considering data that is personal, commercial or otherwise restricted, the public edition is not an appropriate place to put it, and the honest options are a different tool for that dataset or openly published data instead.

In this chapter

What this chapter covers

  • 01

    Six exercises, their weeks, and what the grading rule implies

  • 02

    Which tool the plan uses for which material

  • 03

    Workbook, worksheet, dashboard and story

  • 04

    Why access runs downward only

  • 05

    Dimensions and measures, and converting between them

  • 06

    The data source page and its four areas

  • 07

    Repairing a field the tool typed wrongly

  • 08

    The published limits of the free public edition

Worked example · free

Diagnose a map that plots every point in the sea

Q [6 marks]. AskSia authored practice. You build a map from a station file and every mark lands at the point where latitude and longitude are both zero, off the west coast of Africa. Name three causes that produce this symptom and the single check that separates them. The marks shown here are a study allocation and are not the University's published marking scheme.
  • 2Read the symptom and say what it implies about the values.
  • 3Name three causes.
  • 1Give the check that separates them.
That location is where both coordinates are zero, so the symptom says the coordinates are arriving as null or as zero rather than that the map itself is wrong. Three causes produce it. The longitude field may not carry a geographic role, so the tool is treating it as a plain number and supplying nothing to the map, which is the failure the course tutorial deliberately walks you into. The field may be aggregated, so every row has collapsed into a single mark at the average of nothing. Or the join in the canvas may have failed, leaving the coordinate columns empty for rows that came from the other table. The check that separates them is the data grid. If coordinates are present and sensible there, the fault is in the role or in the aggregation and lives in the worksheet; if they are blank there, the fault is in the connection and lives on the data source page.
Sia tip — When a field misbehaves, check the data grid first. Sensible values there mean the fault is a role or an aggregation in the worksheet; blank values there mean the fault is in the connection.
Glossary

Key terms

Worksheet
The Tableau object holding a single view together with its shelves, legends and data pane. It is the only place where fields themselves can be reached.
Dashboard
A collection of views drawn from several worksheets. It cannot reach dimensions and measures directly, which is why a field-level fix belongs in the worksheet.
Dimension
A Tableau field that cannot be aggregated, normally used for a row or column heading. Converting a wrongly typed measure into one repairs a large family of charts.
Geographic role
The property telling Tableau that a field is a latitude, a longitude or another spatial identifier. Without it a coordinate is treated as an ordinary number.
Data grid
The preview of the first thousand rows on the data source page, showing each field with its inferred type icon. It is where a connection fault is distinguished from a typing fault.
FAQ

Tableau, R and Python Across the Lab Exercises FAQ

Should I use the drag-and-drop tool or code for the project?

Decide by repetition rather than by preference. Anything you will rebuild when the data changes is cheaper in code, because the steps are written down and rerun rather than remembered and repeated. Anything you will build once and then discuss with an audience is faster by hand, and interaction is much cheaper in the tool. Most groups end up with both, and the write-up should say which parts came from where.

For a weekly exercise the answer is simpler: use the tool the tutorial uses, because the exercise is testing that week's idea rather than your tooling.

Can we put our group data into the free public edition?

Only if you are free to publish it. The published limits state that workbooks cannot be saved privately and that anything saved goes onto the public server, so confidentiality is not available at that tier. The same limits rule out connecting directly to a database, which affects any plan built around a live query.

If your dataset is personal or commercial, either choose openly published data, which both project briefs allow since they accept online sources, or do that part of the work in a tool where the file stays local.

Study strategy

Assessment move

Spend the first fifteen minutes of every lab exercise on the data source page rather than on the chart. Read every type icon, fix the geographic and date fields, and write down which fields you converted between dimension and measure. That habit turns the most common lab failure into a thirty second repair, and the list of conversions is a ready-made part of the steps of analysis the report rubric asks you to describe.

Working through Tableau, R and Python Across the Lab Exercises in IS6335? Sia is AskSia’s AI Information Technology tutor — ask any IS6335 Tableau, R and Python Across the Lab Exercises question and get a clear, step-by-step explanation grounded in how IS6335 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 2 of your City University of Hong Kong subjects - and 1,000+ Bibles across every Australian university.
Sia - your IS6335 tutor, unlimited, worked the way the exam marks it
The full 4-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works