The following tutorial will walk you through taking the SPSS (.sav) files currently being used and converting them into a format where analysis and visualization can be preformed within Tableau through the use of Tableau Prep.

You will need the following programs: PSPP, Tableau Prep, and Tableau Desktop. Instructions to download are included in the wiki page "Software Installation Guides." The tutorial is broken down by the program used.

Step-by-step guide

PSPP

The following will be done for each dataset (.sav file):

1. Convert .sav to .csv

  • This is done so the SPSS files can be read by Tableau Prep

  • Open the file in PSPP

    • File, Open
  • Open a New Syntax Window

    • File, New, Syntax
  • Paste the following syntax into the New Syntax Window:

New Syntax
 SAVE TRANSLATE
        /OUTFILE="[file location]\[file_name].csv"  
        /TYPE=CSV
        /FIELDNAMES
        /CELLS=LABELS.
  • Within /OUTFILE=:
    • Change [file_location] to the location you would like the file to be saved and the [file_name] to what you want the resulting file to be named
  • In the Syntax Window Run the Syntax
    • Run, All

Tableau Prep

Steps 1-3 will be done for each dataset (.csv file):

1. Connect to datasets

  • Using the blue bar on the left, click Connections then Text File (CSVs can be opened as text files)
    • Connections, Text File
  • Navigate to and open the file
    • If files are in the same folder you can select and open multiple files at once

2. Extract data into Tableau Prep

  • This step is not necessary, but can speed up Tableau Prep by taking the data from the .csv files and packaging it with Tableau Prep.

    • File, Export Packaged Flow

3. Cleaning the Datasets

  • Add a Step to the dataset by clicking the plus sign to the right of the dataset, then Add Step

    • Plus sign, Add Step
  • Click on the step you just created

  • Remove SPSSID

    This is done because of the large number of entries in the SPSSID field, which can greatly slow down the processing of Tableau Prep

    • Right click on the SPSSID field and click "Remove Field"
      • Right Click field, Remove Field
  • Rename ID and other fields

    This is done so once fields are joined one can easily tell what dataset the fields originally came from. It is recommended that you rename other fields with common names, such as "date."

    • Right click on the ID field and click "Rename Field"
      • Right Click field, Rename Field

4. Joining the Datasets

Step 4 will be done every time you wish to join a dataset to another, or when you want to join additional datasets to an existing join. You will join all datasets that you wish to analyze together. It is recommended you only join the data you will be reviewing.

An explanation of Joins can be found in the wiki page "Joins Explained."

  • Add a Join to the dataset by clicking the plus sign to the right of the clean step you just made, then click "Add Join"
    • Plus sign, Add Join
    • Alternatively, you can drag one step onto another and select "New Join"
  • Apply the desired Join Clauses and Join Type
    • Click the Join Clauses, in the top left corner of the data preview window to select the ID fields (or the field you are joining with) of each dataset. Shown in blue box in image below.
    • Change the Join Type to full outer by selecting each outer circle of the VennDiagram shown in Join Type.. Shown in orange box in image below

4. Outputting and Viewing Flow

  • At anypoint you can view your flow in Tableau Desktop by right clicking a step and selecting "preview in Tableau Desktop"

    • Right click step, Preview in Tableau Desktop
  • You can add an output by clicking the plus icon and selecting "Add Output" at anytime, which extracts the data contained at the step an output is added. -Click Plus Icon, Click Add Output