Sunday, November 17, 2024
Google search engine
HomeGuest BlogsA Complete Guide To Tableau For Beginners in Data Visualization

A Complete Guide To Tableau For Beginners in Data Visualization

This article was published as a part of theĀ Data Science Blogathon

Overview

Tableau is a well-known data visualization tool widely used in the industry and adopted by major firms likeĀ  Nike, Coca-Cola, Skype, TCS, Accenture, and various other plethoras of companies both large and small. Tableau provides support across platforms such as Azure, Microsoft, Amazon, Redshift, etc making it a household data visualization tool and well accepted in the analytics community. Tableau is easy to use and versatile and anyone without an analytics or BI background can create awesome visualizations with a bit of guidance and practice.

The key away from this article is to build basic charts on tableau but more importantly understand the nuances of the tool. Instead of jumping directly into building a dashboard, the idea is to get familiarized with the tool and its functionality.

Table Of Contents

  1. Why is visualization important?
  2. Basic understanding of tableau products.
  3. Step by Step guide to building a simple dashboard using the superstore dataset.
  4. Letā€™s Practice.
  5. Limitations of the tableau.
  6. Tableau certifications.
  7. Endnotes.

Why is visualization important?

Studies show that humans process complex visual data more efficiently than spreadsheets or text tables. For example, using a line graph to track sales trends is an easy and better way than a stack of numbers in a spreadsheet.Ā  Identifying outliers, showcasing correlations and tracking progress are some more examples where visual representation is used. For senior management as well as CXOā€™s having a dashboard is convenient, helps them keep track of the health of the business and visualize different scenarios and identify factors that benefit the business and address pain points so that operations run smoothly, without any roadblock. For associates or analysts, it provides unique business insights, which can be leveraged to build new product features and can be turned into opportunities for growth. Hence the know-how of visualization tools is an important skill to have.

Basic Understanding Of Tableau Products

Tableau Desktop ā€“ Data visualization tool, which helps to create interactive dashboards and stories. It has a 14 days trial version.

Tableau Server ā€“ Helps publish, share, administer tableau desktop content and dashboard.

Tableau Online ā€“ On cloud tableau analytics platform. Develop dashboards on tableau desktop and upload to tableau online. Link sharing helps colleagues, customers view the dashboard and make adjustments to the view. The dashboard can be accessed on the web as well as a mobile app. Also can be embedded into a website.

Tableau Reader ā€“ Itā€™s a reader tool to view the tableau desktop dashboard without downloaded tableau desktop. It doesnā€™t have the ability to transform or manipulate dashboards.

Tableau Public ā€“ Free platform to transform data into beautiful visualization and share the same online on tableau. Tableau Public has a gallery, where every day a new and interesting visualisation is updated, these can be downloaded along with the data to either recreate the same or explore.

Tableau Desktop vs Tableau Public

For individual users, the cost of a tableau desktop license as of Sep/2021 is $70/user/month billed annually and for freelancers, this could be a valuable tool for initial EDA/ Model validation ā€“ visually showcase independent vs dependant variables or clusters / provide interactive dashboards. The license can be purchased using this link.

Tableau Public is free to use, anyone can download it and work on it, but hereā€™s the catch. All visualization can only be saved on Tableau Public(online website) and not locally. If data security isnā€™t an issue and learning is the main focus then tableau public very well is the winner.

Tableau Public Visualizations

Tableau hosts viz of the day on their website. A good place to check out real-world dashboards. A good practice is to download and try to recreate the same dashboard.

Building a simple dashboard on tableau using the superstore dataset

Download Tableau Public:

Use the link to download tableau public. Once the email id is entered, the download will automatically begin.

Tableau Public
Image 1

Download the superstore dataset :

The most commonly used dataset for tableau exercises and tutorials is the superstore dataset. It can be downloaded from here.

Superstore dataset and retail

