NFL Drive Analysis - Giants vs Lions

I figured I'd take the passive approach for a new blog idea and let my attention flow naturally to what's most interesting to me at the moment. With my time (and cash) vested in an office Fantasy Football league, my mind has been fixed on NFL data as of late, despite all the upstanding citizens the NFL employs.

Assault, DUIs, performance enhancing substances, shootings and murder aside, the NFL kicked off its new season last weekend. That means my fandom experience is back in full gear. Sometimes, it's great, but most of the time it's hard being a New York Giants fan. I'm referring to the NY Giants football team from the East Division of the National Football Conference (NFC) division in the National Football League (NFL). I say it can be great because we've managed to pull off (basically steal) 2 Super Bowls in the last 10 years, but most of the time it's really hard due to games like the one I begrudgingly sat through last Monday.

I digress, last Monday, while watching my beloved NY Giants [compete?] against the Detroit Lions, I saw something that I just had to try and recreate in Tableau. I set my intention to recreate a drive chart by using the play-by-play data from the game.

The play-by-play is a linear view of the game, ordered by the quarter (4 total) and time (15 minutes per quarter), and detailed with the down, 1st down yards remaining, starting field position, and play detail (players involved, play activity (pass/rush/etc), and other important details (touchdowns/penalties/etc). Here's an example from ESPN:

A very helpful view to visualize the play-by-play detail of a game is the drive chart. The drive chart shows where, on the field, the team with possession starts out and how far they make it down the field either before scoring or turning the ball over. Below is a drive chart, also from ESPN, for the 1st quarter of the game. As you can see, the Detroit Lions (in blue) dominated with 2 scoring drives while the NY Giants (in grey) were forced to turn the ball over through punting on both drives. Now, please, use your vivid imagination to picture me losing my patience and my interest in the game at this point.


I grabbed the ESPN play-by-play data and dumped it in Excel. I created two columns, one for the down detail and another for the play detail. The data looked like this after I cleaned it up a bit:


Now for the fun part! I took the down detail and play detail, extrapolated certain parts of it to new columns for a more database-friendly view of the data, and created some additional columns not provided by the play-by-play data to help me achieve what I needed to create a drive chart in Tableau. The most important new field I had to create is the "Path" field (column D). This field allows Tableau to assign the data with a start and end point for the same field. For example, rows 2 and 3 provide the same start (columns G and H) and end (columns I and J) field positions but are broken out into two separate rows that Tableau can use to reference. The starting field position (NYG 35 yard line) is assigned the path of "0" and the end field position (DET 0 yard line) is assigned the path of "1" in Tableau.


Here's where the magic happens. I have to somehow translate the available data into a start and end position on an X axis for Tableau. Tableau needs to know which side of the field belongs to NY vs Detroit, as well as what happens when the starting field position is on the NY or Detroit side. This is where my fancy calculated field comes into play. It helps Tableau identify which columns to use and what to do with the values when the path is 0 for the starting point on the field, and the same for a path of 1 for the end point on the field. I sat down with a pencil and paper to figure this one out.


Needless to say, I was pleased with the result because it factored in the full 120 yard size of the field, with each end zone having 10 yards, and it allowed me to recreate a football field in Tableau using a bunch of reference lines and bands with colors, line sizes, and shapes to indicate different activities of the play-by-play!


Now that I had that item tackled, no pun intended, I created many more calculations based on the activity/play detail/etc. Adding these proved to be difficult, especially when trying to tie my numbers with those reported by ESPN. You may see some slight differences here and there, but the general idea remains the same - the Giants got their asses handed to them by Matt Stafford and Megatron. I also added a filter across the entire dashboard for quarter (mostly to filter on the second quarter and give myself some relief that the Giants at least dominated in score, though not even offensive yards...) and used dashboard actions to make every data point interactive across all applicable charts. Here's the final product... enjoy!

World Cup 2014 Brazil GOOOALS!!!

 Well, that was fun! Anyone else feel like they're in World Cup withdrawal?

I have just the thing for you...

I was fortunate enough to catch almost every game played in the World Cup, my favorite of all sporting events. As you can tell, I'm a sucker for all the facts, stats, data, odds, visuals, blogs, coverage, memes, and general hype around this year's World Cup. There are so many fantastic websites out there that produce hours of entertainment for me. FIFA itself provided some really cool content and statistics on their website and app, while sources like The Guardian produced a flurry of facts and stats. After creating a data set that detailed each goal scored in World Cup 2014 (sans overtime penalty kicks), I decided to use Tableau v8.2's story points to help organize and visualize some of the fun facts provided by The Guardian. Check it out:

#QuantifiedSelf - I Am What I Listen To

 Hello, my name is Dave, and I'm a music addict.

In 2007, I started tracking the music I listened to through a website called Last.fm. Back then, I typically listened to music through iTunes. However, iTunes didn't provide a good historic view of all the songs I've listened to. My eclectic, offbeat taste in music combined with my inner data nerd made Last.fm a great resource to me. Over the years, I've used Last.fm to track much of the music I've listened to through my iTunes desktop application, my iPod, and now through my Spotify desktop application. The only downside is that Last.fm doesn't track music I listen to on my iPhone's Spotify app, which I tend to use quite a bit.

The next step, after tracking and storing the data, is to visualize it. And what better time to create a music data viz than #QuantifiedSelf month?! I took my data, flowed it through Tableau and came up with a visualization that encourages the exploration of my music listening habits.

A few interesting insights to point out from the 1 year look-back period shown above:

  • I typically have project huddles during the morning and try to reserve afternoons for development, which can be clearly seen in the "typical week, in songs played" heat map
  • My peak time of day to listen to music is around 3pm on Wednesday, and when clicking on this time I see I listen to a lot of punk rock, which typically has shorter song lengths, thus the higher song play count at that time
  • You can see I typically don't start listening to music until 9am, but on 3/28 I had some early morning work to do where I listened to a lot of Math Rock, a genre of asymmetric time signatures and complex rhythms, to stimulate my brain and keep me going early in the morning.
  • If you switch over to the "mood" filter, you can see I'm pretty well balanced between upbeat and relaxed music and that I've been listening to a lot more "chill" music recently. If you check out some of the chillwave bands I've been listening to, you'll see their music is perfect for warm weather - I'm ready for Summer!

Subscribe!

A few days ago, I was asked to elaborate on the capabilities and limitations of the subscription function within Tableau Server. Sure, Tableau's Online Help website has information on this subject, but I couldn't quite find everything I thought an end user would be interested in knowing in one happy place.

Some background information is that part of my job is to develop Tableau Dashboards, to do a little Server admin work, and to also demo any and all things Tableau-related. If you do any or all of the aforementioned, I think we can agree that it's important to utilize the full strength of Tableau desktop and server. But, in reality, a lot of Tableau's nifty features can get lost in a typical project. This is why I think it's important to package up as many of the cool/relevant features I can into the dashboard design itself, then demo all the extra cool "stuff" (i.e. subscriptions) the end user can do in order to create a greater sense of empowerment over the data and increase usage to drive better insights.

With that being said, this post is for you if you're:

  • developing a Tableau dashboard, publishing it to Server and would like your audience to receive your dashboard for updates
  • accessing Server to check out a few dashboards and would like to receive one or more on a regular basis
  • simply interested in a new (and super exciting) way to demo the subscription function of Tableau Server

Subscriptions allow the user to schedule an email to hit his/her inbox with an updated snapshot view of a dashboard, or even all dashboards in a workbook, that he/she would like to see on a regular basis without having to log into Tableau Server.

The subscription functionality was introduced as a new feature to Tableau Server during its v8.0 release around Q2 2013. No, this wasn't a groundbreaking innovation by Tableau, rather, a rapidly growing Tableau very wisely jumped on the subscription bandwagon. Tableau saw a large potential increase in users of Tableau Server, its means of spreading data to the masses. With many of these end users already comfortable with traditional BI tools scheduling canned reports to their respective inbox, Tableau added the subscription function to stay relevant and competitive with the plethora of BI tools already performing this task.

In an ideal world, all users log into Server to interact with the dashboards for rapid-fire insights. However, we all know a manager or two that refuses to use any technology other than their email and smart phone. This is where Tableau subscriptions come in handy; they help familiarize the typical "hands-off" user with the dashboard. And once that person starts bringing printouts of the dashboard to meetings and plugging it into PowerPoint presentations, it won't be long before the adoption curve has them logged into Server and interacting with the data - maybe even with their iPad!

Hopefully by now I've made my point as to why subscriptions can be a good thing and you now want to see a demo. Well, here's how a typical user would go about interacting with Tableau's subscription function...

Below is our "typical" dashboard view as it would appear on Server. Nothing fancy here, just a summary dashboard of some mocked up campaign performance data. Let's pretend the data presented in this dashboard is actually a live connection to a database that updates everyday at noon. We can already see some interesting data here, with performance trends and benchmarking, a top 10 chart, and a drill down chart that updates through dashboard actions. Anyone interested in viewing this information would be forced to log into our Server, find this view, and refresh it with the latest data.


At the top right, a (very small) mail icon appears next to the download link. What's interesting is that little mail icon is packed with power. Let's click on the mail icon and walk through the pop up window below... and feel free to click on the image to get a bigger view.

Step 1. Click to open subscription options.

Step 2. Check the destination email. We are able to change this. (I describe how in the "manage my subscriptions" section below)

Step 3. Edit the email subject to be something relevant. ("Overall Summary" works for me)

Step 4. Select the schedule for this dashboard to be sent. Options are controlled by the Tableau Administrator and can be customized.

Step 5. Select the content to be emailed - "This Sheet" sends only the sheet/tab/dashboard - "Sheets in Workbook" sends all dashboards within the workbook being viewed.


VoilĂ ! I have just successfully subscribed to the "Overall Summary" dashboard, with it scheduled to hit my email inbox everyday at 2:30pm. Interested in seeing what this might look like in a Microsoft Outlook inbox? Look no further...


A perfect dashboard view sitting in my inbox! Here, the email was sent by our default mail distributor we set up for our Tableau Server, called the BI Applications Team. The email was sent promptly to my inbox by 2:31pm, only 1 minute after the schedule should have began to run. If I click anywhere on the dashboard, it will bring me to the dashboard on Server, so I'd like to remind you now that this is a static, non-interactive view of the data. The benefit here is that it could be refreshed with live data if that's how the data connection is set up.

If there are tons of subscriptions the Server has to process during the same time, the Tableau Administrator is able to prioritize certain subscriptions over others to ensure key dashboards are hitting users' inboxes as soon as possible. Please work with your Admin if this is the case.

Now, let's scroll down to the bottom of the email and take a look...

What you should see is a link to "Manage my subscription settings." This comes in handy especially when you want to unsubscribe from the current dashboard, or change your subscription settings. Here's a look at what pops up on Tableau Server after you click the link and log in...

I've added in a red box to help highlight the area of focus.

  • I am free to edit the Subject of the email to be something more relevant to me.
  • I am also able to change the schedule of the email to a new option, for example I could change it to be weekly on Mondays at 9am. If I don't see an ideal option available, I can contact the Tableau Server administrator and see if he/she can include a better schedule for my dashboard.
  • I am also able to unsubscribe from my current subscription. If I click the unsubscribe button and then hit "Update," the subscription should disappear.

Oh, and one last thing, I can also update the email my subscription is delivered to in the "Change Email" section at the top of the page.

If I go back to the dashboard on Server, I'm free to create a custom view of the dashboard by clicking the filters that are most relevant to me, then saving the view to My Custom Views. For example, I clicked the "Circulation" option in the "Select a Metric to Analyze" filter and created the "Circulation" custom view below, then went through the subscription process for that view to have it hit my inbox instead of the standard view (which was originally "Demand").


Some points to call out with Tableau's subscription functionality are:

  • If there is a date filter set on the dashboard when it is published to Server, Tableau will not update the end date of that filter to reflect the current date. The only way I know how to handle this is to have someone edit the date in Tableau Desktop, then re-publish that dashboard to Server. I'd really like to see Tableau add an automatic end-date update function in the future.
  • If there are hidden tabs in a dashboard when it is published to Server, those tabs will not appear in the email subscription.
  • If there is a dashboard with many filter options, and the end user would like to see each of those filters, he/she would need to filter to each option and set a new subscription to his/her inbox.
  • Tableau does not support a wide variety of export options at the moment. Other tools allow for Excel, PDF, PowerPoint, etc. export options. Tableau only sends a PNG image hyper-linked to the dashboard view on Server.

If you have any other points I haven't called out here, please feel free to comment and I'll add it to the list. Thanks for reading!

NBC Olympics' [Doh!]nut Chart

Take a moment and look at the NBC Olympics page (screenshot below). What do you see? What impressions do you get from what you see? What questions pop into your head about what you see? What conclusions can you make from what you see?

For me, I see a classic mistake. I see an unnecessary, misleading visualization. I see... a doughnut chart. Doh!

What bugs me about this visualization is that everything I need to walk away with some insight is written out in the middle of each doughnut, or circle. Let's have a little exercise, shall we?

Which country has the most total medals? Norway has 11 total medals.

How does the next country compare? Canada has 9 total medals.

How many of each medal has each country earned? Norway has 4 gold medals and 3 silver medals and Canada has earned the same. In fact, where Norway beats Canada in the race for total medals is in bronze medals, where it picked up 4 while Canada has only earned 2.

Ok, I'm satisfied with the information I've received. The data in the center of each doughnut helped answered my questions about the top 2 countries with the most medals, the total medal gap between the two countries, and what is causing the gap.

If this is the information I need, then why am I presented with the surrounding doughnut chart? Is it because it looks cool? Is it because doughnuts are undeniably tasty? Let's think about what happens when we remove the data in the center of each doughnut.

Without the data in the center of each chart, I have 3 big, distracting doughnuts with gold, silver, and bronze slices. Canada's gold and silver slices are bigger than Norway's. Conclusion, Canada has more gold and silver medals than Norway, obviously making Canada a better performer than Norway. Then why is Canada in 2nd place?

Doughnut charts offer a good look at how proportions factor into a total distribution. In this case, Canada is actually doing better than Norway in the proportion of gold and silver medals it has earned. But who really cares about this fact? This is the Olympics, for crying out loud, where total medals are what counts, not the proportion of medals a country has earned.

To give the NBC Olympics' page some credit, they allow the user to view the data through a stacked bar chart, which is how I'd prefer to view the data. Not only do I get a clear sense of the total medals, I also have a proportional view of the gold, silver, and bronze medal counts for each country. All that anxiety about doughnuts just to get what I was looking for one mouse scroll below...


Thanks for reading and I hope you all noticed the ridiculous McDonald's ad on each side of the page, which tries to equate eating a chicken mcnugget to biting down on an Olympic gold medal. All I can say is that I hope those mcnuggets taste better than that lousy 3-toned doughnut...

Snow[board] Schema

I started skiing at a young age. Growing up in New York's Hudson Valley region, my Dad took me and my 3 older siblings to ski the Catskill Mountains a few times each year. I took lessons on the "bunny slope" my first year, where I learned the pizza, french fries technique. Soon enough, I was skiing Green Circle (beginner) trails with my siblings. This is where I learned the value of commit or quit. When you fall, you can either give up and slide down the rest of the way, or you can get back up and try it again. When I did fall, I remember hating everything about skiing. I was a slow, impatient learner, but my Dad stayed right there with me. If he hadn't picked up my skis, poles, goggles, etc. every time I had a "yard sale" (my fall caused my equipment to scatter across the mountain), I probably would've never returned to the cold, snowy mountains that I now love.

My Dad helped me improve to the point where I could comfortably ski Blue Square (intermediate) trails. He injured his knee around this time and that took a big bite out of his time spent on the mountain. But, by then I was old enough to join my middle school's ski club. Most of my friends in ski club were proficiently skiing Black Diamond (advanced) trails. Sure, I could hang with them, but having two separate skis strapped to each foot and two separate poles for each hand felt unnatural and excessive. I was an intermediate skier at best.

Around the age of 12, I became obsessed with extreme sports thanks to the rise of the X Games. Anything I watched on TV, I wanted to try at home. I was heavy into rollerblading, mountain biking, and skateboarding during the summer. It came as no surprise when, during the winter of 1999, I convinced my Dad to rent me a snowboard despite the fact that most of my close friends still skied. My Dad is a firm believer in taking lessons to learn something new or improve in what we already know, so I spent my first day on the bunny slope with this rad dude who taught me the concept of heel-sliding, toe-sliding, weight distribution, maintaining my center of gravity, and other snowboarding essentials. I don't know whether it was the idea of another extreme sport or the fact that being strapped onto the same board just felt more natural to me, but I was hooked.

With my friend Phil, who had been snowboarding for a year or so already, we taught the rest of our friends how to snowboard. Not surprisingly, we all picked it up very quick. We were all athletic with young bones that could handle the constant wipe-outs. No joke, you will not be able to feel your bum for a good day or two after learning to snowboard. The first few days, we all felt so cool snow-plowing down the mountain. By the end of the season we were hitting tabletop kickers with grabs and spins, always pushing each other to try new tricks.

Long story short, I'm still snowboarding. There are so many things to love about it. I love the feeling of being on top of a mountain, of cold wind and snow whipping across my face, of conquering mother nature and any condition she may throw at me. It's a very liberating experience and it's something that I work hard at each time I'm on the mountain because I never want to plateau. I've been snowboarding for 15 years now and have never felt bored with the sport.

Alright, now for the data-related part of this post. When I've done something for so long, the data geek inside me starts nagging my mind with questions like "How fast did I go?" and "How many miles did I ride today?" Questions like these have remained a mystery up until I had a conversation with my friend Mike 4 years ago. Mike's eyes lit up when both 'skiing' and 'iPhone apps' came into the same sentence. Mike said to me, "Dave, have you heard of Ski Tracks?!?" Given his seemingly over-enthusiasm on the subject, I probably replied with some smart-ass comment like, "Yes, Mike. The lines your skis leave in the snow... duh." Little did I know Mike's app recommendation would add a whole new dynamic to my riding experience...

Take last weekend for example. My group of friends from Massachusetts booked a house in NH in order to ski Gunstock Mountain Resort for our annual winter sports extravaganza. To be honest, the trip mostly involves a bit of skiing and a bunch of eating, drinking, hardcore puzzling, and general merrymaking. One of the fun parts of this trip is that I'd never been to Gunstock before. Much like any normally functioning human being, I try to learn as much as I can from past experiences in order to make my life a bit easier. This type of learning can be highly subjective, however, and it's nice to incorporate a bit of hard data to my process of learning and reflection. I obviously took Mike's app recommendation and promptly downloaded the app Ski Tracks.

Ski Tracks allows me to do a couple of things I'd otherwise have a hard time figuring out. When I ski, I usually get to the mountain, take a look at a trail map, figure out a couple fun slopes to ride, then go have fun. By the end of the day, I can never remember exactly where I skied throughout the course of the day. With Ski Tracks, I simply turn the app on, put my iPhone back in my pocket, and go skiing for the day. Business as usual. At the end of the day, the Ski Tracks app uses a GPS tracker through the location services function on the iPhone which tracks each run count, the time of each run, the max speed and ski vertical of each run, and the lift I skied to for my next run.



Another great feature is that it uses GPS to track my longitude and latitude at all times, as you see here:



Ski Tracks is then able to overlay this data on a satellite image map to create a really neat birds eye view of my day!



One of the very helpful features of this app, if I want to get up close and personal with my data outside of the confines of my iPhone screen, is the ability to export this data as a Keyhole Markup Language .KML file. This type of file allows me to open the data in a desktop application like Google Earth, where I have a lot more interactivity with the landscape.



Back in the app, another feature provides a time series view tracking my altitude and speed throughout the day. See how I plateaued in altitude and speed around noon? Yeah, I forgot to turn the app off while eating lunch at the Panorama Pub...



And now for the dashboard view...


As you can see, the dashboard view of the app provides a wide variety of helpful info about my day. Max and average speed help me bomb down at least one of my rides during the day. So far, my max speed has been clocked in at 54.2 mph at Stratton Mountain in Vermont. To be fair, the max slope I hit at Stratton is a 34 degree slope, compared to the 19 degree slope I hit at Gunstock. There are few things in this world I love more than snowboarding down a very steep slope.

One of the great things about the ski distance is that the app recognizes when I'm skiing, 11.4 miles, and when I'm sitting on the lift, 8.5 miles. It also tells me the number of runs I've done, not to mention the total time I spent skiing during the day.

Ski vertical and max altitude are both great measures to help me compare how steep one mountain is compared to another. It eliminates the wonder of, "I think Stratton is way higher than Gunstock?" In fact, according to my Ski Tracks app, Stratton is about 1600ft taller than Gunstock!

At the end of the day, however, it is all about the experience. I can collect as much data as I possibly could about my day, but nothing will beat the feeling of racing down a snow capped mountain with nothing but my snowboard's edge keeping me up. I encourage all my readers to try skiing or snowboarding. And for those who want a bit more out of their day, download Ski Tracks and add some data to your ride! And hey, you can even take a picture to document the conditions.

FEASTING IN PHOENIX

Welcome to 2014! I love the idea of a 'new year'. It gives me a means to start over; to leave my troubles in the past; to look forward to new beginnings; to create resolutions; to feel recharged and continue working hard to achieve my goals. A new year also gives me an opportunity to honor old traditions while finding new ways to make them fun and exciting each year. As a child, I spent each new year with my parents and siblings, watching the ball drop on TV and counting down with all the freezing people in Times Square from the comfort of my home. As a 'tween', I spent each new year with my parents and maybe even had a friend over for the night, while my older siblings were out at parties. As a teenager, I started going to parties. And now, in my twenties, the plan has typically been to spend the new year in Florida with my parents, siblings and their kids. Everything's full circle, right?

To ring in 2014, my wife and I managed to escape the cold New England weather and head some place warm - Phoenix, AZ.  Definitely not my first pick of places to spend the new year, but my brother and sister-in-law live there and I'm an easy sell when it comes to them. Not only would we be going to a killer New Years Eve party, but we'd be feasting at all their favorite restaurants. My wife and I are big into dining out, cooking at home, and pretty much anything else related to the creation and consumption of food. Needless to say, we were very excited about the prospect of a Phoenix vacation/culinary adventure.

Upon our arrival on December 31st, my brother picked us up from the airport. We took a 10am flight out of Boston and arrived in Phoenix around 2pm, which means we skipped lunch! What to do? Oh yeah, the west coast has something we don't... In-N-Out Burger!!! The perfect guilty pleasure to satisfy our serious hunger. Now, as much as I love In-N-Out, I always get stared at like a crazy person when I say, "I like 5 Guys more... In-N-Out tastes like a glorified McDonald's burger." Yes, 5 Guys does not make "animal style" burgers, but I think they taste more like a hot-off-the-grill backyard burger than a hot-off-the-production-line fast food burger. It was a good thing I only ordered a double-double animal style with well-done fries and a Coke because later that night, we feasted on some Federal Pizza pizzas before heading out to the new years party at Hotel Valley Ho.

Now, to be honest, after this point the vacation was pretty much a blur and that's exactly how I like my vacations to be, but I did manage to document every place I had a meal. The idea was that after I returned home, I'd feel more alive than ever knowing I'd eaten all that delicious food and lived to blog about it. So, after I recovered from my food coma, I compiled it all into a spreadsheet and flowed the data through Tableau. The idea was to create a 'food map' that detailed and ranked all the places I had a meal at.

Click on the viz below and you'll be able to vicariously experience my culinary adventure. I only wish Tableau would add in a way to smell the data... maybe in version 10!



Now for the hail of bullets:

  • My favorite restaurant in Phoenix is FnB. Everything from the food to the service to the atmosphere was great.
  • My favorite meal in Phoenix was at Central Bistro, where I had chicken and waffles, along with tons of other delicious sides.
  • I think I ranked Postino very high because I really enjoy dinners that consist of many small meals, similar to tapas, so the 7 different types of bruschetta really hit the spot
  • Cibo had a fantastic outdoor space to eat, with a raging fire and a very cool jazz trio. Great Italian  food!
  • The brunch I had at The Breakfast Club narrowly missed making it to my favorite meal of the trip. Huevos con masa are to die for.
  • And my last point has to be the movie experience I had at the AMC Dine-In Theatres. This place was ridiculous! Reclining leather couches with food and drink service at the push of a button. And I thought 3D IMAX was cool...

Thanks for reading!

Credit to Ben Jones at DataRemixed. I was thinking about using wms for my Tableau mapping, but I thought I'd try Ben's neat trick to dynamically display a Google  map satellite image through dashboard actions - http://dataremixed.com/2013/06/how-to-embed-a-google-map-in-tableau/