![]() For example, some players were listed as “LB” (linebacker) when they should have been listed as “ILB” (Inside Linebacker), which is a more specific position. In my flow, I used the clean step to group up mismatched positions in SporTrac’s 2018 player salary data. The resulting diagram shows the workflow I’m creating to transform and join my data. Tableau Prep’s Clean step allows me to change field names, filter out or replace values, split columns, and group data by selecting a column in the profile pane, then selecting the action I want to perform from the list at the top of the pane.Īs you can see at the top of the workspace above, the cleaning function is represented by a new step connected to my data source. Enter Tableau Prep.Īfter opening Tableau Prep, I connect to the Excel workbook containing my data and drag the first table onto the canvas to get started. Correcting them all manually would take hours. Though small, these discrepancies would generate mismatches if we simply joined the data in Desktop. Some of the dimensions in the data sources contain slight differences (e.g. The draft data is drawn from a few different sources, including Pro Football Reference and SporTrac. Given each team’s set of picks, where could they potentially replace a player on a market-priced contract with a similarly productive player on a rookie contract? By comparing the value of rookie contracts to those of existing players I hope to see the positions where each team might create value with their draft selection. This means that a team with the number one overall pick will pay the same salary to any player they select, whether he is a quarterback (typically thought of as the most important position on the field) or a punter (a position that gets on the field about five plays per game). In the NFL, draft position determines the value of first year contracts. With so much talk about the NFL Draft this year, I decided to look at the money being paid to each player being drafted. When the NFL Draft season arrived, I couldn’t help but to look at some NFL Draft data to analyze the incoming draft class against active NFL players. As a self-proclaimed sports nerd, when I have free time, I like to dive into sports data sets. Prep makes it easy to clean your data and to complete many data transformations that would be tedious or even impossible in Desktop or in the data source. Self joins are a great alternative to what might have been a very tedious copy-paste situation.Tableau Prep is a new visual data preparation tool that integrates with Tableau Desktop. ![]() ![]() I can discard this, add a clean step and voila! I have all the data I need: As the first film in the series, Harry Potter and the Sorcerer’s Stone is not a sequel. ![]() Of course, I will have one result excluded. If I join my two worksheets with Sequel=Movie, I can then obtain information for that sequel’s release date, as well as the sequel’s sequel: The challenge I encountered was, how do I join my two instances of the same sheet together in order to get the information I wanted? I needed to make sure that I was pulling in each sequel’s release date as well as its own sequel, information contained in the three columns of my original data source: What’s interesting is my join clause, and this took a bit of experimentation. While this isn’t a pre-defined join option, I can join my Sheet 1 to my Sheet 1. In order to get that data source, I can do a self join in Tableau Prep (note that this could also be achieved in Tableau Desktop). I want a new data source that will show me a few new columns per movie: what is the sequel’s release date, and what is the sequel’s sequel? For example, for Harry Potter and the Sorcerer’s Stone, I should still see the release date of 2001, the sequel should still be Harry Potter and the Chamber of Secrets, but I also want a column for the release date of 2002 for Chamber of Secrets, and for Prisoner of Azkaban as the sequel to Chamber of Secrets. Here’s what I am trying to accomplish: I have a list of all the Harry Potter films, the year of their release and what their sequel is: So when my student, Greg, asked me for a good example of a self join, I knew why I would do it but not how. But one join type eluded me-the self join. There are myriad join options, from your traditional left, right and inner joins to more advanced options such as Left Unmatched Only, which will include only rows that exist on the left data source. It’s no secret that Tableau Prep is a game changer for those looking to clean, explore and connect their data sources together.
0 Comments
Leave a Reply. |