Skip to main content

Ihr Browser ist zu klein

Bitte ändern Sie die Größe Ihres Browsers, um weiterhin interaktiv lernen zu können. Wir empfehlen eine Breite von mindestens 900 px.

Learning Objectives

After this unit, you’ll be able to:

  • Change data types.
  • Rename and hide fields.
  • Modify default properties.

Connect Your Tableau Public Account

To get started, connect to your Tableau Public account in the Playground window to the right. If you don’t already have a Tableau Public account, sign up for one now, and be sure to activate your account before starting this interactive unit. You can find more detailed instructions in The Tableau Data Model.

Note

The playground will reset if your Tableau Public login session expires or if you refresh the page before completing the unit. We recommend completing this unit in one sitting.

Format Data for Analysis

Welcome to the authoring environment of Tableau! On the left is the Data pane, with all of the fields arranged in their respective tables. Per table, dimensions are above the line, measures are below the line.

Let’s do some cleanup of data types, field types, and field names. You’ll also hide some redundant fields.

Ensure Accurate Data Types

If you see a list of tables and no fields, click the caret next to a table name to expand it. You can also collapse tables to make it easier to navigate.

  1. Expand the Bakers.csv table. In the Bakers table, the Season (Bakers.csv) field is below the line, meaning it’s a measure and is treated as something Tableau can do math with.

But we know that even though Season is a number (1, 2, 3…), these are just labels. They might as well be text, such as The First Season, The Second Season, and The Third Season.

Even though the values are numbers, the Season field is actually a dimension. This is also true of numeric ID fields or things like phone numbers and numeric postal codes. (It's also a powerfully important concept, so check out field types for more info if you're curious.)

  1. Drag Season (Bakers.csv) above the horizontal line in the Data pane to convert it to a dimension. Rather than dragging a field, you can also right click a field and choose Convert to Dimension.

If you look at the icon in front of the fields, most of them are Abc. This means they’re string (or text) fields.

  1. What about Image Link? In the Data pane, find the field Image Link and double-click it to add it to the viz.

A pill for this field is added to the Rows shelf, and there’s a row for each value in this field. If you hover over a row in the viz canvas, you can see that the Image Link field contains URLs. These are URLs to headshots of the bakers on the Great British Bake Off website.

  1. Drag the Image Link pill away from the shelf to clear the viz.
    • When dragging a field off a shelf, drop it anywhere that's not outlined in orange as an active drop area. It doesn't need to go anywhere in particular.
    • If you accidentally put it somewhere rather than removing it, click the Undo button in the toolbar and try again.
  2. In the Data pane, click the Abc to the left of Image Link.
  3. Use the data type dropdown to select Image Role | URL.

This tells Tableau that the field contains URLs pointing to an image file. Now if you use that field in the viz, it will display the underlying picture instead of the URL.

Note

There are alternative ways to do many actions in Tableau. Instead of dragging a field above or below the horizontal line in the data pane, or a pill off a shelf, you can also right-click and select the desired option. If you're clearing the entire viz, you can use the Clear Sheet icon in the toolbar.

Adjust Field Names

Looking through the Data pane, you can see there are multiple copies of the fields Baker, Episode, Season, or SeasonEpisode across multiple tables. There are also many fields with similar names. A best practice is to hide fields you don't need and to clean up field names whenever possible to minimize confusion.

As a best practice, you should keep whichever version of a field has the most complete data. To keep the field Baker in the Bakers.csv table with a clean name, do the following.

  1. In the Bakers.csv table, right-click Season (Bakers.csv) field. Tip: Make sure you're not clicking the table name or a field with a similar name. It should be the field named Season, with (Baker.csv) appended at the end. Go slow and be careful!
  2. Then, click Hide.
  3. In the ChallengeBakes.csv table, right-click the field Baker.
  4. Then, select Rename.
  5. Rename it Baker-duplicate.
  6. In the Bakers.csv table, right-click the field Baker (Bakers.csv) and rename it Baker.

If you accidentally renamed an entire table or the wrong field by accident, use the Undo button in the toolbar and try again. Take your time and check the directions carefully. Cleaning up messy fields requires close attention to detail.

Tidy Up the Data Pane

Let's clean up the rest of the tables—and remember to go slow and double check what you're doing.

  1. In the ChallengeBakes.csv table:
    • Hide Baker-duplicate
    • Hide Episode (ChallengeBakes.csv)
    • Hide Season (ChallengeBakes.csv)
  2. In the Episodes.csv table:
    • Drag Episode above the line to convert it to a dimension.
    • Rename Season to Season-duplicate.
    • Hide Season-duplicate.
    • Rename MyRating (out of 10) to My Rating. Make sure there's a space between the words.
  3. In the Outcomes.csv table:
    • Hide Baker (Outcomes.csv).
    • Hide SeasonEpisode (Outcomes.csv).
  4. In the Seasons table:
    • Rename Season (Seasons.csv) to Season.
    • Drag the following fields up to convert them to discrete (blue) dimensions. (Like before, these are numeric fields that aren't measures you'd do math with, so they should be dimensions.)
      • Netflix Collection
      • PBS Season
      • Roku Season
      • Season
  5. Change the data type for Year to String by clicking the data type icon. (This ensures the value is displayed as 2021, not 2,021. Note: you could also do this by setting default formatting, but for this field it's not going to cause problems to make it a string.)

What a tidy Data pane! The following quiz confirms you followed the steps above. Should you find that you’ve gotten a result outside of what’s expected, you can try again by resetting your hands-on environment. To reset your environment, simply refresh this page. Before you do, make sure you really want to reset. You will lose any work you’ve done in this unit.

Resources