The superstore dataset is retail transaction data or pos(point of sales) data. Retail data has numerous insights and can be used for exercises such as market basket analysis, or customer lifetime value, or churn analysis. The possibilities are infinite. The current dataset has 3 sheets/tables namely Orders, People, Returns. Orders is the main sheet that will be working with.Ā Orders ā€“ contains information about the product bought. Below are the columns :

  1. Row ID ā€“ unique identifier for each transaction.
  2. Order ID ā€“ Order id of each transaction.
  3. Order Date ā€“ Order date.
  4. Ship Date ā€“ Shipping date.
  5. Ship Mode ā€“ Shiping mode (Second Class, Standard Class, First Class, Same Day)
  6. Customer ID ā€“ Unique ID for each customer.
  7. Customer Name ā€“ Customer name.
  8. Segment ā€“ Product segment.
  9. Country/Region ā€“ Shipping country.
  10. City ā€“ Shipping city.
  11. State ā€“ Shipping State.
  12. Postal Code ā€“ Shipping postal code.
  13. Region ā€“ Shipping region.
  14. Product ID ā€“ unique identifier for the product.
  15. Category ā€“ Product category.
  16. Sub-Category ā€“ Product sub-category.
  17. Product Name ā€“ Product name.
  18. Sales ā€“ Net sales amount.
  19. Quantity ā€“ Quantity purchased.
  20. Discount ā€“ Discount applied.
  21. Profit ā€“ Margin or profit.

Connect to Dataset in Tableau

In the free version of tableau, that is tableau public, a total of 11 data connections are available, the most common amount them is Microsoft Excel. The other connections are:

  1. Text file
  2. JSON file
  3. Microsoft access
  4. PDF file
  5. Spacial file
  6. Statistical file
  7. Google drive
  8. Google sheets
  9. OData
Steps to load data:
  1. Select Microsoft Excel and then select the superstore dataset from downloads and select OK.
  2. Drag the orders sheet to the canvas. In the data source pane, all columns and values will be visible.
  3. Click on ā€œSheet1ā€ below to move to the workspace area to create a visualization.
  4. Double click on ā€œSheet1ā€ and it can be renamed to ā€œbar_graphā€ or any relevant name.
connect to dataset | Tableau
screenshot of the tool
sample store dataset
screenshot

Workspace, Plotting and Dashboarding in Tableau

Understanding the tableau workstation and naming conventions will help in not only understanding this guide but also the free tableau video available online.

Tableau Workspace
https://www.guru99.com/introduction-tableau-workspace-navigation.html

Data Pane: The data shows all the columns in the data source. The data pane has dimensions which are qualitative and descriptive data for example ā€“ Customer name, Segment etc. Measures are quantitative values that can be aggregated using sum/averages etc. Dimensions and measures can be dropped onto the Filter Pane to filter data based on selection.

Fields can be hidden as well, right-click on the field and select HIDE. Fields can be saved to a folder as well ā€“ Select the downward-facing triangle beside the search bar on the data pane and select Folder.

Drag and drop fields from the data pane to shelves and cards to create a visualization. Shelves include ā€“ marks, filters and pages. Cards include ā€“ Columns and rows.

The largest area of the workspace is the view(worksheet), the area where the visualization is visible.

When a field is dropped onto the Columns or Rows it is called a Pill (itā€™s in the shape of a pill). A blue or green pill.Ā  A blue pill is a dimension and the green pill is a measure.

Marks card contains Color, Size, Label, Detail, Tooltip. For all the visualization these tools help to customize the charts. To increase or decrease the bar size, Size can be used. Select edit colors of any chart, select Color and Edit colors. Labels and Tooltip help in creating more informative visualizations by adding text fields or metrics to the visualization.

Letā€™s create a simple visualization:

Simple Visualization:Ā How to visualize the sum of Discounts across categories.

  1. First Drag the Category into Columns and then pull up Discounts into Rows.
  2. A simple bar chart is generated as below.
  3. Tableau is a simple drag and drop tool and within 2 clicks a beautiful bar chart is generated.
  4. The Discount is converted to SUM(Discount) as it is a measure and tableau knows to aggregate a measure without specifically asking it to.
Bar chart
screenshot

