Hey Folks,
I'm messing around with a pretty simple dataset for one of the makeover monday's published by Andy Kriebel. I was curious to see if there was a way in Alteryx that I can generate something that shows neighbouring states in the United States. Eg Florida has Alabama and Georgia as neighbours - so my output table would look something like
State | Neighbours |
Florida | Alabama, Georgia |
If it's not possible in Alteryx, I have found another way.. but just looking to improve my alteryx toolbox :)
Cheers
Fi
Solved! Go to Solution.
Hi Fi,
Yep possible.
I am far from an expert on spatial stuff but here is my go.
First needed state polygons. Google have KML ones here: https://www.google.com/fusiontables/DataSource?docid=1-v6i33Lf_FjhRZcHKO0PG2DADipCg4L-dGiucAE
I downloaded it as a CSV then used RegEx tool to convert into a set of points
Then the spatial tools to create points and the polyline build
Finally use a spatial match to look for boundaries and select the unique boundaries.
Sample attached
I differed slightly but came up with nearly the same answer. If you need a data set, Alteryx provides some spatial from US Census & USGS here. I used the US Census for my source.
The main difference was that I'm using only touches. I did this because of the way the spatial data was built. In this case it works since all the border are coincident and not overlapping. The rest is just to clean up for the output. The summarize uses a groupby on the state and concatenates the neighbours together.
Hi Guys,
thanks for taking the time out to reply and provide me with two answers! Unfortunately I am on a work computer that's locked down and we have alteryx 10.1 installed. Looks like I'll have to kick off a request to upgrade which will take about 6-8 weeks :(
I'll try to look at your workflows to see if I can generate something.. and maybe ask questions along the way if I get stuck.
Cheers
Fi
Thank you for taking the time out to help me again! The solution worked :-) When I get around to finally writing a blog about my makeover monday are you ok if I reference the great work you did on this?
Of course.
User | Count |
---|---|
18 | |
16 | |
14 | |
6 | |
5 |