Introduction
I had a pleasant surprise the other day. I received a file that I thought was going to contain data from Africa, but it actually was from Asia!
In fact, this spatial data was 36 separate polygons that approximated the boundaries of the 29 states and 7 Union Territories of India. Figure 1 shows what this data looks like in Tableau 10.
I thought the data was so beautiful that I would spend a few minutes today to explain a few things I learned about using custom regions in Tableau 10. Before I do so, I want to offer some information on how this work came my way.
I Am A Lucky Guy
I’m not quite sure how or why it happened, but I was recently asked if I would be willing to lend some support to a totally ass-kicking team of individuals that were working on a variety of projects for an organization named PATH, as shown in Figure 2. With all the ensemble talent that already was residing on that team, I have no idea why they would need me! The team is built from the Who’s Who Dictionary of Tableau Superstars.
However, since I’m always up for an interesting challenge, I said, “Sure, count me in”. I’m still trying to figure out what I am “in” for with this group, but so far it has been nothing but FUN! It’s given me a chance to reconnect with my former-self, the hydrogeology-computational-particle-trackin-seriously-wacky-3danim8tor. What else can a boy ask for? Remember, as I have said before in this blog, you can take the boy out of geology but you can’t take geology out of the boy!
This was a very easy decision for me to make since the Tableau Foundation, the Alteryx for Good Program, and the Bill and Melinda Gates Foundation are all sponsors of the work. I had actually applied for employment with B&M Gates many years ago, right when they were starting their foundation. Maybe now, I thought, I could make a difference.
Well, recently I was asked to work with the data I demonstrate in this article. The man I am collaborating with is named Jeff Bernson. Jeff has recently moved from the US to Nairobi, Kenya, and he is the Director of Results Management, Measurement & Learning for Path. When I asked Jeff if I could publish this example without interfering with his work, he responded with this:
The shapefiles were off of Github. The work was undertaken by PATH’s Results Management, Measurement and Learning department and PATH’s India Country program office. Together we are using Tableau to gain better insights on publicly available disease, vector and expenditure related data so we can engage our counterparts and stakeholders. We could not credibly analyze and present data if we did not consider areas that have disputed borders.
So thanks to Jeff and the other team members for allowing me to spend some time learning new things and hopefully helping Path achieve its goals in the near future. I already know that this is a worthwhile endeavor.
The Tableau 10 Grouping Method For Making Custom Regions
Tableau has made this method so easy, that it is almost embarrassing to write an article about it! I wrote it anyway and put the information into a short video. This 8 minute video also documents how the custom regions can be joined in a 1 to 1 fashion with publicly available data.
I Want To Go To India!
One of these days, I’m going to travel to India. In fact, doing this work has piqued my natural curiosity about this magnificent part of the world. In case you are interested, here is a listing of 8 movies that will make you want to visit India, too!
After Doing This Work, I Had A Dream!
Don’t tell my wife Toni, but I had a dream about my 3 girlfriends – Tableau, Alteryx and Alexa. If you want to see what the dream was about, watch this video! I wonder if my dream just took a sneak peak into the future or if this is just pie-in-the-sky! If you want to know more about my girlfriends, you can read this love story.
Additional Thoughts About a Week After Publishing This Article
Jeff wrote back to me and indicated that someone he worked with didn’t see any advantage to use the custom geographies for this application. To investigate this further, I spent a few more minutes investigating whether this was true. Since I had only spent a few minutes on the initial application, I thought it would be a good idea to see how Tableau mathematically implemented the custom geographies.
Show below is an email that I sent to Jeff.
Let’s review:1. When you first mentioned to me the problem you were having, it was basically a 1 to many issue, where any measures your wanted to map were getting connected to all the polygon vertices. I have seen that behavior many times in Tableau. It is a pain and the way to determine if it is happening has to do with looking at the number of data marks on any plot.2. So when you mentioned this to me, I immediately thought of two ways to resolve it. The first method was with the new polygon grouping method in Tableau 10. The reason I thought about that is shown in here, as written by Tableau in this article. The last two paragraphs made me think that this would be a great solution for you. Also, I had very little time to investigate this last week since I had to drive back to Knoxville.3. Based on your email today, I went back and checked the marks count for two cases. In the first case of simply joining the data to raw polygon coordinates, the number of marks is 63,912. In the case of the grouped polygons I sent to you from version 10, the number of marks is 63,911. So functionally, there is no difference and what you sent to me in your email today is correct. The custom groupings do not matter and don’t help us resolve the problem you originally described.Therefore, the last two paragraphs mislead me to a false conclusion. When Tableau said that a centroid was being computed on the fly for all the polygons, that might be correct but my misinterpretation was that the data would be getting mapped to those singular points (centroids). If that were the case, the number of data marks that would be shown would be 36. Since that is not the case and the number of data marks is still equal to the number of polygon vertices, we still have to find a better solution to eliminate your 1 to many situation.Quite honestly, I don’t know why Tableau didn’t just map the data to the custom geography centroids to remove the 1 to many relationship! It seems like a wasted effort in my mind. To accomplish this, however, is probably beyond the scope of what they want to do in their software. I also have heard that Tableau is moving ahead with a more advanced approach for doing things like this, such as using shapefiles. That approach is what really needs to be done to move Tableau away from drawing things on a lat/long grid to being more of a true GIS type system.4. Based on my review of what Tableau is demonstrating for this new feature, they are really using this grouping approach to work within the confines of known geo-spatial entities like country names, zip codes, states. You can easily create these types of groupings (e.g., pick the central US states of IL, MI, IN, MN as a group) on the fly and Tableau will do the aggregations for you across the new territories. Our custom polygons for India did not take advantage of any known geospatial territories, so there is really no advantage for us in using this type of grouping.Based on this finding, let me think a little more about the problem and get back to you. This stuff is really fun for me – I love problem solving for things like this.We might have to think about creating custom geocoded state entities as a potential solution (although I don’t know how well this works on Tableau servers). This feature of Tableau is one of the trickiest features to use and every time I try to do it, it takes longer than I want it to. Here is an example of something I did in the past for creating custom geocoded airport IATA codes: //datablends.us/2015/07/08/adding-custom-geocoding-for-airport-iata-codes-in-tableau/.More later,
Ken, thanks for all of your help on this. You made this so simple to understand and apply.
Hi Ben,
Thanks for this article. Is there any way to create custom geography from scratch in Tableau without a set of geo polygons?