Rename the visualization and add legends to each bar in Tableau

  1. To rename simply double click on the title, or sheet1 and a new dialog box appears. Font, Font size, Font color, alignment can be changed.
  2. To apply colours based on category, Shift+drag category from the columns pill to the color in Marks shelf, and voila a beautiful new visualisation appears in just 2 clicks. Tableau makes it so easy to add legends to any graph.
  3. To annotate each bar, Shift+drag SUM(Discount) to the Label in Marks shelf.
Rename visualization | Tableau
screenshot

Creating visualization using the SHOW ME button on the toolbar: Tableau makes it really simple to create visualizations using already existing dimensions and measures through the SHOW ME tool. It has 24 types of charts and under each chart, it shows the numbers of measures and dimensions needed to create that specific chart.

  1. Text Tables ā€“Ā  1 or more dimension and measure
  2. Heat maps ā€“ 1 or more dimension and 1 or 2 measure
  3. Highlight tables ā€“ 1 or more dimension and 1 measure
  4. Symbol maps ā€“ 1 geo and 0 or more dimension and 0 to 2 measure
  5. Maps ā€“Ā 1 geo and 0 or more dimension and 0 or 1 measure
  6. Pie Chart ā€“ 1 or more dimension and 1 or 2 measure
  7. Horizontal bars ā€“ 0 or more dimension and 1 or more measure
  8. Stacked bars ā€“ 1 or more dimension and measure
  9. Side by side bars ā€“ 1 or more dimension and measure
  10. Ā Treemaps ā€“Ā 1 or more dimension and 1 or 2 measure
  11. Circle view ā€“Ā 1 or more dimension and measure
  12. Side by Side circles ā€“Ā 1 or more dimension and measure
  13. Line chart (Continuous) ā€“ 1 date and 0 or more dimension and 1 or more measure
  14. Line chart (Discrete) ā€“ 1 date and 0 or more dimension and 1 or more measure
  15. Dual lines ā€“Ā 1 date and 0 or more dimension and 2 measure
  16. Area charts(Continuous) ā€“Ā 1 date and 0 or more dimension and 1 or more measure
  17. Area charts(Discrete) ā€“ 1 date and 0 or more dimension and 1 or more measure
  18. Dual combination ā€“Ā 1 date and 0 or more dimension and 2 measure
  19. Scatter plot ā€“ 0 or more dimensions and 2 to 4 measures.
  20. Histogram ā€“ 1 measure
  21. Box and whisker plots ā€“ 0 or more dimension and 1 or more measure
  22. Gnatt ā€“ 1 date and 1 or more dimension and 1 to 2 measure
  23. Bullet graph ā€“ 0 or more dimension and 2 measure
  24. Packed bubbles ā€“ 1 or more dimensions and 1 to 2 measure

Create a Histogram of Discount using SHOW ME tool in Tableau

  1. Click on SHOW ME in the toolbar, a histogram needs just one measure.
  2. Click Discount from the data pane. A text table, horizontal bar and histogram will be highlighted in the SHOW ME tool.
  3. Select histogram to create a visualization.
Histogram Tableau
screenshot ā€“ Select the Green Histogram to create a visualization

Edit histogram bins sizeĀ 

  1. Bin sizes are selected automatically by tableau. A new dimension is created Discount(Bin) in the data pane when histograms are created.
  2. Right-click on the Discount(Bin) green pill and then select edit.
  3. In the dialog box, change the size of the bin to 0.1 or any numbers relevant.
histogram bin size
screenshot

Steps to add filters to visualization in Tableau

  1. Select the dimension/measure that needs to be a filter and drop it on the Filter pane. For example ā€“ Region and shipping mode.
  2. Right-click on the Region Filter pill and select show filter.
  3. Repeat the same for Shipping Mode.
  4. Dimension Filters appear as discrete values, whereas continuous filters appear as a range of values.
add filters
screenshot

Creating a Hierarchy in Tableau

