DATA VISUALISATION 101 WITH TABLEAU
ORGANIZER: GENERAL ASSEMBLY
INSTRUCTOR: DANON GABRIEL THE
Connect to data
- Download data file titled sampletableaudata.csv at this link — http://bit.ly/1UbViHY
- Open Tableau
- On the left panel, under “Connect”, select Text File (for CSV; choose Excel for Tableau and other file types accordingly)
- Browse to where you saved the data file, select it, and click OK
Save Tableau file
- File > Save As
- Select location you want to save file
- Click drop down to see 2 options — Tableau Workbook (.twb) and Tableau Packaged Workbook (.twbx)
- Select Tableau Packaged Workbook (.twbx)
- Name your file
- Hit Save
Bonus tip — Extract data
- Extracting your data optimises and compresses the data so your file is smaller in size and more efficient
- On the top left, right click on the dataset “sampletableaudata"
- Click Extract data
- Hit Extract
- Save file
First visualization
- Let’s create a simple bar chart
- On the bottom, click the New Worksheet icon to create a new Worksheet and name it V1
- Click on Show Me on the top right to unhide the table (if it’s already showing, ignore this step)
- Select Postal Code in dimensions and Sales in measures (Command click for Mac, Ctrl click for PC)
- Click on the bar chart (3rd row, 1st column option for Show Me)
- Now, let’s sort it — mouse over the top of the chart and the sort icon will show up; click it
- Let’s hide the Show Me bar for now — click on Show Me
- Now let’s make the visualisation richer
- Let’s make the colour show Profits — drag and drop Profits into the Colors square in the Marks section
- Let’s put a label on each bar to show Sales — drag and drop Sales into the Label square in the Marks section
- Presto! Your first visualization!
Visualization V1
Second visualization
- Let’s create another with geodata
- On the bottom, click the New Worksheet icon to create a new Worksheet and name it V2
- Click on Show Me on the top right to unhide the table (if it’s already showing, ignore this step)
- Select Country and City in dimensions and Sales in measures — yes, 3 fields (Command click for Mac, Ctrl click for PC)
- Click on the map with bubbles (2nd row, 1st column)
- Let’s hide the Show Me bar for now — click on Show Me to hide
- Make the circles a little larger — click on the Size square in the Marks tab and increase it slightly
- Now, change the color to represent profit; drag and drop the Profit measure into the color square in the Marks tab
- Let’s make the color a bit transparent — click on the Color square in marks, and reduce opacity to 85%
Visualization V2
Third visualization
- Let’s create a line chart
- On the bottom, click the New Worksheet icon to create a new Worksheet and name it V3
- Click on Show Me on the top right to unhide the table (if it’s already showing, ignore this step)
- Select Order date in dimensions and Sales in measures (Command click for Mac, Ctrl click for PC)
- Click on the line chart (4th column, 1st row)
- Click on the arrow on the YEAR pill in Column on the top
- Select Month from the dropdown
- Let’s get more granularity — drag and drop Segment into the Color square in the Marks tab to break it out by Segment
- Tip for later — right click on a line and add a trendline
Visualization V3
Quick calculation
- Let’s create a pie chart
- On the bottom, click the New Worksheet icon to create a new Worksheet and name it V4
- Select Segment in dimensions and Sales in measures (Command click for Mac, Ctrl click for PC)
- Click on the pie chart (3rd column, 2nd row)
- Let’s make it larger — click on Dropdown that now says Normal and select Entire View
- Drag and drop Segment into Label square in the Marks tab
- Now, drag and drop Sales into the Label square in the Marks tab
- In the Marks tab, mouse over the Sales pill under Label (the pill should have Abc123 next to it)
- Select Quick Table Calculation
- Select Percent of total
- Now, drag and drop Sales into the Label square in the Marks tab again
- Done!
Visualization V4, Quick Calculation
Break time!
Calculated field
- Now, let’s use a calculated field
- On the bottom, click the New Worksheet icon to create a new Worksheet and name it V5
- Right click anywhere a blank space on the measures pane on the left
- Select Create Calculated Field
- Name the calculation — “Profit / Sales Ratio"
- Drag and drop Profit from Measures into the Calculation dialogue
- Hit / to indicate you want to divide Profit by another number
- Drag and drop Sales from Measures into the Calculation dialogue after the above-mentioned /
- It should say [Profit]/[Sales] and that “calculation is valid"
- Press OK
- Select the Region dimension and your new calculated field name Profit / Sales Ratio
- Click on bar chart
- Can you tell which are the most profitable (by profit margin) regions?
Visualization V5, Calculated Field
Filters
- Let’s go back to the first worksheet (V1) with your bars
- Right click on the Region measure, and select Show Filter
- Done! A simple filter is now available
- Right click on the arrow on the top right of the filter to explore options
- For now, let’s make it a radio button filter, click Single values list
- Let’s add a quantitative filter
- Drag and drop Sales into the Filters tab
- Select All values
- Let’s choose At Least — click on that option and press OK
- Now, right click on the Sales button in Filters and choose Show Filter
- It now shows up on the right next to your earlier filter
- Play with your filters and answer this — How many postal codes are making at least $4,000 in the Central region?
- Exporting visualizations
- If you want to export an image —Worksheet > Export > Image
- Select what components you want to export and click Save, select location and hit Save
- You can also choose to export the Crosstab data which is the summarized/aggregated data from your worksheet
Creating your first Dashboard by combining sheets
- For now, let’s remove the filters
- Drag and drop the filters in your earlier example back to the Dimensions column
- At the bottom, click New Dashboard
- Drag and drop V1, V2, V3 and V4 into the dashboard to make a 2X2 grid
- At the bottom left under Dashboard, change Desktop to Automatic
- On the top right hand side of the map (V2), click the drop down and choose Use as Filter
- Repeat this for the pie chart in V4
- Let’s interact with the dashboard!
- Try clicking on difference slices in the V4 pie chart
- Click a blank white space to deselect after
- Now try clicking on cities/circles on the map; you can even drag and select a region!
That's it!
You now have a working knowledge of Tableau after completing this class.
- Go forth and visualize!
- Connect with me on Linkedin
- View other classes that I'm teaching at General Assembly
Yours sincerely,
Danon Gabriel The