arrow-left

All pages
gitbookPowered by GitBook
1 of 18

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Download and Install Tableau

This is a guide to installing and running Tableau Desktop on your personal computer. Please note that all workstations in the Digital Studio (on the second floor of O'Neill Library) already have Tableau Desktop installed.

Tableau has versions for both Windows and Mac. Detailed system requirements for Tableau here: https://public.tableau.com/en-us/s/downloadarrow-up-right.

Tableau Desktop is a visualization software used to create data visualizations and interactive dashboards. If you are a student, instructor, or researcher, you can request a free, renewable, one-year license for Tableau Desktop through Tableau Academic Programarrow-up-right. For instructor and researcher, the individual license is valid for one year and can be renewed each year if you are teaching Tableau in the classroom or conducting non-commercial academic research; The student license expires after one year; you can request a new license each year as a full-time student.

If you are a member of the public, please consider using Tableau Publicarrow-up-right instead, which is the free version of Tableau Desktop.

Here are the steps for students: (Installation process for instructors and researchers is similar. Just follow the instructions on the screen.)

Step 1: Go to (.)

Tableau Student

Step 2: Click on Get Tableau for Free.

Step 3: A web form will pop up. Complete all of the requested information, using your official BC email address when you fill out the form.

Step 4: Next, click on Verify Student Status.

Step 5: You will receive an email with a product key and link to download the software.

Step 6: Click on Download Tableau Desktop from your email and copy the product key.

Step 7: Follow the installation instructions to install Tableau to your computer.

Step 8: Activate your Tableau with your license key.

For instructor and researcher, click on Request Individual License on the screen.

The pop up request form is similar to the student one described above, but additionally asks "I plan to use Tableau Desktop for..." Under that popup, you can select "Teaching only," "Noncommercial academic research only," or both. Select the option that fits your needs best. You do not need to be an instructor to get a Tableau copy.

​

Tableau Public

Following are the general steps to download Tableau Public:

  1. Go to Tableau Public Download Page: ​

  2. Enter your email address and click "Download the App".

  3. Once the installation file has been downloaded to your computer, run it and follow the prompts to install Tableau on your Mac or PC.

​

​

¶ Data Visualization

Introduction to Tableau

https://www.tableau.com/academic/studentsarrow-up-right
Here is the link for instructorsarrow-up-right
public.tableau.comarrow-up-right

Resources

​Tableau Communityarrow-up-right​

Join the Tableau Community Forums to find solutions for what you need to accomplish. Ask questions to receive help and feedback.

​Tableau Visual Galleryarrow-up-right​

Get inspired by the many interactive visualizations in the Visual Gallery. Download the workbooks to play with on Tableau Desktop

Tableau training: How-to Videosarrow-up-right​

​Lynda.comarrow-up-right --Lynda.com has a great variety of training videos about Tableau.

Note: can be accessed with a Boston Public Library Card. Anyone residing in the state of Massachusetts can . Once you have a Boston Public Library account, you can use your credentials to .

More reading about data visualization:

  • The Big Book of Dashboards

  • Visual Reporting and Analysis: Seeing is Knowing Whitepaper

  • Visual Analysis Best Practices: A Guidebook Whitepaper

Tableau DH

Starter Kit for Text Analysis

Search for “Digital Humanities” in Tableau Public

3 Easy Steps to Make Graphs

Data Storytelling: Using visualization to share the human impact of numbers Whitepaper
  • Beautiful Evidence – Edward Tufte

  • Information Dashboard Design – Stephen Few

  • Information Visualization – Colin Ware

  • Lynda.comarrow-up-right
    apply for a free e-library cardarrow-up-right
    log inarrow-up-right
    Add Image of Google Maps and OpenStreetMap as Background Images in Tableau https://help.tableau.com/current/pro/desktop/en-gb/bkimages_maps.htm arrow-up-right

    U.S. Census Bureau Vizzes

    https://public.tableau.com/profile/us.census.bureau?eml=gd&utm_medium=email &utm_source=govdelivery#!/arrow-up-right

    https://www.kenflerlage.com/2019/09/text-analysis.html arrow-up-right
    https://public.tableau.com/en-us/search/all/digital%20humanities arrow-up-right
    https://digitalhumanities.berkeley.edu/blog/17/06/26/3-easy-steps-make-graphstableau arrow-up-right

    Beyond Simple Chart in Tableau

    In this tutorial, we will look at a few advanced graphs that go beyond the show me feature in Tableau.

    Tableau is a great tool for data analysis and visualization. It has some powerful tools to make the visualizations appealing and interactive. The Show Me feature can be used to apply a required view to the existing data in the worksheet. Those views can be a pie chart, a line graph, a scatter plot, or a simple map. Whenever a worksheet with data is created, it is available in the top right corner as shown in the following figure. Some of the view options will be greyed out depending on the nature of selection in the data pane.

    Source: https://www.flerlagetwins.com/2017/11/beyond-show-me-part-1-its-all-about-x-y_46.html

    One such awesome feature is animated data visualization.

    Get Started

    hashtag
    Google Colab Installation

    hashtag
    Step 1: Go to your Google Workspace Marketplace and search for "colab"

    hashtag
    Step 2: Locate "Colaboratory" and click add to drive

    hashtag
    Step 3: Access Colab as using a regular Google doc

    hashtag
    Basic Layout in Google Colab

    Using Tableau to Visualize COVID-19 Data

    The Tableau COVID-19 Data Hubarrow-up-right contains resources to help people visualize and analyze the most recent data on the coronavirus outbreak.

    In this tutorial, we will learn:

    1. How to connect data to Tableau

    2. How to create worksheets

    3. How to create an interactive dashboard

    4. How to save and publish your visualization

    hashtag
    Download the Data

    In this tutorial, we will work the COVID-19 data from the European Centre for Disease Prevention and Control website.

    Data preview in Excel:

    The data fields are described below:

    hashtag
    Connect to Data Source

    Startup Tableau desktop, you will get the start page showing various data sources. Under the “Connect” on the left side of the screen, you have options to connect to a file or server data source. Under to a File, choose Text file. Then navigate to the CSV file you just download from the last step:

    hashtag
    Creating Views and Analysis

    At the bottom of the Tableau desktop, click on a sheet (sheet 1) and you will see the following screen:

    Tableau automatically separates the data into Dimensions and Measures. Dimensions are the categorical fields. Measures are the quantitative fields, such as death count, positive cases count

    We will create a bar chart tracking number of new positive cases per day. Drag “People Positive New Cases” from Measures and drop it into the “Rows” section. Drag" Report Date" from Dimensions to "Columns". Select “Days” from the shortcut menu.

    Note that it defaults to YEAR(Date). To format how the date is displayed, right-click on YEAR(Date) and select Day, specifically the option that has the example "8th May, 2015".

    We can also add some filters to the bar chart so that a user could filter to see a certain country or date range. From Dimensions, drag Country Short Name to the Filters shelf. Click on All and then OK.

    Next, right-click on the Country Short Name on the Filters shelf and select Show Filter. Now you will see a list of countries on the right.

    Double click on Sheet 1, rename the worksheet title to "New Positive Cases"

    Next, we will create a map. First, open a new workbook, double click "Country Short Name", Tableau has placed the longitude and latitude coordinates in the columns and rows, respectively, a point map will show on the design canvas.

    Drag and drop "People Positive Cases Count" to Size under Marks.

    Double click on Sheet 2, rename the worksheet title to "New Positive Cases by Country"

    Now we will create the third worksheet, open a new worksheet.

    We’ll create a vertical bar chart tracking confirmed case per country.

    Drag “People Positive Cases Count” from measures and drop it into the “Columns” section. Drag Country Short Name from Dimensions to "Measures".

    Go to the bottom of the chart and click on the sorting icon. Sort the number of positive cases in descending order.

    Go to Marks, you customize the chart color by using the color pilates.

    Name the worksheet “Positive Cases by Country.”

    ​

    hashtag
    Create an interactive dashboard

    Let’s create a dashboard to pull all of these visualizations together. The dashboard will combine our three visuals we have made in the previous steps. Click on the new dashboard icon at the bottom of the page to create a new dashboard.

    Our three worksheets are on the left. Drag “worksheet 1" into the drop area on the right.

    Combine 3 worksheets:

    Data Wangling

    hashtag
    Simple calculation using Pandas

    import pandas as pd
    #Simple Calculation
    #Count
    count_1 = df['var1'].count()   #Count of one column (example: cases)
    count_2 = df[['var1','var2']].count()   #Count of more than one columns (example: cases, deaths)
    count_all = df.count()    #Count all varialbes in the table
    
    #mean
    mean_value =  df['var1'].mean()
    # mean = round(df['var1'].mean(),2)         #If decimal places are needed
    #standand deviation
    std_value =  df['var1'].std()
    
    
    print('Descriptive statistics of cases')
    print('Count:',count_1)
    print('Mean',mean_value )
    print('Stand Deviation',std_value)

    hashtag
    Descriptive statistics

    hashtag
    Extract a subset by columns and rows

    hashtag
    Data aggregation

    Beyond Simple chart Examples

    hashtag
    Example 1: Tableau Chart Catalog

    This catalog arrow-up-rightprovides a list of different chart types with links to actual visualizations built in Tableau and published on Tableau Public. This was developed as a resource for the Tableau community for inspiration and to assist in the understanding of how these chart types might be used in actual use cases. All visualizations on this page are being provided with the permission of the original author and are available for download from Tableau Public. Click on the image to open the actual visualization in a separate browser window. (Note: inclusion does not mean the chart is the best choice for the data represented. Also note that the originator of each chart may not necessarily be represented; these are simply examples).

    Tableau Chart Catalogarrow-up-right

    hashtag
    Example 2: Napoleon’s Invasion of Russia 1812-181

    The best statistical graphic ever drawn“, is how statistician Edward Tufte described this chart in his authoritative work ‘The Visual Display of Quantitative Information’. The chart above also tells the story of a war: Napoleon’s Russian campaign of 1812. It was drawn half a century afterwards by Charles Joseph Minard, a French civil engineer who worked on dams, canals and bridges. He was 80 years old and long retired when, in 1861, he called on the innovative techniques he had invented for the purpose of displaying flows of people, in order to tell the tragic tale in a single image. This visualization shows 6 type of data (Number of Solider remaining, Army's direction, Geographic information, Distance, Dates, and Temperature) in 2 dimensions.

    Here is the interactive version of this visualization on Tableau public:

    hashtag
    Example 3: Diagram of the causes of mortality in the army

    hashtag
    Example 4: A Pie Chart Redesign in Tableau

    Explore this visualization:

    hashtag
    Example 5: Information Wanted

    Here is an example that I created in Tableau:

    More about his project:

    hashtag
    Example 6: Bubble Art with Tableau

    Source:

    Google Colab

    In this tutorial, you will learn how to install Google Colab in your Google Drive, and use Colab to perform a number of data tasks including:

    • Google Colab Installationarrow-up-right

    • Data Importarrow-up-right

    Data Import

    hashtag
    Import CSV & Excel files from local directory

    Import csv files from local directory pandas tutorial: pandas.read_csvarrow-up-right

    Import Excel files pandas tutorial: pandas.read_excelarrow-up-right

    hashtag
    Import data from URL

    hashtag
    Google Drive Import

    Read data by Google Sheets Name

    hashtag
    Read data by Google Sheets ID

    hashtag
    Read CSV file from Google Drive - by sharing link

    hashtag
    Read CSV file from Google Drive - by mounting Google Drive

    Results Export

    hashtag
    Export data to csv file to local directory

    from google.colab import files
    df.to_csv('FILENAME.csv') 
    files.download('FILENAME.csv')  #Download winder pops out

    hashtag
    Export data to CSV file to Google Drive

    from google.colab import drive
    drive.mount('/content/drive')  #Copy and paste Google Authentication code
    df.to_csv('/content/drive/PATH TO Google Drive FOLDER')

    hashtag
    Export plot image to local directory

    import pandas as pd
    #Descriptive Statistics of one varialbe
    descriptive_stats_1 = df['var1'].describe()
    #Descriptive Statistics of more than one varialbes
    descriptive_stats_2 = df[['var1','deaths']].describe()
    #Descriptive Statistics of all numbercal varialbes in a dataframe
    descriptive_stats_all = df.describe()
    #Uplocad csv file from your local directory
    from google.colab import files
    uploaded = files.upload()
    
    import pandas as pd
    df = pd.read_csv('FILENAME.csv')  #The filename of the uplpaded csv file
    #df.shape
    df.head()
    #Uplocad Excel file from your local directory
    from google.colab import files
    uploaded = files.upload()
    
    import pandas as pd
    df = pd.read_excel('FILENAME.xlsx')  #The filename of the uplpaded csv file
    #df.shape
    df.head()
    Data Wringingarrow-up-right
    Visualizationarrow-up-right
    Results Exportarrow-up-right

    Out of Box Data Visualization Tools

    subset_1 = df[['var1','var2','var3']]   #Subset by column name(s)
    subset_2 = df[df["var1"] > 100]  #Select rows by value (example: value =100)
    #Collapse
    #Collapse data by one varialbe, one aggregation method
    df_1 = df.groupby(['var1'], dropna=True).sum().reset_index()
    
    #Collapse data by one varialbe, by more than one aggregation methods
    df_2 = df.groupby(['var1']).agg({'var2':['sum'], 'var3':['mean']}).reset_index() #var2, var3 need to be numeric data
    #Export bar chart
    bar_image = bar_2.get_figure().savefig('bar_image.png')
    from google.colab import files
    files.download('bar_image.png')  #Download window pops out
    
    #Export line chart
    line_image = line_1.get_figure().savefig('line_image.png')
    from google.colab import files
    files.download('line_image.png')  #Download window pops out
    
    #Export scatter plot chart
    scat_image = scatter.get_figure().savefig('scatter_image.png')
    from google.colab import files
    files.download('scatter_image.png')  #Download window pops out
    #Example: NYT Github COVID-19 data
    #https://raw.githubusercontent.com/nytimes/covid-19-data/master/live/us-counties.csv
    url = 'The URL of data'
    df = pd.read_csv(url)
    #df.shape
    df.head()
    #gspread setup
    !pip install --upgrade gspread
    
    #Authenticate access to your Google Drive
    from google.colab import auth
    auth.authenticate_user()
    
    import gspread
    from oauth2client.client import GoogleCredentials
    gc = gspread.authorize(GoogleCredentials.get_application_default())
    
    
    import pandas as pd
    worksheet = gc.open('Google Sheets NAME').sheet1   
    rows = worksheet.get_all_values()    # get_all_values gives a list of rows.
    df = pd.DataFrame.from_records(rows)  # Convert to a DataFrame and render.
    df.head()
    #gspread setup
    !pip install --upgrade gspread
    
    #Authenticate access to your Google Drive
    from google.colab import auth
    auth.authenticate_user()
    
    import gspread
    from oauth2client.client import GoogleCredentials
    gc = gspread.authorize(GoogleCredentials.get_application_default())
    
    
    worksheet = gc.open_by_key('Google Sheets ID').worksheet('NAME OF A SHEET TAB')    #Call by Sheet ID & Name
    rows = worksheet.get_all_values()    # get_all_values gives a list of rows.
    df = pd.DataFrame.from_records(rows[1:], columns=rows[0])   # Convert to a DataFrame and render. 1st Row as Headers
    df.head()
    !pip install -U -q PyDrive 
    
    from pydrive.auth import GoogleAuth 
    from pydrive.drive import GoogleDrive 
    from google.colab import auth 
    from oauth2client.client import GoogleCredentials 
    
    
    # Authenticate and create the PyDrive client. 
    auth.authenticate_user() 
    gauth = GoogleAuth() 
    gauth.credentials = GoogleCredentials.get_application_default() 
    drive = GoogleDrive(gauth)   #Copy and paste Google Authentication code
    
    link = 'SHARING LINK'  #The sharing link of the data file stored on your Google Drive
    id = link.split("/")[-2]
    #print(id)
    downloaded = drive.CreateFile({'id':id})  
    downloaded.GetContentFile('covid_county.csv')   
    df = pd.read_csv('covid_county.csv') 
    df.head()
    #Mount Google Drive
    from google.colab import drive
    drive.mount('/content/drive')  
    
    path = '/content/drive/PATH TO THE FILE'
    df = pd.read_csv(path)
    df.head()
    https://public.tableau.com/en-us/gallery/recreating-charles-minards-napoleons-marcharrow-up-right
    link arrow-up-right
    arrow-up-right
    https://www.flerlagetwins.com/2017/12/geometric-art-in-tableau_17.htmlarrow-up-right
    Tableau Chart Type
    https://upload.wikimedia.org/wikipedia/commons/2/29/Minard.png
    Credit: https://wellcomecollection.org/works/
    https://public.tableau.com/en-us/gallery/recreating-florence-nightingales-coxcomb-chart
    From Duke Energy
    Starry Night, Ken Flerlage

    Visualization

    Exemplar data: COVID-19 case and death data (date: 202012006)

    hashtag
    Bar Chart

    Tutorial: pandas.DataFrame.plot.bararrow-up-right

    #Bar Chart
    #bar_1 = df_state_1.plot.bar()
    bar_2 = df_state_1.plot.bar(x='state', y='cases', rot=90, figsize=(20,3))
    Example: COVID-19 Num. of Cases 2020-12-06 (United States on State Level)

    hashtag
    Line Chart

    Tutorial:

    hashtag
    Scatter Plot Chart

    Tutorial:

    Google Data Studio Interface

    hashtag
    Toolbar

    At the top of the page you can see a toolbar where you can find different options for creating a report.

    Pages, names

    First of all, your report needs a title. You can simply name it at the top left corner and the changes will be automatically saved. Then you can add multiple pages to the report which you can also name and easily switch between them.

    Types of data visualization

    The next part of the toolbar is the data visualization tools. You can select the graph type you want to build.

    For example, a bar chart requires you to select one dimension and at least one metric. If you add multiple metrics, you will see multiple bars for each category.

    Inserting text and images

    You can insert text, images, rectangles, and circles to the report depending on your purpose.

    hashtag
    Selecting layout and theme

    Layout and theme give you the possibility to play with the style of your report. You can change the background, colors, text styles, and display options and create a unique style that can represent the style of your company.

    hashtag
    Styling and controlling menu

    Styling and controlling menu is a great help in the process of creating a report. You can select the chart type, experiment with metrics and dimensions, change data sources, apply a filter, etc.Now let’s switch between view and edit mode to see how our sample report looks like:

    Sharing the visualization

    You can do a few things with the share feature. You can collaborate on the visualization with your team or clients. Depending on their level of access, they can view or edit the reports through an invitation or a shared link.

    The visualizations also can be shared by embedding them into online and offline content, from websites and blog posts to annual reports.

    How to use Google Data Studio with Google Sheets

    Step 1: Navigate to https://datastudio.google.com/overviewarrow-up-right

    Google Data Studio

    Step 2: Click on "use it for free button

    Step 3: Sign in with your Google account and password. You should now see the home page of the Data Studio

    Step 4: click on 'Create' button on the top left:

    Step 5: Click on 'data source'

    Step 6: Find and Click on Google sheet connector

    Step 7: Find and Click on the Google sheet

    Step 8: Once you select the worksheet, there are still some decisions to make. You have three options:

    1. Use the first row as headers. Selected by default. Does what it says on the tin.

    2. Include hidden and filtered cells. Selected by default. If you want to keep data out of Data Studio by hiding its columns in Google Sheets, deselect this.

    3. An optional range of cells containing your data. Data Studio looks at the entire worksheet by default. If your table lies in a certain range, specify that here.

    Step 9: Click “Connect” to give Data Studio access to the Sheet:

    Step 10: You should now see a screen like the one below. Next we need to help Data Studio understand what kind of data you’ve given it.

    All the green fields represent dimensions (fields that can be counted) and all the blue fields represent metrics, usually categorical data. See the documentation for .

    Step 11: Google Data Studio doesn't always determine the correct data type for each field. so you need to make sure that each field is of the correct data type.

    Step 12: Create calculated fields (optional)

    Data Studio allows you to add custom fields to a data sources. So instead of adding all sorts of columns and formulas to your sheet, you can add them to your data source. That’s great because you can add calculated fields on the fly, without modifying your source data. Your new fields will be accessible in any reports that use this data source.

    Step 13: Once everything looks right then click on the "create report" button, this will create an empty report with your Google Sheets data source connected to it:

    Step 14: Charts in this report will use your new data source by default. Now you’ve got a data source and report to work with. The rest is up to you!

    Creating Visualizations in Google Data Studio

    Create New report on Airbnb Boston reviews

    To create a new report from scratch, a portion of the Kagglearrow-up-right dataset of the Airbnb reviews in Bostonarrow-up-right has been uploaded into a shared Google Sheetsarrow-up-right to be used as data source for Google Data Studio.

    • the full Kaggle dataset of the Airbnb reviews in Boston is available at https://www.kaggle.com/airbnb/bostonarrow-up-right

    • the Google Sheets, with approximately 10k reviews, to be used as data source is available at

    • Spend some time to understand the data by reading their description on Kaggle and looking at the table on Google Sheets.

    • The data-source table has been created by joining the “Listings” and “Reviews” original tables provided by Kaggle, and exporting the first 10k joined rows sorted by ascending “listing_id”.

    Create a new report

    • Go to the Data Studio home page

    • Click on “Start a new report” (Blank)

    • Rename the “Untitled Report” with a name of your choice by clicking on the name itself

    • Create a new data source by clicking on the blue button on the bottom right, or select the Airbnb data source if it is already present in the right-pane list

    Connect to the Google Sheet data source by using its URL:

    • Choose the “Google Sheets” connector in the list of connectors on the left

    • Choose the “URL” option in the first column

    • Paste the Airbnb-data Google Sheet URL in the specific field:

    Dimensions, metrics, and transformations

    • Check the type and aggregation of each field and that all the fields are correctly interpreted as either dimension or metric.

    • Create new useful fields (dimensions or metrics) from the existing ones by exploiting formulas, such as in the following (click on the “+” and “fx” placeholders). For details on this step, see:

    After creating new fields and updating the existing ones, click on “Add to report”

    Analyze the data

    Analyze the data by building the following visualizations. Then, explore and create new visualizations to find interesting insights on your own.

    • Analysis (1): Number of Records over time

    Analysis (2):

    • analyzing the number of different reviewers for each (lat, long) locationnote that the Kaggle dataset of the Airbnb reviews is in Boston, Massachusetts, US

    Allow end-users to filter the data under analysis by selecting a date range and city name.

    Choose the “Reviews Query DW” worksheet in the next column

  • Tick the option to “use the first row as headers” if it is not ticked yet

  • Click on the “Connect” button to execute the connection to the data source

  • CONCAT(latitude, CONCAT(', ', longitude)) → to generate a (lat, long) field useful for map charts; before generating this new field, set “Aggregation=None” for latitude and longitude fields, so that they become dimensions (by default, Data Studio considers them as metrics)

    https://docs.google.com/spreadsheets/d/1a2c9vCMFFfDXmhjoEoX2EwS2lYTbqE4WfZY72TXW9co/arrow-up-right
    edit#gid=285360760arrow-up-right
    https://docs.google.com/spreadsheets/d/1a2c9vCMFFfDXmhjoEoX2EwS2lYTbqE4WfZY72TXW9co/arrow-up-right
    edit#gid=285360760arrow-up-right
    https://support.google.com/datastudio/answer/6299685?hl=enarrow-up-right
    pandas.DataFrame.plot.linearrow-up-right
    pandas.DataFrame.plot.scatterarrow-up-right
    Example: COVI19 Num. of Cases 2020-12-06 (United States on State Level)
    Example: COVID-19 Num. of Cases & Deaths 2020-12-06 (United States State Level)
    dimensions and metricsarrow-up-right
    Visualization Tools
    #Syntax: DataFrame.plot.line(x=None, y=None, **kwds)
    line_1 = df_state_1.plot.line(y='deaths',x='state', rot=90, figsize=(10,3))
    line_2 = df_state_1.plot.line(subplots=True,x='state', rot=90,figsize=(10,5))
    #Syntax: DataFrame.plot.scatter(x, y, s=None, c=None, **kwargs)
    scatter = df_state_1.plot.scatter(x='cases', y='deaths')