Pasting from a clipboard

Sometimes it is easier to just paste data from the clipboard than pasting it to Excel or CSV files and then importing them again in Tableau. Tableau does provide a quick import method from the clipboard.

Getting ready

Let's use the Titanic dataset that we used in the Connecting to the text files recipe. The file is at http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic.txt.

How to do it...

Once you have determined that the Titanic dataset file is on your local drive, perform the following steps to copy the data to Tableau using a clipboard:

  1. Open the file in Notepad.
  2. Select all the data and copy everything from the file to the clipboard (Ctrl + A and then Ctrl + C on Windows), and perform the following steps:
    1. In Tableau, navigate to File | New to open a new blank workbook.
      How to do it...
    2. Click on any open area on the workbook and paste the copied data by going to Data | Paste Data (Ctrl + V on Windows). Note the top-left area of the workbook, where the data connections are shown. It should show text such as Clipboard_timestamp, where timestamp is the time and date when the paste occurred.
    How to do it...
  3. As you can see from the workbook, the data was improperly imported. To fix this problem, right-click on the data connection named as Clipboard_timestamp under Data and click on Edit Connection.
    How to do it...
  4. From the Field separator drop-down menu, select Comma; we do this because the original file was separated by commas and Tableau used tab as the separator.
  5. After making your selection, hit OK and you'll see that all the fields from the Titanic data text file are shown in Dimensions and Measures.

How it works...

While copying data from the clipboard, Tableau uses tab as the default separator of data. This causes improper import of data when the data is separated by other delimiters such as a comma. You can easily correct this problem by editing the connection to the clipboard file saved in Windows' temporary folder.

There's more...

If you created visualizations based on the data from the clipboard and you need to regularly update this visualization, you will find the Tableau online article, Editing Pasted Data, in the Knowledge Base section at the following link:

http://kb.tableausoftware.com/articles/knowledgebase/editing-pasted-data

This article explains how to save the data source of the clipboard and modify the data source.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset