SportWise - Player Injury Analysis using Joins

  • Dani Christopher |
  • 0 step |
  • 3 minutes
  • Rolling-InsightsRolling-Insights
Tip! Video Guide available: [https://youtu.be/rADD38iYl3E](https://youtu.be/rADD38iYl3E)

Introduction

What is a Join? A Join is a mechanism of connecting and displaying data from two separate data sets. The result is a new data set that displays the combined available data. SportWise uses left joins.
What is a Left Join? A Left Join is a concept in Data Management which takes the data from Data Set A (the anchor data set) and supplements it with any additional data that is associated with matching "Key" fields in Data Set B. This concept does not display data from Data Set B that is associated with fields that don't exist in Data Set A. Your choice of Anchor Data Set, and Key will have an impact on how your data is displayed in SportWise.

First Example: Player Stats to Player Injuries

Create A DataSpace

In the following example we will join two datasets, the first being "PLAYER STATS" and the second being "PLAYER INJURIES". The first data set you select in your default Anchor (in this case PLAYER STATS), but you can change this and get different results. In this case, with PLAYRT STATS as the anchor, we will see all the values in PLAYER STATS and only the values that can be matched in PLAYER INJURIES. If no match is found the filed will be empty and display "--".
Click "CREATE NEW DATASPACE"
Click the "Name" and add the name for the field In Our Example "Join Player Stats *Player Injuries " to create our DataSpace .
Select the sport that interests you, as you see in our Example NHL.
Click "NEXT"

Choose Data

Click "PLAYER STATS" as first dataset.
Click the drop-down box to select the season.
In our Example we click "2020"
Select the fields you want to see in your DataSpace. You can always add more fields from this dataset later.
Click "NEXT"
Our second dataset is "PLAYER INJURIES"
Select the fields you want to see in your DataSpace. If you had previously selected "Name" or "Team" as part of your previous dataset, you don't need to select it again, but if you do you'll see those values twice in the completed DataSpace.
All the fields that need to be shown were selected from the "PLAYER INJURIES" dataset. Click "Next"

Join: Set Up

Click "Select Primary Data Set" in our Example we want to choose "PLAYER STATS"
Click "Player Stats 2020 (Reliant)"
Click "Select Foreign Data Set" In Our Example we want to choose "PLAYER INJURIES"
Click "Player Injuries (Reliant)"

Join: Choosing A Key

The steps below describe selecting a Key. What is a Key? A Key is the data type (column) that the system uses to look for a match between two datasets. SportWise will use the Key to connect the two datasets. You want the Key to represent the same data type between the two datasets, so choose the same Key for both data sets. Your choice of Key will impact the way your data is displayed, because this is the data type (column) in Data Set A in which SportWise will look for identical records (rows) in Data Set B, and append the corresponding data from Data Set B to Data Set A. TIP! When in doubt, choose the data field with more options. "Player" is a safe choice.
Click "Select Primary Data Field"
Click "Player" in the Using drop-down.
Click "Select Foreign Data Field"
Click "Player" in the Using drop-down.
Click "CREATE JOIN"

Join: Choosing an Anchor

What is an Anchor? An Anchor serves as the foundation for your DataSpace. Your DataSpace will display ALL data from the Anchor Data Set. Any other Data Sets joined to the anchor will append the data included in the Anchor, and will not display data if there is not a matching record in the Anchor Data Set. TIP! When in doubt choose the data set with more data, Player Stats and Player Info are safe choices.
Tip! In an Anchor Data Set, all the fields (records) from that dataset will appear even if there are no matches in the second dataset. In our example, we include all player statistics and match player injuries. Number of fields affected by "Anchor"
Once you create a join and scroll down, you will see "Anchor" checked for the first selected dataset by default. In our Example "PLAYER STATS"
Click "CREATE DATASPACE"

Your Joined DataSpace

Here is the result all the records from "PLAYER STATS " showed with the some of the data from "PLAYER INJURIES" . You can see some players have "--" under the injury type, indicating that these players are not currently injured. You can also see the total number of records fetched is 1012, but there are not 1012 injured players.
Tip! In the screenshot above, you can see some "null" values. These are represented by "--". Under the Player Injuries Column, we see "null" values for some players, this means they are not listed as injured in the Player Injury Data Set. You can also see "null" values for one player under the "Goals" "Blocks" and "Assists" columns. This means there are no stats for that player in the Data Set we selected (2020 Player Stats). This is normal, and it means that particular player did not play that Season.
For this first example, we join two datasets, the first "PLAYER STATS" and the second "PLAYER INJURIES". After the number of records is returned, you can see that "PLAYER STATS" is displayed in full because we selected it as our "Anchor". In the second example we will select the same data, but choose PLAYER INJURIES as our Anchor, and you'll see how the dataspace displays differently.

Second Example: Player Injuries to Player Stats

Create A DataSpace

In the second example we will have the same datasets as above but in a different order, the first being "PLAYER INJURIES" and the second being "PLAYER STATS" .
Click "CREATE NEW DATASPACE"
Click the "Name" in our Example "Join Player Injuries * Player Stats"
Select the sport that interests you, as you see in our Example NHL.
Click "NEXT"

Choose Data

Click "PLAYER INJURIES" for our first dataset in the Example.
Select all the fields that need to be shown were selected from the "PLAYER INJURIES" dataset. Click "Next"
Click "PLAYER STATS" for the second dataset.
You can click the drop-down box to pick the season you want. In our example, 2020.
Click the fields as we mentioned before if they are in your first dataset so no need to click here again.
Click "NEXT"

Join: Set Up

Click "Select Primary Data Set". In our Example "PLAYER INJURIES"
Click "Player Injuries (Reliant)"
Click "Select Foreign Data Set". In Our Example "PLAYER STATS"
Click "Player Stats 2020 (Reliant)"

Join: Choosing A Key

The steps below describe selecting a Key. What is a Key? A Key is the data type (column) that matches between two Data Sets. SportWise will use the Key to connect the two Data Sets. Your choice of Key will impact the way your data is displayed, because this is the data type (column) in Data Set A in which SportWise will look for identical records (rows) in Data Set B, and append the corresponding data from Data Set B to Data Set A. TIP! When in doubt, choose the data field with more options. "Player" is a safe choice.
Click "Select Primary Data Field"
Click "Player" in the Using part.
Click "Select Foreign Data Field"
Click "Player"
Click "CREATE JOIN"
Click here.

Join: Choosing an Anchor

What is an Anchor? An Anchor serves as the foundation for your DataSpace. Your DataSpace will display ALL data from the Anchor Data Set. Any other Data Sets joined to the anchor will append the data included in the Anchor, and will not display data if there is not a matching record in the Anchor Data Set. TIP! When in doubt choose the data set with more data, Player Stats and Player Info are safe choices.
Tip! In an anchor dataset, all the fields (records) from that dataset will appear even if there are no matches in the second dataset. In our example, we include all player injuries and match player statistics. Number of fields affected by "Anchor"
Once you create a join and scroll down, you will see "Anchor" checked for the first selected dataset by default. In our Example "PLAYER INJURIES"
Click "CREATE DATASPACE"

Your Joined DataSpace

Here is the result all the records from "PLAYER INJURIES " showed with the match of "PLAYER STATS" . You can see the total number of records fetched is 27, indicating that there are 27 injured players.
Tip! In the screenshot above, you can see some "null" values. These are represented by "--". You can also see "null" values for one player under the "Goals" "Blocks" and "Assists" columns. This means there are no stats for that player in the Data Set we selected (2020 Player Stats) despite currently being injured in the current season. This is normal, and it means that particular player did not play that Season.
Using the second example, we joined the same two datasets. The first being "PLAYER INJURIES" and the second being "PLAYER STATS". The completed DataSpaces results in less records because the Anchor data set is smaller. There are less injured players than total players.
Both examples involve the same datasets, but as you can see, the number of records in the resulting DataSpaces are different depending on which Anchor you selected.
Want to make guides like this in seconds? Yes, it's really that fast.
This Scribe is in tip-top shape!Leave feedback if there are any issues with this Scribe