-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from LaunchCodeEducation/tableau-4
Tableau Part 4
- Loading branch information
Showing
8 changed files
with
453 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
+++ | ||
pre = "<b>27. </b>" | ||
chapter = true | ||
title = "Tableau Part 4: Stories and Dates" | ||
date = 2024-06-04T15:10:04-05:00 | ||
draft = false | ||
weight = 27 | ||
+++ | ||
|
||
## Learning Objectives | ||
|
||
Upon completing all the content in this chapter you should be able to do the following: | ||
|
||
1. Effectively handle datetime data in Tableau and use it in your visualizations | ||
1. Implement the best practices introduced earlier in the textbook with Tableau | ||
1. Combine visualizations to make dashboards and stories | ||
|
||
## Key Terminology | ||
|
||
Here is a list of key terms for this chapter broken down by the page upon which the term first appears. Make note of each term and its meaning. | ||
|
||
### Dates and Times | ||
|
||
1. discrete date fields | ||
1. continuous date fields | ||
|
||
### Tableau Stories and Dashboards | ||
|
||
1. story | ||
1. dashboard | ||
1. story point | ||
1. worksheet | ||
|
||
## Content Links | ||
|
||
{{% children %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
+++ | ||
title = "Exercises" | ||
date = 2021-10-01T09:28:27-05:00 | ||
draft = false | ||
weight = 2 | ||
+++ | ||
|
||
This chapter is focused on working with dates and creating beautiful and effective visualizations and stories in Tableau. So when it comes to practicing these functions, we want you to create a bullet journal in Tableau. | ||
|
||
A bullet journal is a system designed by Ryder Carroll that has grown in popularity over the past decade with over 10 million posts on Instagram under #bulletjournal and countless Youtubers sharing their latest bullet journal spreads. Many attribute the popularity of the system to its flexibility. Ultimately, us as the journalers can decide to put in our journals whatever we need. We can create spreads to track our progress on financial goals, reading goals, or any other goals that matter to us. We can also be as artistic as we want to be with our bullet journals. | ||
|
||
While you will likely find many posts about the virtues of bullet journals as a creative endeavour, every bullet journal contains a lot of data and a lot of it is time-based, which is why we are asking you to create one in Tableau. | ||
|
||
## Getting Started | ||
|
||
Before you open up Tableau, take some time to brainstorm. You need to create at least three visualizations, representing three spreads in your Tableau bullet journal. If you are already a bullet journal advocate, do you want to recreate three spreads you have already made? Are you struggling to think of what data you could track with Tableau? People have created so many wonderful different spreads in bullet journals, so here are just a few ideas to get you started. | ||
|
||
1. water intake | ||
1. exercise data, such as steps and workout trackers | ||
1. hours of sleep | ||
1. screentime | ||
1. mood tracker | ||
1. mealtimes/macros intake | ||
1. goodreads | ||
1. medicine tracker | ||
|
||
In addition, you can also find even more ideas on Pinterest and Instagram. Once you have your three spreads planned, you need the data behind the spreads. If you do not want to share your own data, try to make a bullet journal for a fictional character. Your data can be in whatever form you find helpful whether it starts with a spreadsheet or pandas DataFrame. If you pull any data from Kaggle to add to your bullet journal, make sure to share the source. | ||
|
||
## Putting together Your Visualizations | ||
|
||
As you assemble your three visualizations, recall the best practices we shared in the reading. How can you employ best practices to make your bullet journal stand out? | ||
|
||
Once you have three visualizations, you need to assemble your work in EITHER a dashboard or a story. Recall that dashboards can help users compare related visualizations while storys can combine visualizations that may seem unrelated to effectively relay our work. | ||
|
||
## Submitting Your Work | ||
|
||
Once your work is complete, publish your story and submit the link on Canvas for the exercises. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
+++ | ||
title = "Next Steps" | ||
date = 2021-10-01T09:28:27-05:00 | ||
draft = false | ||
weight = 4 | ||
+++ | ||
|
||
That brings an end to our work on Tableau! Before you dive into mathematical modeling, if you feel that you need some additional resources on Tableau, here are a few of our favorites on the topics covered in this chapter. | ||
|
||
1. [Best Practices for Effective Dashboards](https://help.tableau.com/current/pro/desktop/en-us/dashboards_best_practices.htm) | ||
1. [Do No Harm Guide (7:08 min video)](https://www.tableau.com/foundation/data-equity/do-no-harm) | ||
|
||
In addition, we recognize that many of these topics can feel somewhat nebulous so if you want some additional practice, we recommend you check out this [great resume activity](https://www.tableau.com/blog/how-create-interactive-resume-tableau) from Tableau! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
+++ | ||
title = "Reading" | ||
date = 2024-06-04T15:10:04-05:00 | ||
draft = false | ||
weight = 1 | ||
+++ | ||
|
||
## Reading Content | ||
|
||
{{% children %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
+++ | ||
title = "Dates and Times" | ||
date = 2024-03-12T15:04:03-05:00 | ||
draft = false | ||
weight = 1 | ||
+++ | ||
|
||
The first objective we want to cover is learning about how to work with datetime data in Tableau. As we have already seen throughout this course, SQL and Python handle datetime data so we want to take a look at how Tableau handles it. Datetime data can be tricky, but vital in an analysis, so we want to prepare you to tackle it. | ||
|
||
## Loading Datetime Data into Tableau | ||
|
||
The first step in working with datetime data is to review your data before loading it into Tableau. You may have to convert the data from strings to datetime manually if Tableau doesn't load it properly. | ||
|
||
Once your data is loaded, you should see a calendar icon if the data loaded as datetime data. If you don't, then the data was loaded as a string. You can convert the data field by clicking on the string icon and selecting *Date & Time* from the resulting menu. | ||
|
||
{{% notice blue Note %}} | ||
|
||
If Tableau was unsuccessful in converting the field, then the data will become null values so you may have to try out the [DATEPARSE function](https://help.tableau.com/current/pro/desktop/en-us/data_dateparse.htm?_gl=1*9plr4*_ga*MTY0NDMzMDU4Mi4xNzE1MTE1NDU0*_ga_8YLN0SNXVS*MTcxODIwODU2NS4zOS4xLjE3MTgyMDkxMzAuMC4wLjA.#dateparse). | ||
|
||
{{% /notice %}} | ||
|
||
## Continuous versus Discrete | ||
|
||
Tableau has two different types of date fields: continuous and discrete. **Discrete date fields** are the default in Tableau and can be used to create bar charts or other visualizations where you want to compare the values between dates. You will notice that means that all dates immediately become dimensions and are blue. **Continuous date fields** are used to measure the changes in values over time and are under measures making them green. To change a date field from discrete to continuous, right-click on the field and click *Convert to Continuous*. You will know the change was successful when the field moves from dimensions to measures and changes color. | ||
|
||
{{% notice blue Note %}} | ||
|
||
Always make sure you converted the field to datetime data before attempting to convert it to continuous! | ||
|
||
{{% /notice %}} | ||
|
||
## Date Functions | ||
|
||
In [SQL Part 2]({{% relref "../../../sql-part-2/reading/date-time-functions" %}}), we saw how we can use functions to perform important calculations related to dates and times. Tableau has a number of similar functions that allow us to perform different analyses. For all the examples below, we are working for a major corporation analyzing their hiring and employment data. | ||
|
||
### DATEADD | ||
|
||
`DATEADD` has a similar functionality in Tableau where we can add to a start date. If we are visualizing employee start dates and want to find the end of the 90-day probationary period, we can do the following: | ||
|
||
{{% notice blue Example %}} | ||
|
||
`DATEADD('day', 90, [start date])` | ||
|
||
If the start date was 6/1/2024, the value returned would be: | ||
|
||
`8/29/2024` | ||
|
||
{{% /notice %}} | ||
|
||
### DATEDIFF | ||
|
||
`DATEDIFF` tells us the difference between two dates in either days, weeks, months, or years. For example, we could find out an employee's tenure at the company with the following: | ||
|
||
{{% notice blue Example %}} | ||
|
||
`DATEDIFF('year', [start date], [end date])` | ||
|
||
If the start date was 6/1/2019 and the end date was 6/15/2024, the value returned would be: | ||
|
||
`4` | ||
|
||
{{% /notice %}} | ||
|
||
### DATENAME | ||
|
||
`DATENAME` returns the name of a component of a date. For example, if we want to return the name of the month an employee started in, we can do the following: | ||
|
||
{{% notice blue Example %}} | ||
|
||
`DATENAME('month', [start date])` | ||
|
||
If the employee started on 6/1/2024, the value returned would be: | ||
|
||
`June` | ||
|
||
{{% /notice %}} | ||
|
||
### DATEPART | ||
|
||
`DATEPART` returns the numerical value of a component of a date. For example, if we want to return the number of the month an employee started in, we can do the following: | ||
|
||
{{% notice blue Example %}} | ||
|
||
`DATEPART('month', [start date])` | ||
|
||
If the employee started 6/1/2024, then the value returned would be: | ||
|
||
`6` | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice blue Note %}} | ||
|
||
Additional datetime functions in Tableau can be found in this [article](https://help.tableau.com/current/pro/desktop/en-us/functions_functions_date.htm). | ||
|
||
{{% /notice %}} | ||
|
||
## Check Your Understanding | ||
|
||
{{% notice green Question %}} | ||
|
||
When working with a relational data source, Tableau defaults dates as ______? | ||
|
||
1. Discrete fields | ||
1. Continuous fields | ||
|
||
{{% /notice %}} | ||
|
||
<!-- discrete fields --> | ||
|
||
{{% notice green Question %}} | ||
|
||
True or False: Converting a date to a continuous field is very useful when looking at trends. | ||
|
||
{{% /notice %}} | ||
|
||
<!-- true --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
+++ | ||
title = "Tableau Stories and Dashboards" | ||
date = 2024-03-12T15:04:03-05:00 | ||
draft = false | ||
weight = 3 | ||
+++ | ||
|
||
Finally, we want to cover how to combine individual charts in Tableau to make stories and dashboards. | ||
|
||
You won't oftentimes find in your career that one visualization says all that you need it to. You may have to create a series of visualizations to show off your analysis. A **worksheet** holds one chart. Tableau has two different ways to combine worksheets to convey your findings: **stories** and **dashboards**. Stories look like presentations in that each chart is on its own slide. Dashboards are one page where you can add as many visualizations as you want. | ||
|
||
## How to Create a Dashboard | ||
|
||
In the bottom left-hand corner, you have three buttons for creating a new worksheet, a new dashboard, and a new story. The button to create a new dashboard looks like a grid with a plus sign. Click on it to make a new blank dashboard. You can drag available worksheets into your dashboard. Before you start adding any visualizations, you might find it helpful to sketch out what you want to put in your dashboard. A dashboard works best when the visualizations put together are meant to be viewed all at once. For example, if you used Tableau for your personal budgeting, you might want to combine a visualization for your monthly expenses and your annual spending into a dashboard. Such a dashboard might help you more easily spot discrepancies in your spending on car maintenance. | ||
|
||
Another benefit of Tableau dashboards is that you can add interactivity for the user. You can add filters and navigation to help users seamlessly transition between dashboards or between a dashbord and a story. | ||
|
||
{{% notice blue Note %}} | ||
|
||
For a comprehensive list of every feature you can add to a dashboard, check out the [documentation](https://help.tableau.com/current/pro/desktop/en-us/dashboards_create.htm). | ||
|
||
{{% /notice %}} | ||
|
||
## How to Create a Story | ||
|
||
Unlike dashboards, stories help us group together related visualizations that we want to include in the same conversation, but do not want to directly compare. Just as with dashboards, you can start in the bottom left-hand corner with creating your first story by clicking the icon that looks like an open book with a plus sign. Your first story point is blank. However, on the left-hand side, you will find all the available worksheets and dashboards you can add. To add an item to your first story point, drag it inside the story point window. | ||
|
||
For each story point, your captions will appear above the visualization. Click on the gray box labeled *Add a caption* to enter your caption text. Remember you might not get a chance to explain all the details of your analysis so a caption can support your visualization if you do not get a chance to talk about it with your viewers. | ||
|
||
To add a new story point, you will want to redirect your attention back to the left-hand side and select *Blank* under *New Storypoint*. You can add as many story points as you need to convey your findings to your audience! | ||
|
||
## Story Best Practices | ||
|
||
While much of what we have already covered will serve you well when making effective stories, we want you to consider two new items when making your work shine: | ||
|
||
1. The order of your visualizations | ||
1. The screen size of the story | ||
|
||
For the order of your visualizations, there is no right and wrong we can summarize here. The most effective order depends on your audience and what you want to share. All we can say is that you may find it helpful to sketch out the order before you start assembling your story and as you make note of each viz, ask yourself "What is this visualization revealing to my audience and do the visualizations that come before it help enhance that point?". You want your story points to support each other and build up to your conclusions. | ||
|
||
Your story may not be shown on the screen that you are working on and if you do not size it accordingly, your visualizations may end up getting re-sized in a way that makes the legends and axes difficult to read. Below the listing of available worksheets and dashboards, you will find the list of available sizes so you can choose a standard size or set a custom size. | ||
|
||
{{% notice blue Example %}} | ||
|
||
Before you start creating your own stories, check out these stories on Tableau public. As you study each one, make a note of what you like about each one and what you are struggling with on each one. | ||
|
||
1. [Twenty-Two White Orchids by Will Strouse](https://public.tableau.com/app/profile/william.strouse/viz/Twenty-TwoWhiteOrchids/Twenty-TwoWhiteOrchids) | ||
1. [State Story 5.8 by Center for Employment Equity Embargoed Visualizations](https://public.tableau.com/app/profile/carly6373/viz/StateStory_5_8/StateStory) | ||
1. [Earthquake Trend Story Example by Tableau Help Content](https://public.tableau.com/app/profile/tableau.docs.team/viz/EarthquakeTrendStoryExample/Earthquakestory) | ||
|
||
{{% /notice %}} | ||
|
||
## Check Your Understanding | ||
|
||
{{% notice green Question %}} | ||
|
||
Match the following: | ||
|
||
| | | | ||
|---|---| | ||
| Dashboard | is based on different view or dashboard, or different stages of a single viz | | ||
| Story Point | is a single viz | | ||
| Worksheet | is collection of several views to compare a variety of data all at once | | ||
|
||
{{% /notice %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
+++ | ||
title = "Tips for Making the Most of Tableau" | ||
date = 2024-03-12T15:04:03-05:00 | ||
draft = false | ||
weight = 2 | ||
+++ | ||
|
||
Our second objective is to revisit the best practices we have already seen and learn how to implement these best practices in Tableau. | ||
|
||
## Revisiting Best Practices | ||
|
||
In [Data Visualization with Python](https://education.launchcode.org/data-analysis-curriculum/data-visualization/index.html), we introduced some best practices for building effective visualizations and tips for choosing a chart style. | ||
|
||
To start with creating an effective visualization, we need to follow three rules: | ||
|
||
1. Make sure that we have textual context | ||
1. Use a color palette that helps us stand out | ||
1. Keep it simple | ||
|
||
Let's see how we can ensure that we follow these three rules with Tableau. | ||
|
||
### Adding Textual Context | ||
|
||
We cannot guarantee that we will get the opportunity to walk every user through our visualizations so we need to add guiding text such as labels, titles, and captions. | ||
|
||
Tableau names the axes of a visualization after the fields that the visualization uses so you may not have the label you really want. To change it, right-click on the axis and select *Edit Axis*. In the resulting menu, you can change a number of characteristics of the axis such as the range, including the actual label text. Remember to add the dimensions of your axis in parentheses after the label text to make sure that the dimensions are clear to your users. If you right-click on the field label, you can click *Format Field* and change the font, font size, and color to better fit your visualization needs. Tableau defaults to field labels being a very dark gray which may not work with the colors chosen for your visualization or be easily readable by members of your team. | ||
|
||
To edit the title, right-click on the title and select *Edit*. The resulting dialog box will also have lots of options for re-formatting the title if you are already satisfied with the text. | ||
|
||
To edit a caption, you can find the *Edit Caption* option under the context menu that appears when you select the arrow on the right-hand side of the title. | ||
|
||
### Picking the Right Color Palette | ||
|
||
Oftentimes your company will dictate the color palette for you, but you can follow a few simple rules to get the right color palette down pat. | ||
|
||
Picking complementary colors with a color wheel can be a good place to start. | ||
|
||
Checking color contrast can also help make sure that your vizzes shine. Accessibility is vital to ensuring that your audience understands your visualizations. | ||
|
||
You can edit your color palette for the marks of your visualization by right-clicking on the legend and selecting *Edit Colors*. If just one item is out of sync with the rest of the color palette, then you can click *Select Data Item* and change it. If the whole color palette needs to be changed, then you select a new color palette in the *Select Color Palette* dropdown menu. | ||
|
||
### Keep It Simple | ||
|
||
The principle of keeping it simple means making sure that all the data on the viz is relevant and that we aren't including too much. The more data we have on one viz, the harder it becomes for the reader to comprehend without you there. This isn't to say that including multiple lines on a line chart is a bad idea. You can however use filters on your Tableau vizzes to help clarify what exactly you need and help users select specific groups. | ||
|
||
## Selecting Chart Styles in Tableau | ||
|
||
Finally, we want to think about what we are displaying before selecting a chart style. Here is a refresher on the four chart styles we introduced in [Data Visualization in Python]({{% relref "../../../data-visualization/reading/chart-styles/" %}}): | ||
|
||
1. Comparison | ||
1. Relationship | ||
1. Distribution | ||
1. Composition | ||
|
||
Tableau has many chart styles that fit each of these categories beyond the initial ones introduced to you earlier. When you are changing the chart style in the upper right hand corner of Tableau, some chart styles will be unavailable. Tableau marks some chart styles as unavailable due to what is in the columns and rows to help narrow down your chart style choices. | ||
|
||
{{% notice blue Example %}} | ||
|
||
A spatial chart can only be created with latitude and longitude data and latitude has to be in rows and longitude in columns. Until you have the data in this configuration, Tableau will not assemble a spatial chart for you. | ||
|
||
{{% /notice %}} | ||
|
||
{{% notice blue Note %}} | ||
|
||
Tableau has a great article on [choosing the right chart type for your data](https://help.tableau.com/current/pro/desktop/en-us/what_chart_example.htm). | ||
|
||
{{% /notice %}} | ||
|
||
## Check Your Understanding | ||
|
||
{{% notice green Question %}} | ||
|
||
Based on your explorations of Tableau, is there a chart style you have not previously encountered throughout this course? | ||
|
||
{{% /notice %}} | ||
|
||
<!-- sample answer could be a gantt chart --> |
Oops, something went wrong.