Welcome back to another guest blog,
Jared has been absolutely killing it with his online tutorials and prep flows, helping making building visualisations easier for the community. If you aren’t already please follow Jared on Twitter and be sure to check out his site, here.
Within this blog Jared will look to take us through some of the key components of how to take the data found at hockey reference (https://www.hockey-reference.com/) and transform it to be template ready.
Before we start, here is a little more around what the blend of sports and data means to Jared.
“I’ve mostly been a fan of Hockey my whole life and the more I got familiar with data, the more interesting player and team statistics became. So far I’ve only really done high-level visualizations with NHL data, but I’d really love to dig deeper to see if I could step into the mind of a team analyst or recruiter. For example, in games where Jamie Benn (the captain of the Dallas Stars) has more than one point recorded, how much ice time did he have? Is there a pattern there with other multi-point games? What about who was on the ice with him? There are so many ways to slice that information and use visualization to understand player performance.
The automation and preparation piece has become my favorite part of data in general because of the different types of puzzles you get to solve. Extracting the data and getting it into a format that’s usable for analysis is what really enables an organization to start making decisions with their data. With sports data it’s an interesting challenge because each sport has different ranking systems, different ways of capturing the data, and it’s usually formatted in less than ideal structures.”
Onto The Prep!
If you’d like to give it a go, attached in the GIT Repo at the top of the page.
How is the original data shaped?
The original data is found from hockey-reference, below is an example of one of the data tables required.
When building the workflow what are some of the key elements to look out for?
Jared: The desired output is supposed to fit into the curvy tournament bracket, so I had to ensure the end result was something that would plug into that workbook easily. Luckily, the data sets already had the team ranking embedded in them so I didn’t have to worry about calculating the rank and various tie breakers. The biggest thing to work out was the original match ups. In the NHL, 3 playoff spots are guaranteed for each Division. There are 2 Divisions in each of the 2 Conferences for a total of 4 Divisions. There are then 2 Wild Card spots for each Conference. The Wild Cards have to face the first place team from each division so that was the piece I had to really pay attention to for the rest of the bracket to line up correctly.
After determining the correct match ups, it was a matter of re-ranking the teams in order to get the points in Tableau to line up correctly. It took a few tries but ultimately came together really nicely. The only problem with the flow is that it only fits one very specific use case and you’d have to do a bit of work to mold it for a different sport. Perhaps later I’ll try parameterizing it to work for different sports but for now I’m happy with the result.
Understanding the workflow?
CJ: I would highly recommend downloading the workflow and giving it a go yourself to build an NHL bracket. Jared has very kindly commented the workflow throughout. Notice some of the early steps are looking to clean up some of the different field names and then assign them a ranking.
After this, we look to bring in a cleaned version of the post season and join it to our conference data of west and east.
Next are various calculations based on each of the different stages of progressing through the tournament. These values become unioned together to form the base structure.
We follow the methodology seen to similar chart types, like in the original collaboration with Kevin in creating a tournament bracket template and the logic from Kevins curvy bump chart.
Finally we can use the output for this to replace the tournament bracket dashboard stored on Jared’s Tableau Public page. You can find it here and attached at the top of the page.
There are rumours Jared will follow up on his own youtube site with a full run through, so do look out for that.
So excited to have had the opportunity to showcase a snippet of the amazing work Jared is doing right now, and would like to close this blog by congratulating him on becoming Tableau Ambassador this year.