Data comes in many different shapes and sizes, from Excel to databases. Tableau Desktop has a variety of data connection options, from files to databases to saved data connections. This blog will explore how to connect and use different data sets within your Tableau workbook.
1. Connecting to Data
The first screen when you open Tableau is the Start Page, consisting of three panes: Connect, Open
(and recently connected workbooks) and Discover.
![](https://static.wixstatic.com/media/505518_e55bd7e15b644e3fafd7989ded968bbf~mv2.jpg/v1/fill/w_980,h_410,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/505518_e55bd7e15b644e3fafd7989ded968bbf~mv2.jpg)
2. Searching for Data The Search for Data option allows you to connect to a data source that has been published. To connect to a data source on Tableau Server/Online instance: a. On the Start Page, click Tableau Server. b. Login to your Tableau Server instance. c. Once connected to the server instance, you will see the pop-up box that lists all the data sources available on the server. Select a data source and click Connect.
d. You will be connected to the data source and the Tableau Workspace.
3. Connecting to a File
This is the most commonly used method to connect to data. You can connect to Excel, Text, JSON, PDF, Spatial, Statistical, and many more types of files. Let's see how to connect to an excel file.
To connect to an Excel file:
a. On the Start Page, under the To a File section, click Microsoft Excel.
![](https://static.wixstatic.com/media/505518_2cf2c4c248dd4dd0b9120609aa226e44~mv2.png/v1/fill/w_596,h_863,al_c,q_90,enc_auto/505518_2cf2c4c248dd4dd0b9120609aa226e44~mv2.png)
b. This will bring up the File explorer where you can search for the file.
![](https://static.wixstatic.com/media/505518_71ce6a75eb7d410690f24dfee36fbec4~mv2.jpg/v1/fill/w_980,h_570,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/505518_71ce6a75eb7d410690f24dfee36fbec4~mv2.jpg)
c. Once you select the file and click Open, the data source page will open.
![](https://static.wixstatic.com/media/505518_50b48571907d4c5a89004920bdd9d80d~mv2.png/v1/fill/w_980,h_410,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/505518_50b48571907d4c5a89004920bdd9d80d~mv2.png)
d. Choose the sheet that you want to work with. e. Double-click the sheet to automatically ad it to the canvas within the data source page. You can also drag and drop the sheet to the canvas section in the middle.
You are now all set to start your data analysis on the selected sheet.
When connecting to different file types, the settings might vary.
A CSV connection will automatically bring the CSV onto the data source canvas once you click Open.
When connecting to a JSON file, you have to select the schema. It will allow you to bring in certain levels of detail from your JSON files.
When connecting to a PDF file, you have to select the pages. The PDF input will look for tables within.
In case of a spatial file or statistical file, once connected Tableau will bring in the file to the canvass, unless there are multiple tabs/sheets. In this case, you have to add the sheet to the canvas manually.
4. Messy Data Sources Messy data source could range from simple data preparation to something more complex.
Let's consider a scenario where you connect to a formatted Excel spreadsheet, nicely styled for Excel use, where the actual headers do not start in the first row.
a. Connect to the Excel sheet and add the data sheet with the incorrectly placed headers to the canvas. You
will notice that the data isn't correct in the data grid.
![Incorrectly placed header row](https://static.wixstatic.com/media/505518_b03209b1b914450c8e2484a136dc58b6~mv2.png/v1/fill/w_980,h_260,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/505518_b03209b1b914450c8e2484a136dc58b6~mv2.png)
b. To rectify this, in the left pane under Sheets, check the Data Interpreter checkbox. The Data Interpreter
looks at your file and understands the data.
![](https://static.wixstatic.com/media/505518_a89ca1bd732342e3a512ebd518fe2a4b~mv2.png/v1/fill/w_980,h_660,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/505518_a89ca1bd732342e3a512ebd518fe2a4b~mv2.png)
c. Tableau removes the unnecessary rows that do not match the other rows.
![](https://static.wixstatic.com/media/505518_09877f265fe74445ad6ad987a8358373~mv2.png/v1/fill/w_980,h_329,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/505518_09877f265fe74445ad6ad987a8358373~mv2.png)
While using the Interpreter, Tableau gives you the option to review the interpreted data.
![](https://static.wixstatic.com/media/505518_523772b1498e40c69615a693d45a4401~mv2.png/v1/fill/w_619,h_883,al_c,q_90,enc_auto/505518_523772b1498e40c69615a693d45a4401~mv2.png)
If you select "Review the Results", an Excel sheet containing all the changes made will open.
![](https://static.wixstatic.com/media/505518_7e0fb710265c4c2b83c61802a00e301c~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/505518_7e0fb710265c4c2b83c61802a00e301c~mv2.png)
Note that, using the Data Interpreter will not change the raw data (original file). It only changes the data that is viewed and used in Tableau.
5. Connecting to a Server
Connection to a server allows Tableau to connect to databases or cloud-based data. Let's see how to connect to a Google Sheet.
a. In the Connect pane, under "To a Server", select More -> Google Sheets
b. Tableau will open a browser window with "Google account login" screen.
![](https://static.wixstatic.com/media/505518_5dfdd456076b4f8d9fafa2f6281c45d7~mv2.png/v1/fill/w_980,h_1154,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/505518_5dfdd456076b4f8d9fafa2f6281c45d7~mv2.png)
c. Google will prompt you to authorize Tableau to access your Google Drive files.
![](https://static.wixstatic.com/media/505518_8adee70044a84a3caa43bd5703e7ea89~mv2.png/v1/fill/w_980,h_1329,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/505518_8adee70044a84a3caa43bd5703e7ea89~mv2.png)
d. Once you allow access, you will be able to see the Google sheets associated with your account. You can
use any data source and connect to it on Tableau.
![](https://static.wixstatic.com/media/505518_bafe1b8a4b914fe8b10f5ca10ec70ded~mv2.png/v1/fill/w_980,h_836,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/505518_bafe1b8a4b914fe8b10f5ca10ec70ded~mv2.png)
6. Saved Data Sources
The final section on the Connect Pane is for connecting to Saved Data Sources. To connect to a saved data source and add a new saved data source:
a. In the Connect Pane, select Saved Data Sources. This will take you to the new worksheet to start your analysis. b. To add a data source to the Saved Data Sources, right-click Data at the top left and choose "Add to Saved Data Sources".
c. You will now be prompted to save this file into your Tableau Repository as a .tds file (Tableau Data Source). Save it and the file will appear under the Saved Data Sources section.
Saved Data Sources gives you quick access to data sources that's regularly used. You can also repeat the process for any database connection to save the connection string.
留言