This week I decided my spare time should focus on revising Spatial Tools in Alteryx and using API’s. Up until this point, I had only successfully retrieved data from one API (cheers Zomato). Along the way, I have been unsuccessful with a few others, so I was determined to get a little more practice in.
I also currently have a problem of getting home too late each night, eating dinner and then heading to bed completely exhausted. This routine does not leave too much time or energy to exercise. I have therefore decided that going to the gym immediately after work a few nights a week will give me the exercise I need.
So instead of Googling for gyms near my workplace, I decided to be a responsible data analyst, and have a crack at using Alteryx instead. This blog will be an explanation of my workflow methodology, and some reflections and tips of how to adapt my solution to other needs.
Below is a snap shot of my workflow in Alteryx
As you can see it is split into 3 containers, which corresponds to the way I went about solving the problem.
The first section (top left), inputs an excel file I got from the “Fitness Passport” website. As a passport holder, I pay a weekly fee that gives me access to many gyms throughout Australia (I like to think of it as the Netflix of fitness). Since I am already paying for this service, I would rather go to a Fitness Passport approved gym.
The excel table itself was not very clean, the region, gym names and open hours (24/7 or not 24/7) were all in the same field. The bulk of my workflow in this container is straight forward, mostly filters, selects, formulas and parsing. It did give me a bit more practice using Regex (something I sorely need).
The next section (bottom left) runs a Google API call, that retrieves all the locations and details of gyms close to my workplace (1.5 kilometers). I found this to be time consuming, the Google API required a bit of background work prior to use. I spent the most time trying to properly concatenate the URL to be of accepted form. Big shout out to Craig, who spotted a ‘$’ where there should have been a ‘&’.
The size and complexity of the last container (above) was not anticipated. I found it difficult to match the name of each gym from the fitness passport list, to the names of the gyms extracted from the API. This was especially tricky when there were multiple gyms from the same chain. I also used the reverse geo-code tool for the first time, as I thought it might be useful for me to know the actual addresses of the gyms.
Below is the result of my workflow visualized in Tableau
As you can see, this map shows the gyms close to my workplace. It also shows the location of the train station, as that also factors into the convenience of my decision. The beauty of this map is it shows the different places I could go to if I like if my needs change (e.g. If I might want to go from a swim).
I also would like to mention to anyone that is unfamiliar with Sydney, there is a rather convenient bridge that crosses the harbor.
From here, I would like to eventually get around to incorporating fuzzy matching into my workflow, I would also like to have a go at converting it into an analytic app, so I (or others) can re-use it for different purposes.
Overall my solution is not all that elegant, it can be done using less tools. It is an over complicated workflow because I fixed each problem at the point I encountered it, not from its origin. At this point I am happy that it works, and to have found a gym that I can go to! I am also happy that I have a large workflow that I can use to practice cleaning, compressing and optimizing.