Alteryx For Sport – “Find Nearest” (Organising your scouts)
A lot of focus in the use of data in sport is centred on talent identification, team/player performance or human performance/sport science. However, calling on my 9 years’ experience working within elite football, I can certainly state that this is just a small part of the work that goes on behind the scenes at a football club.
This is because researching, planning, implementation and reviewing of strategies and processes takes up a huge amount of time.
One aspect of this planning is the arranging of which players to scout, establishing when they are playing and identifying the nearest scout to the location of the match, before then requesting tickets to that match.
How can Alteryx help me?
I’m going to do this using the “Find Nearest” tool in Alteryx.
First, let’s start with our databases. We have two CSV files, one which has the stadium name, stadium capacity, city, country, longitude, latitude and competition (league) of all 92 clubs in the English football leagues for the 2015/16 season (you can download this csv file here).
The second database contains a list of scouts along with their home city, postcode, latitude and longitude. Note: I used ukpostcodedata.com to find the longitudes and latitudes of each of my scouts based upon their postcodes.
What’s my workflow?
Create a new workflow in Alteryx and introduce your two CSV files to the stage by using two “Input Data” tools. Then drag-and-drop two “Create Points” tools and connect your “Input Data” tools to these.
The “Create Points” tool creates a point-type spatial object from two input fields (ie. Longitude & latitude or X & Y). In our example we need to select “Longitude” as the X Field and “Latitude” as the Y Field for both data streams (Clubs and Stadia Locations and Scouts Locations databases), we also need to define these as lat/long floating points. By default, these new spatial points will be given the field name “Centroid”.
Now that we have our spatial points for every scout and for every club stadium, we can use the “Find Nearest” tool to find the nearest scout to each stadium.
Connect the Clubs & Stadia data stream to the Target (T) input of the “Find Nearest” tool and the Scouts data stream to the Universe (U) input. We then need to select the centroid for the ‘T’ & ‘U’ inputs in the configuration menu. In this example I have chosen to find the 3 nearest points (which will find my 3 nearest scouts to each stadium). I have also taken this opportunity to rename a couple of the fields (as you will see in the configuration window).
From the “Find Nearest” tool we will obtain the names of the three nearest scouts for each ground, their distance from the ground and the direction (ie. north west).
All we need to do then is to connect the ‘M’ output of the “Find Nearest” tool to an “Output Data” tool and configure our output settings, for this example I have created a .tde for use in Tableau.
Now for tableau…
I have connected to my Alteryx workflow output and also a second datasource in Tableau, which is a list of all matches for the 2015/16 season and blended the data on Club = Home Team. This then links the home team of any match to the stadium location and nearest scout details of that specific match.
Feel free to explore and download this dashboard here.
Keep an eye on the ‘Alteryx for Sport’ series for further posts regarding how you can spend less time on strategy and organisation and more time on talent id and recruitment.