Table of Contents 1 Introduction 1.1 Why visualize data ? 1.2 Who is this book for ? 1.3 How is this book different ? 1.4 How to contact us 1.5 Acknowledgements 2 Installation & Setup 2.1 Installation of Tableau 2.2 Data sources required for the exercises in the book 3 Fundamentals of Data 3.4 Converting "Business questions" to the language of data 4 The Crux of Tableau 4.1 The 4 building pillars 4.1 Dimensions, Measures & Aggregations 4.2 Viz Pane - columns & rows shelf 4.2 Putting it all together 4.4 Sheets & Dashboards 5 Calculations 5.3 Row level, Aggregation & Dis-aggregation 5.4 Bringing in more data 5.1 From Excel/ CSV 5.5 Importance of cardinality - A practical example 5.6 Data Modeling 6 Tables & Table calculations 6.1 Show me or start from scratch ? 6.1 Table & Pane - Down & Across 6.2 Down then Across & Across then Down 6.3 Shortcut to reading Table calculations in English 6.4 Formulation of Table calculations 6.5 Comparisons - YoY, WoW, MoM 6.3 Sorting in Blended data 7 Advanced Tips 7.1 Dynamic Inputs - Parameters 7.5 Level of Detail (LOD) calculations 7.6 Reference Lines & Forecasts 7.1 Reference Lines using Parameters 7.2 Reference Lines using secondary data 7.3 Forecast & Trend lines 7.7 Order of operations 8 Dashboards 8.1 Less is more 8.2 Dashboards: A view from 10000ft 8.2 Discrete vs continuous filters 8.3 Filter domain 9 Useful links Tableau Public & Tableau Desktop Most of the examples illustrated here can be followed along with Tableau Public. Cases requiring Tableau Desktop are highlighted.1 Why visualize data ? Over the past few decades, Excel has become the de facto data analytics tool for most business users. When you need to sum two values, it couldn’t be simpler than clicking on the first value that you need to add, follow it up with a "+" sign and the next value to be added. Voilà, you’ve got yourself the total of two values.
Drag the formula down by clicking on the corners, you’ve got yourself a sum of 2 columns. Unfortunately this flexibility comes at a cost. The user gets gradually trapped in the world of quick fixes and patched formulae that Excel has to offer. Initially Lotus 123, the predecessor of Excel was conceived primarily as a data entry tool and indeed Excel "excels" at this task.
But now in this new era of big data, data visualization and data analytics deserve their own tool-kit. The human brain does a very poor job deciphering meaningful trends from a table of raw data (numbers) but at the same time excels at comparing, extrapolating and spotting trends in visual shapes and colors. It turns out the brain is able to take in a picture and process it in one stroke while on the other hand processes text in a linear fashion. Imagine, a bar chart which condenses 100 rows of data into a few columns against reading the rows one by one.
You start to get the picture. Having said that, it’s the responsibility of the analyst to effectively distill and convey the meaning hidden behind the numbers through effective and meaningful visualizations. If you take a close look at the following table of raw numbers, you’ll be able to make a few observations. There are four datasets Each dataset has an x and y column Numbers seem to range from 4 to 13 There are atmost 2 decimals Figure 1: Anscombe’s dataset And we start squeezing our eyelids together to squeeze out more information from this table.
The more astute among you, might have copy, pasted these numbers into a good ol’ excel sheet and grabbed your "I’m a data scientist" coffee mug. You start making a list Average of x: 9 Sample variance of x: 11 Average of y: 7.5 Sample variance of x: 4.125 Correlation between x and y: 0.816 A nice linear regression line: y = 3 + 0.5x R2 of the linear regression line: 0.67 That’s a lot of numbers and now the strange thing that you notice is that this above list is the same across all the 4 datasets. It’s fairly easy to make simplistic reductions about the distributions of x and y that they are similar based on the summary statistics. A quick visualization would instantly reveal the hidden gems in the distributions.
This example also helps underline the importance of exploratory data analytics before drawing any inferences and conclusions. Figure 2: Anscombe’s dataset in Tableau Having said that, I’m definitely not discouraging the use of Excel in any way. It’s a powerful tool in the repertoire of any competent professional. The main point I want to drive home is the fact that Excel often needs to be complemented by a data visualization tool to help effectively communicate and share your findings.
Microsoft PowerBI is just a good tool as Tableau but this book being about Tableau, I’ll contain myself to illustrations with Tableau.2 Who is this book for ? The primary intended audience of this book are Business analysts, Data Analysts and Financial Analysts or more broadly anyone who is hitting the limits of Excel with their data analytics needs. If your day to day revolves around staring at numbers all day long, then you’re definitely part of the target audience. There are no prerequisites to follow along the concepts in this book. We will work our way gradually from the very fundamentals of data all the way up to to building fancy dashboards & visualizations on gigabytes of data.3 How is this book different ? There are many books on the market which are excellent Tableau user guides and reference manuals.
They do an excellent job of presenting every menu tab, button, pane and shelf in Tableau. If you’re the kind of person who needs to know every single button and functionality tucked into Tableau then this might not be the right book for you. When you start to learn a new language and want to go about it in a systematic and methodical way, you would start with the grammar. Understanding the foundational underpinnings of the languages, helps you get the basics right and then it’s a matter of stringing words together to make sentences.
Lining up words within the rules defined by the grammar (or not) in infinite possible ways, to write Shakespearean poetry or tabloid articles or have conversations, is a logical next step. This book intends to approach the subject of mastering Tableau in a similar fashion. We’ll try to distill the very core essence of Tableau in a few concepts and then it’s just a matter of combining them in infinite possible ways to build the required data visualizations. Icons used in this book Tips & shortcuts worth keeping in mind Traps to watch out for in Tableau which could help you avoid potential headaches down the road.
Technical details which are not necessary to follow along the chapters in this book and can be comfortably skipped or glossed over.4 How to contact us Please address comments and questions concerning this book to: tableau- the-book@jupyterdata. Please feel free to reach out if you need any help on your data analytics projects at: shankar. You can also find me on LinkedIn.5 Acknowledgements As always, as with all dedications, I would like to thank my parents who enabled me to write this book in the first place and my wife who supports me in all my endeavors. I would also like to make a special dedication to my kids Nikie and Brooklyn who show me the joy of life everyday.1 Installation of Tableau We’ll gloss over very quickly the installation of Tableau public which you will require to follow along with this book.
Unfortunately for the corner cases, business users working on Macs and Linux, I’ll have to redirect your questions and concerns to the almighty Google. Head over to Tableau public’s site. Hand over your email, as usual, in return for the Tableau public installation file (. Figure 3: Tableau public download page Double click on the .exe and follow along the instructions to complete the installation of Tableau Public.
Figure 4: Tableau public download page It’s time to take the cover off and take tableau for a quick spin. As soon as you open up Tableau, click on Microsoft Excel under connect as shown in the figure below. Figure 5: Tableau - Connect to Excel In the next screen, drag and drop the Excel tab from which you’d like to import the data as shown in the figure below. Make sure that the data looks right in the preview pane before clicking on the Sheet 1 Figure 6: Tableau - Import Data from Tab 2.2 Data sources required for the exercises in the book The various tableau workbooks, Excel and CSV files required for you to follow along are available at this book’s Github source page.
You can also directly get the workbooks from the Tableau public server available under my profile.1 Data types Now that we’re done with the formalities of setting up Tableau, let’s step into the shallow end of the pool with some basic data types. Essentially, we can broadly categorize any piece of data into the following 3 types Absolutely nothing mind blowing here so far. To give you a few business examples (keeping inline with the book’s audience) String / textual data types could include product names, categories, country names etc. (Identified by "Abc" next to column names in Tableau) Numeric data types could include profit, sales, sale price etc.
(Identified by the icon "#") Date types could include invoice date, shipping date, return time etc. (Identified by the calendar icon) You have the flexibility to change the data types if Tableau didn’t interpret the data type correctly. Say for example, the column Row ID which is interpreted as a number needs to be changed into a String, click on the "123" number icon next to the column name and switch it to the String datatype. Figure 7: Variable types in Tableau You should also have noticed that the numeric columns are arranged at the bottom of the screen under the "Measures" pane and the textual, date time column types are arranged at the top under the "Dimensions" pane.
This is based on how tableau considers and treats these data types as either continuous or discrete quantities. In addition to the classification of data types based on their intrinsic value, we could classify them based on the presence of continuity or not in the values. For example, the product names are discrete values. In the superstore dataset, you’ll notice that there are 3 types of values in the category column (Furniture, office supplies and technology).
There is no sense of continuity between the three distinct values and hence we would call them discrete values. Dimensions Measures You can quickly filter the columns by type using the following shortcuts: D: Displays just the dimensions. M: Displays just the measures. C: Displays just the calculated fields that you have created in Tableau (covered in the section about calculations).
On the other-hand, take the example of the order date column which contains dates. When you want to understand the sales over the past 3 years of order dates, we consider the date column as a continuous range as the days are in successive order and we want to see the evolution across time. Figure 8: Discrete vs Continuous variables Discrete vs Continuous quantities Discrete columns are identified in blue pills and Continuous quantities are identified as green pills. This subtle difference often leads to "unexpected outcomes" in visualizations.
You can switch the type of the variable from discrete to continuous or vice versa and there are many ways of doing it. You could right click on the YEAR(Order Date) green pill as shown in the figure 8 and switch it to discrete. This will ensure that this value is treated as a discrete value in just this analysis.