How to connect and organize your data in Tableau Desktop

Connecting to dataset

Choose us-counties.csv file and open it in the Tableau Desktop. After successful loading, we should see the spreadsheet that shows the raw data as well as different fields available in our dataset.

organizing dataset

In the data organization section, it is possible to change the name of the fields, change their data type, create new fields based on calculated field, and finally even group the dataset for better visualization.

Change The Name of The Fields

In order to change the name of the fields, you need to choose your column and click on the toolbar at the right side of the field and choose Rename.

Now, you can change the name of that particular field.

Change Data Type

Tableau Desktop tries to identify the data type automatically. But sometimes, there might be some mismatches between the actual data type and the one that is identified by Tableau. As a result the data type could be changed by click on the top tool in each field that represent its data type.

For example for the Date that is identified correctly by Tableau Desktop as "Date" type, it could be changed to "Date & Time" to include the time as well as the date.

Sorting The Data

Each field could be sorted in a ascending or descending order. The numerical and date fields are sorted as usual based on their numerical values and the sequence of dates. The fields that their data type is character or string are sorted based on A to Z or Z to A. In order to sorted each field, you can click on sorting toolbar in the right side of each field.

The first click on the sorting toolbar will sort the field in the ascending order and the second click would sort the field in the descending order and the third click will bring it back to the original order that was available in the dataset.

Create Calculated Field

It is possible to use predefined functions or combining different fields together to create a new field. In order to create a new calculated field, click on the toolbar in the right side of the field that we used for renaming and choose "Create Calculated Field".

For example in this section, we create a new calculated field to represent the ratio deaths to cases in each county:

Group Dataset

Grouping the dataset helps to aggregate it based on similarity of some data rows. For example in this section, we want to group our dataset in different states that would help us to explore and visualize the COVID-19 dataset for each state individually and more carefully. As a result, we could group some states into South East, North East, Midwest, South West, and North West, by clicking on the toolbar at the right side of the field and choose Create Group.

Now, we could choose the name of the group as well as its members.

Custom Split or Delimiter

Tableau Desktop identifies the splitter or delimiter of the dataset automatically. Sometimes if the dataset is not clean, you need to specify the delimiter or splitter to identify the fields correctly. In order to create a custom split for each field, click on right side toolbar and choose Custom Split.

Now, it is possible to define the separator and tell the Tableau Desktop that the new split should contain how many new columns.

Pivot The Fields

It is possible to change the position of columns and rows of multiple fields by using Pivot option. In order to use pivot in the Tableau Desktop, choose multiple fields that you want to change their columns and rows, and finally click on Pivot in the right side toolbar.