Monday, 25 January 2016

Real Estate of Mind - All City Edition

In April 2015 I made a viz called Real Estate of Mind which looked at residential property sales in Manhattan. Well I decided to come back to that data-set but this time I wanted to expand out to the whole of New York City. And I also wanted to present some of the analysis that's possible when digging into this dataset. So I present Real Estate of Mind - All City Edition!



And here's a dashboard only view for digging right in:


Next time I'll write up a blog post about making this viz and do some analysis of the accuracy of the geocoding (which I'm not that happy with), but right now though I'm exhausted. The data is taken from http://www1.nyc.gov/site/finance/taxes/property-rolling-sales-data.page and the geocoding was done with geocod.io

Saturday, 9 January 2016

BALLCODE 2.0





UPDATE Jan 30 2016: The Kimono Labs scrape stopped working and Kimono provided no support. So I've had to ditch that, and my buddy Andreas helped me out with a Python script for pulling down the data. Thanks Andreas!

If you are a regular and long time reader of my blog (there must be at least 3 of you out there) you may remember a viz I made a few years a go called BALLCODE. It looked like the picture below and was a summary of the whole NBA 2013/14 season. At the time I thought I had come up with an original concept, but it turned out that wasn't the case. None the less I was very proud of this viz and it was even awarded 'most beautiful' tip from Tableau Public.


It also proved to be a very popular viz among other Tableau Public authors and has been the inspiration of a few great vizzes out there (and the lovely authors were kind enough to reference me). See in order of when they came out work by Chris Jones, Matt Chambers and Craig Wortman.


I'm very flattered that these guys enjoyed my viz and wanted to experiment with using the idea and take it in different directions and for different sports. If there's any other examples out there, please let me know.

Now the MLB and NFL are all very good, but they aren't a real sport like basketball, so I wanted to do my Ballcode viz again. In fact I intended to do it again at the end of last season but forgot. And now with the Golden State Warriors tearing up the league in an historic way, I didn't want to wait to the end of the season to start showing their streak.

So..... for Ballcode 2.0 I am going to be updating the viz as the season goes on. BUT there is quite a bit of data manipulation required and I didn't want to be copying and pasting data every week and pratting about in Excel, so I decided to create an automated data prep process. To do this I finally pulled my finger out and had a proper go with Alteryx.

The first thing I needed to do was to set up a connection to grab my data from the web. To do this I found the following very helpful - this blog post from Chris Love and this video from Alteryx.

I first used Kimono Labs to build an API that scrapes the data from basketballreference.com and turns it into a CSV. This was pretty easy to do, and is the first time I've actually managed to make a web scraper do what I want in a reasonable amount of time (but it is a very simple task). It looks like this when in action:



 I then built out my Alteryx module to parse the data, tidy it and transform it to get two rows of data per game, one from the perspective of the winning team and one from the perspective of the losing team. Here's a screenshot of my module. I'm sure Alteryx experts will probably laugh at it, but I'm pretty chuffed. (Aside - I'm ill today and this is basically keeping me occupied while I sit on the sofa drinking orange juice).

It spits out a TDE, so hopefully I should have no trouble running this every week and keeping the viz up to date. We'll see how that goes.

This time I also went to the effort of getting the official colours for each team from this great website, and created a new color palette.


BTW - I'm pretty confident in GSW breaking 72 wins.



Tuesday, 15 December 2015

OK Chewie

Tableau recently put out a Star Wars web-data connector and asked people to see what they could come up with http://www.tableau.com/about/blog/2015/12/when-star-wars-meets-data-geekdom-47549?es_p=1088362. Well, I came up with this......


Wednesday, 25 November 2015

Approval Ratings of US Senators

Quick political disclaimer - I think Bernie Sanders should be the next US President, even though I don't get a vote....

I recently came across this article on Morning Consult showing the results of a recent poll that placed Bernie Sanders as the US Senator with highest within State approval rating. I wanted to skim the results of the survey, but unfortunately they were presented in a pretty boring way that made it hard to quickly navigate and explore. I thought I could probably do a better job.

And so I came up with this




Now the hex-bin map is something I've been wanting to try, and thanks to both Matt Chambers and Brittany Fong for their recent instructional blog posts on how to do this. I wanted to use Matt's technique, and he kindly provides some clear instructions and base data to copy. Definitely read his post to understand what I'm doing below.

But because there are two senators per state, I needed to split up the hexagons. To do this I created both a left and a right half-hexagon, using powerpoint as my tool, and placed each in the Tableau Shape File repository. I was going to re-color the shapes in Tableau anyway so don't worry about the shades below.


And I needed to adjust the positioning of each half of the state, so I nudged one half left and one half right a bit.


See how my column field includes values 0.25 away from the centre of where the hex's will be placed?

Lastly, I wanted to use Net Promoter Score because I didn't think the straight approval rating tells the whole story. And as you know I can't resist throwing in a URL picture.

Feedback welcome, and feel free to use this technique for any Senate related vizzes in future!




Monday, 9 November 2015

Let's put some things into context - a practical introduction to Context Filters in Tableau

One piece of functionality in Tableau that I've been using a lot recently, and that people have been asking me about are CONTEXT FILTERS. They seem to cause quite a bit of confusion for new Tableau users so I thought I'd try and write a blog post showing some of the ways in which they can be utilized. This should also help me get a firmer grip on them myself, as I too find knowing when to use them isn't always straight forward.

Now what I'm not going to do here is talk about Context Filters in terms of performance. My experience with using context filters to improve performance is very hit and miss, sometimes it works, sometimes it slows things down and sometimes there is no difference. This all depends on your data connection type, the size and width of your data and what you are trying to achieve with the filter. For improving performance with context filters I suggest you utilise the ever popular 'try it and see' approach. I am going to talk about Context Filters in terms of functionality and give some examples.



First up, how do I make a regular filter a Context Filter?

This one's easy - you simply right click on your filter pill (or click the drop down arrow) and select 'Add to Context'.


You will notice that the filter pill turns grey. This is, in classic subtle Tableau style, your clue that the filter is 'in context.

Also worth noting is that context filters can be for single sheets, multiple sheets or all sheets. But it will be in or out of context for all sheets, you can't apply to many sheets and then switch in and out of context on different sheets.

Aggregation based filters (e.g. sum(sales)) cannot be added to context.


What does a Context Filter actually do?

In simple terms, putting a filter in context ensures that all other filters are dependent on that Context Filter. Tableau filters otherwise act independently and this is a useful feature, but may sometimes mean that filtering doesn't do what you might first expect it to do.


Thursday, 29 October 2015

Sunshine on my Shoulders

I don't know about you, but I'm already bored of this autumnal verging on wintery weather. As I was walking home from work tonight (in the dark and cold), feeling pretty glum and a bit SAD I thought "I know what would cheer me up, some sunshine and a nice viz". And so I've finally gone ahead and made the more up beat counterpart to my rain viz.




A couple of notes:
 - Sunshine hours are not the same as daylight hours, they are also affected by cloud cover, rain etc... see this explanation
 - When publishing this viz, I overwrote my original rain viz on Tableau Public by mistake by doing 'Save to Tableau Public' and not 'Save as to Tableau Public'. Be careful! If you are working from a previously published workbook, as I was here, then saving to Tableau Public will overwrite with no warning! I've lost that lovely counter which showed it had over 20,000 views..... :-(

Monday, 26 October 2015

Rain clouds - now with animation!

Remember that rain viz? Well here it is again, only this time with extra bonus feature animation. Click the green button once to start and once to stop.

Want to know how its made? Then look here