Skip to main content

Su navegador es demasiado pequeño

Amplíe el tamaño de su navegador para continuar con el aprendizaje interactivo. Recomendamos un ancho mínimo de 900 píxeles.

Learning Objectives

After completing this unit, you’ll be able to:

  • Sort data for more intuitive analysis.
  • Use the marks card for a more visual representation of data.
  • Use color and change color palettes for clearer communication of data.

Check: Connect Your Tableau Public Account

If you haven’t already, or if the playground has timed out, log into 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 resets 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.

Get the Details Right

You now have a viz that’s a bar chart of the average rating per season. But there are multiple episodes in each season, and it might be useful to see them all in one chart.

Let’s duplicate this sheet to keep a copy of the viz as it is now and continue working with a new one.

  1. Right-click the sheet tab Avg Seasonal Ratings and select Duplicate.
  2. Double-click the tab for the new sheet and rename it Ratings Per Episode.
  3. From the Episode.csv table, drag Episode onto Detail on the Marks card. Tip: If you’re not sure what table to expand to find a field you want, try using the search bar.

You should see that each bar is now divided into segments. Do you assume that the bottom-most segment in each bar is episode 1, and the segment at the top of each bar is the last episode? We sure did. But verifying assumptions as you go is a good habit to get into. It’s easy to assume you know what’s going on and it’s not always clear when your assumptions are wrong—unless you check.

  1. From the Data pane, drag the Episode field to Label on the Marks card. This will create a second pill for the Episode field.

Huh? It looks like the top segment of each bar is the first episode, and the bottom-most segment is the last episode. That feels counterintuitive for this data set, but you can fix it to match expectations.

  1. Right-click either copy of the Episode pill on the Marks card to open the context menu.
  2. Click Sort.
  3. In the Sort dialog, change the sort order to Descending and close the dialog.

Now your labels show a sort that makes more sense—the bottom-most episode is episode 1.

  1. Right click the Episode pill with the T icon on the Marks card and select Remove to remove the labels in the viz. Tip: Make sure to remove the pill with the T (label) icon in front of it, not the detail icon.

Let’s pause again and evaluate what’s in the chart.

  • The individual segments in the bars are each episode.
  • The height of each segment is the rating for that episode.

Encode with Color

It can be hard to compare heights across segments when they're stacked like that. Let’s encode the rating another way: with color.

  1. Drag the My Rating field from the Data pane to Color on the Marks card. Again, you want a new copy of the My Rating field as another pill.

A color legend is automatically generated, and the ratings range from a low of 6.6 (light blue) to a high of 8.6 (dark blue).

  1. To better call out when ratings were below or above the middle, apply a diverging color palette. Click on the Color shelf.
  2. Then click Edit Colors.
  3. Open the dropdown menu under Palette (that currently says Automatic).
  4. Scroll down to select Gold-Purple Diverging.
  5. Close the dialog.

Now you have a viz that shows a bar per season, broken down into colored segments per episode, where the height of the segment and the color both convey the rating for that episode.

You changed the rating from SUM to AVG on the Rows shelf. Why didn’t you do so when you used the same field on Color?

The rating is per-episode. If part of the viz is at the level of a single episode (such as one segment per episode) that mark consists of only one number (that episode’s rating). Therefore, most aggregations like sum, average, min, and max are all the same value—because there’s only one number!