Select the sub-category dimension and drop it above the category dimension to create a hierarchy. Location hierarchy can be created in the same way, select state, city, region and postal code and drop it onto the country. Hierarchies can be used to drill down into lower levels of data.

  1. SelectĀ state, city, region and postal code and drop it onto country and rename the hierarchy to country001.
  2. Drag the country and then drop it on rows card.
  3. Drag Profit and drop it on Text in Marks pane.
  4. A small positive(+) is visible on the Region Pill and negative(-) sign is visible on the blue
  5. The below table is also called a text table.
creating hierarchy in Tableau
screenshot

Ā 

scrrrenshots
screenshot

Table Calculations in Tableau

A common way to find an aggregate of columns/rows is table calculation. Select Analysis and then select Percentage of to get percentage values or select Total to get total across rows/columns.

  1. Right-click on SUM(Profit) in the marks pane and select Add Table Calculation.
  2. In the dialog box, relevant table calculations can be selected.
  3. For example,Ā  % of total needs be added then we can select Percentage of Total and in Compute Using Table (Down)
Table calculations | Tableau
screenshot

Ā 

Calculated Field to create profit percentage:

To create new variables from existing data, calculated fields can be used. A case whenĀ  statement can be used to segment based on profit values or percentages. Strings can be trimmed and converted to integers, integers can be aggregated, a calculated field can also be used as a filter.

  1. Select Analysis on the toolbar, then select create calculated field.
  2. We will use the formulaĀ [Profit]/[Sales] as profit ratio.
  3. Name the calculated field as profit_ratio and click Apply.
  4. Unlike available columns such as Discount, Profit, profit_ratio has a different symbol.

Ā 

calculated field
screenshot

Practice: Create a calculated field on profit_ratio based on the below code:

Use profit ratio calculated field to segment each transaction into one of the four buckets.

IF  [profit_ratio] < 0 then "poor" 
ELSEIF [profit_ratio] > 0 and [profit_ratio] < 0.3 then "average"
ELSEIF [profit_ratio] > 0.3 and [profit_ratio] < 0.6 then "good"
else "excellent"
END

Parameters in Tableau

Tableau parameters help users define values, which then can be processed by a calculated field(can also be used in set, reference line etc). Parameters are sometimes confused as filters, though parameters can act as filters, filters reduce the data points but parameters provide an alternative view and donā€™t reduce the data points. Defining parameters in itself has no action. They are useful only when combined with calculated fields.

Creating a parameter from a Filter: letā€™s create a view with Top N customer by sales, with Top N being the user-defined parameter control.

  1. Drag Customer ID to Filter shelf.
  2. Right-click on it, and a dialog box appears. Click on Top then select By Field, then select Create New Parameter.
  3. A new dialog box appears, rename it as Top N. Click OK.
  4. The Top N parameter will be visible on the parameter shelf.
  5. Right-click on it, and select Show Parameter.
  6. Using parameter control, the number of customers shown can be adjusted.
parameters
screenshot

Create a Dashboard in Tableau

  1. Select Dashboard and New Dashboard from the toolbar.
  2. Under the dashboard and sheets pane, the existing charts/sheets appear.
  3. Drag the drop the relevant sheet onto the dashboard.
  4. To add filters to the dashboard ā€“ Select Analysis from the toolbar, under it select Filter, all relevant filters appear. Go ahead and choose the one appropriate for the current dashboard.
create dashboard | Tableau
screenshot

Ā 

final dashboard
screenshot

Save the dashboard to tableau public: Tableau desktop provides a variety of options to save a dashboard, most commonly used are twb(tableau workbook file) and twbx(tableau packed workbook), the former is the XML version of the dashboard and is intended for collaboration and doesnā€™t enclose the data, the latter dashboard is inclusive of data and itā€™s intended for sharing.

In Tableau public, all dashboards including the data need to be saved in theĀ public domain.

  1. Select File, then Save to tableau Public.
  2. Login to tableau public profile using the username and password.
  3. Save the visualisation and share it with friends and colleagues.

Ā Letā€™s Practice

