Edit the Dataset
The Dataset brings in the raw data from the datasource. You generally want to edit the Dataset and tailor your data for the visualizations. The dialect in this example is MySQL to match the type of the Datasource. This tutorial modifies the tables and Dataset:
- atp_players Table
- atp_rankings_current Table
- player_stats Table
- ATPTennisData Dataset
Start from the ATPTennisData Project. Select: Projects > ATPTennisData
atp_players Table
- Open the atp_players Table.
- Concatenate the first (Fname) and last name (Lname) columns to create a PlayerName column after the Lname specification:
- The PlayType column pulls R and L from the Datasource to indicate right and left-handed players. This is pretty obscure. Add a PlayTypeDescription column to help users interpret the data:
- The Datasource contains the birthdate as an integer in the format yyyymmdd. Add a Birth_Date column to transform the data to type datetime:
- Add an Age column to calculate the age using Birth_Date and CURRENT_DATE:
- Click Save.
atp_rankings_current Table
- Open the atp_rankings_current Table.
- Add a RankRange custom column to describe Ranking:
- Click Save.
player_stats Table
- Open the player_stats Table.
- Change column ht to Height:
- Click Save.
ATPTennisData Dataset
The table names are already included in the dataset file when we add tables. We will now define the joins between the tables so that information may be retrieved from multiple tables when viewing data.
-
Open the ATPTennisData Dataset.
The tables were added to the Dataset when you added them to the project. -
Create the joins between the tables:
- atp_players Id column to atp_rankings_current PlayerId column
- atp_rankings_current PlayerId column to player_stats PlayerId column
- atp_players Id column to player_stats PlayerId column
-
Click Save.
-
Click Commit.
-
Enter a Commit Message:
-
Click Commit.
Note the alert for uncommitted changes is turned off, and the Push to Production and Deploy buttons are now active.
There are two informational reports available from the drop down menu by Deploy:
- Commit logs: displays the commit history for the project.
- View Data Model: displays the data model.