Unlike machine learning algorithms or theory, where memorizing works, tableau needs hands-on practice to be well versed in it. Itā€™s easy to forget everything thatā€™s been written above and one way to make sure nothing is forgotten is to practice what has just been learnt.

Please download the dashboard from this link, and try to develop the same, itā€™ll take a while but the learnings will be worth it. The dashboard should look somewhat like this ā€¦

practice Tableau
https://public.tableau.com/app/profile/chris5331/viz/from_20210801_002/Dashboard1

Ā Limitations of Tableau

As an analyst below are the few challenges faced while using tableau:

  1. Version control ā€“ Collaborating with teammates to build a comprehensive dashboard leads to a lot of confusion. Backtracking changes also isnā€™t possible.
  2. Lack of connectors in Tableau Public ā€“Ā  While desktop support almost all data warehouses and connectors, support for tableau public is limited.
  3. Need for processed data ā€“ Data wrangling in tableau is a time consuming and relatively tough task. So an external data wrangling pipeline is needed to smooth accessibility and usage.

Tableau Certifications:

Tableau certifications are a way to upload and validate tableau expertise. Itā€™s a mix of multiple-choice questions and labs exercises. Currently, there are 6 certifications available :

  1. Tableau desktop specialist.
  2. Tableau certified data analyst.
  3. Tableau desktop certified associate.
  4. Tableau server certified associate.
  5. Tableau certified associate consultant.
  6. Tableau certified associate architect.

The fundamental certificate for any data analyst/data scientist or business analyst is a Tableau desktop specialist. It covers the basics of dashboarding and exploratory data analysis using tableau desktop. Strong conceptual knowledge and a few practice sessions using various freely available datasets will be good enough to crack this exam.

Preparation For Tableau Desktop specialist:

To prepare for the tableau desktop specialist exams complete the CREATOR path of the free training videos. They cover various topics ranging from connecting to data, sheets, dashboards, calculations to published complete dashboards online. Using tableau public for practice if a desktop licence isnā€™t available is a valid option as well because tableau public cover almost all the necessary functionalities needed to successfully complete the examination.

Exam Format:

  • Time Limit: 60 minutes
  • Question Format: Multiple choice, multiple responses
  • Number of Questions: 45 (40 scored, 5 unscored)
  • Passing Score: The passing scaled score for this exam is 750.
  • Language(s) Offered: English only.
  • Exam Delivery Method: Testing centre and online delivery are both available.

End Notes

This article is just the beginning of data visualization using tableau. Speed and agility in building dashboards come with practice and the know-how to building dashboards that AWE the audience comes with domain expertise and experience. So practice and always keep learning.

Good luck! Here is my Linkedin profile in case you want to connect with me. Hereā€™s a link to my Tableau Desktop Specialist Certification. Iā€™ll be happy to be connected with you. Check out my other articles on data science and analytics here.

Image 1 :Ā  https://public.tableau.com/en-us/s/download

The media shown in this article are not owned by Analytics Vidhya and are used at the Authorā€™s discretion.

Chrisx10 Dmello

09 Nov 2021

Data scientist! Extensively using data mining, data processing algorithms, visualization, statistics and predictive modelling to solve challenging business problems and generate insights.

RELATED ARTICLES

Most Popular

Recent Comments

ź°•ģ„œźµ¬ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
źøˆģ²œźµ¬ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ź“‘ėŖ…ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ź“‘ėŖ…ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė¶€ģ²œģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
źµ¬ģ›”ė™ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ź°•ģ„œźµ¬ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ģ˜¤ģ‚°ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ź“‘ėŖ…ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ģ•ˆģ–‘ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ė¶€ģ²œģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė™ķƒ„ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ģ„œģšøģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė¶„ė‹¹ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ė¶€ģ²œģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ķ™”ź³”ė™ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ź°•ģ„œźµ¬ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ź³ ģ–‘ģ¶œģž„ģ•ˆė§ˆ on How to store XML data into a MySQL database using Python?
ķ™”ģ„±ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?
ģ²œķ˜øė™ģ¶œģž„ė§ˆģ‚¬ģ§€ on How to store XML data into a MySQL database using Python?