Opinion: Stop the Hate

Stop The Hate

There are a lot of terrible things I hear on the news, but when I hear about school shootings like the Columbine shooting, the Sandy Hook elementary shooting, Virginia Tech shooting, or more recently the Umpqua Community College shooting in Oregon, a flurry of questions run through my head like:

  • Why did this happen?
  • How could we have let this happen?
  • Was there any motive?
  • What could have possibly caused this?
  • How can we work to prevent this from happening again?

More often than not, terrible events like school shootings are either a form or a product of bullying.

Bullying is a purposeful attempt to control another person through verbal, physical, or any other type of mental abuse.

I hope none of my readers have been a victim of bullying and I also hope none of my readers have bullied anyone else, because we should all know that we are loved and should feel secure, protected, accepted, and confident in anything we do. Nobody else, especially any bully, should ever make us feel otherwise.

Unfortunately, bullying is part of our reality and it's hard to escape whether we are at school, on a sports team, at work, or even with friends and family.

I'm writing this today to tell you that bullying is not ok in any way shape or form. We should all unite to stop bullying. We should all feel inspired to be ambassadors of peace and tolerance. And we should all lead by example in order to prevent bullying in the future.

How do we do that? Stay educated on what's happening. Let's take a look at some facts…

Bullying occurs in many places, to many people... it can happen in schools, which would seem the most common place for bullying given the following statistics from a 2010 study by the National Education Association:

  • 160,000 or about 15% of children miss school every day out of fear of being bullied
  • 71% of students report bullying as an ongoing problem
  • 1 out of every 10 students drop out or switches their school due to repeated bullying
  • 1 in 7 students through k-12 is either a bully or has been a victim of bullying
  • The highest instances of bullying come in 4th-8th grade, in which 90% were reported as victims of some kind of bullying
  • 282,000 students are reportedly attacked in high schools throughout the nation each month

As children grow, they must learn to socialize with their peers and understand who their leaders are. It may seem to some that their children are innocent, so no harm could possibly be done by them, but this is often not the case. Remember the old saying, "monkey see, monkey do?" Bullying occurs in many other places we should be aware of. It can happen in workplaces, homes, playgrounds, the military, nursing homes, and other places both we and our loved ones live and work in everyday.

Bullying has no age boundaries. It can occur between a number of groups - adults to children, children to adults, adults to other adults, kids to other kids.

Bullying can occur for many different reasons. Here's why some people are bullied:

  • Cultural differences - especially those cultures obsessed with winning, power, and violence
  • Institutional - home, school, workplace having poor standard for how people treat each other
  • Social issues - acting out gets more attention than courtesy and civility, leading to jealousy or envy
  • Family issues - children growing up in homes that are not truly loving and accepting
  • Personal history of the bully - those experiencing social rejection may pass on the feeling to others
  • Having power - with great power comes great responsibility, and power is misused and abused more often than not
  • Victims of bullying - responding with aggressive, condescending, annoying, or other negative types of behavior

While actively participating as ambassadors for peace and tolerance, here's what we should look out for:

  • Physical – hitting, kicking, pinching, punching, scratching, spitting or any other form of physical attack. Damage to or taking someone else’s belongings may also constitute as physical bullying.
  • Verbal – name calling, insulting, making racist, sexist or homophobic jokes, remarks or teasing, using sexually suggestive or abusive language, offensive remarks
  • Indirect – spreading nasty stories about someone, exclusion from social groups, being made the subject of malicious rumours, sending abusive mail, and email and text messages (cyber bullying).
  • Cyber Bullying – any type of bullying that is carried out by electronic medium. There are 7 types including:
    • Text message bullying
    • Picture/video clip bullying via mobile phone cameras
    • Phone call bullying via mobile phones
    • E-mail bullying
    • Chat-room bullying
    • Bullying through instant messaging (IM)
    • Bullying via websites

To note, many victims of bullying feel the need to retaliate and become bullies themselves. It's important to treat everyone with the love and respect they deserve. We must learn to project ourselves out into the world as we would hope to receive it.

As we all know, this behavior can become extreme and lead to horrific events like school shootings. In fact, 61% of students believe school shootings are due to the shooter being a victim of bullying in the past, either at home or at school. A horrible statistic is that 1 out of every 20 students has seen a student with a gun at school. If a student feels compelled to bring a gun to school to feel safe, to feel cool, to feel intimidating... imagine what life must be like outside of school for that student?

I hear a lot of people from older generations talking about how soft we are as a society these days; about how much harder they had it when they were young. And sure, maybe our youth will benefit from a bit of tough love now and then, but aren't we, as adults and as their leaders and heroes, supposed to draw a fine line between proper social discipline and bullying? For those who want to establish themselves as the alpha in the group, just know that your anger and aggression is sending everyone else around you into fight or flight mode. Chances are, those who initially fight will eventually be drawn away from you, while those who flee because they can't or don't want to fight, may take that same anger, multiply it, and project it out to others. This sure as hell is neither an ideal solution nor a sustainable model.

I think the answer is simple, but the task is large. Everyone reading this and everyone in this world needs to embody a greater sense of love. This isn't any new revelation either... "love your neighbor as yourself" and "do unto others as you would have them do unto you." Unfortunately, I find that those who love to quote the good book are the worst offenders of its teachings in their daily lives due to the contingency of a simple confession to wash away these sins and the cheap insurance to simply "forgive and forget."

If you spot anyone being bullied, don't turn your head and walk away, speak up and stop it! If you see it in the workplace, contact your manager or HR department. Encourage bullies and victims of bullying to seek counseling. We are all on this planet together, we all deserve safety, belongingness and love, and we can achieve it by saying no to bullying. Let's work together to stop the hate!

Star Wars: A Film Review

Well this was fun!

Tableau Public recently put up some Star Wars data for us Tableau Jedi's to play with. Through Tableau's web data connector, I was able to connect to their Star Wars API and pull down some data, along with adding some of my own, to create a neat little Star Wars film review dashboard.

The idea here is to click on a film title, like A New Hope at the very top. After that's done, the poster for the selected film will appear along with the opening crawl that we all know and love from the Star Wars movies. This should provide a general sense of what's going on in the movie, so the next visualization covers the hottest words throughout the movie script. There must be a lot of action around words like "Luke" "Han"and "Death Star" in A New Hope! Now that we have an understanding of what the movie is all about, the next section at the bottom left deals with how 3 popular film critic sites have rated the movies. It's clear that Episode 4 is very popular, but it's also very well rated by Rotten Tomatoes, IMDB, and Metacritic.com. Finally, to understand why the movie is so popular, or unpopular as is the case with the first 3 movies, the star scatter plot on the bottom right shows who directed and produced it. It's pretty clear, after clicking around a bit, that movies produced by Rick McCallum tanked with the critics. So go ahead, click around, and get pumped for the amazing reviews The Force Awakens has already built up!

Harry Potter and the Tableau School of Word Clouds and Data Vizardry

What is a word cloud?

Oh, yes, that's when I take a big bite of alphabet soup and then spit it out because it's way too hot, right? No... no, not really. No. Not at all, actually. A word cloud provides a visual representation of text data where unique words are arranged in shape or clustered together and sized by their number of occurrences or importance. The viewer of a word cloud should gain a quick understanding of how many unique words exist in the text data, quickly pull out important words and see what categories may exist among the unique words.

Word clouds are a form of data visualization. They have been used since the 1990's as a means of site navigation for keyword metadata (tag clouds) to help people find the pages they're searching for on a website. Today, word clouds have been popularized to include any form of text data and there are many websites that provide word cloud services. What I found after looking through most of the word cloud websites is that the output is typically delivered in static form. In my words, "I have all this cool text data, but all I get from it is a lousy static picture?!?" Maybe that works for most people, but I want more from my text data.

Let's say I got my hands on some pretty cool text, or rather, "the most freaking amazing text," by my wife's standards. That's right, I have "Harry Potter and the Chamber of Secrets," from the 2nd novel in the 7 novel series, Harry Potter, written by the wonderful JK Rowling, in a text file. And let's also say I wanted to turn that text data into a word cloud to help me see what unique words are used and which of those unique words are used the most throughout the story. I could easily go to one of the top searched word cloud sites and create one for free, if only for this purpose.

Heck, I could even go to another top searched word cloud site and create one that removes any of the commonly used words and punctuation marks in the English language e.g. and, is, so, him, should, ?, !, (, ), etc. These are called "stop words." Some word cloud websites provide the option to choose which words or characters to suppress in a word cloud so that the word "the" isn't taking up half the word cloud like in the image above. Now, in the image below, it can be seen that the most used word throughout the book is clearly "Harry" with "Ron" and "Hermione" trailing behind.

But these are only static images and my options for what I can do with the word cloud are limited. What if I had more questions that I needed my word cloud to address? What if I needed my word cloud to be interactive? What if I wanted to host my word cloud online so that others could interact with it?

To solve these problems, I turned to Tableau.

But first I had to get a dataset, which was essentially an entire book in the form of a text file, shaped and ready to go in Tableau. For that, I busted out my wizarding wand and used some notepad++ magic along with a keen eye as I parsed out the data. What I wanted my data to ultimately look like was a 2 column table. One column would contain all the words used in the book and the other column would contain the sequence of each word used throughout the book. I also made all words lowercase so they'd be easier to read in the word cloud.

Once I had the data prepped and saved as a text file, I plugged the data into Tableau and built my first word cloud. As can be seen below, this word cloud displays all unique words or characters contained in the file, except for any unique word or character occurring less than 10 times. I figured any word occurring less than 10 times may either be a corrupt word or one that just isn't very interesting or relevant to the story - it also helps dashboard performance. Each word is sized and color-categorized according to its number of occurrences throughout the book. I've provided a way to filter the quantity of unique words displayed in the word cloud by a minimum and maximum number of occurrences. I've also enabled a word search function where one or more words can be shown while filtering out all non-matching words from the visualization.


If I go back to my data connection and left join my own, custom made Stop Words data set to it, I can easily filter out any of the commonly used words I do not want to see in my word cloud. Here, we can see that words like "the" which occurs 4,092 times throughout the book, is filtered out, along with other commonly used stop words like [and, in, a, his, of, said, he, to, etc.] while the newly reigning word featherweight champion of the book now clearly becomes "harry." This word cloud has the same ability to filter, search, and easily see the word occurrence groups.


Ok, great, I built an interactive word cloud. What about all those other questions I have? Building a word cloud dashboard would allow me to take advantage of the unique words and also the word sequencing that I have built into my text data through additional visualizations and dashboard actions. This is helpful because a word cloud is not typically the best data visualization to use if I want real insights from my data, so the dashboard below provides 3 additional views to the word cloud:

  1. A word bubble (Word Bubble! at bottom left) easily helps me get a sense of the quantity of each unique word in a given word occurrence group.
  2. A vertical bar chart (Words Used per Chapter at bottom middle) helps break down each chapter by the unique words contained within it.
  3. A horizontal bar chart (Most Used Words at bottom right) quickly shows words having the most to least occurrences.



And when these 3 additional views accompany the word cloud, I can now apply dashboard actions to click on different data points and answer questions like:

How often, per chapter, does the word Harry occur compared to all other words in the chapter? In fact, Harry appears throughout the book more than the total count of unique, relevant words in most of the chapters.



What chapters feature Ron, Hermione, or even the adorable little Dobby? If I click on Dobby, I'll see he is featured in chapter 2, chapter 10, and of course chapter 18 when (spoiler alert) "Master has given a sock... Master gave it to Dobby... Got a sock. Master threw it, and Dobby caught it, and Dobby - Dobby is freeeeeeeee."



What chapters feature certain creatures or events? Click any data point and take a look at the "Words Used per Chapter" chart to find out which chapters heavily feature certain words. I can even type a word in the "search for a particular word" filter to more clearly see which chapters feature words like "spider" (chapter 15) ...



...or which chapters are filled with "quidditch" action (chapters 7 and 10).



Very magical stuff, indeed! If you have a great example of a word cloud dashboard that you'd like to share or if you have any questions or feedback, feel free to comment below.

Tableau Table Calcs: How to Calculate a Year-Over-Year 4 Week Moving Average

Last week, a co-worker asked if I could help her out with a Tableau table calculation. Her goal was to come up with a year-over-year (YoY) percent difference of the 4 week moving average for some key metrics in her data set. Tableau easily allowed her to find the key components individually, but she was having difficulty combining the YoY %Diff with the 4 week moving average. I'd like to share how I thought through the problem and worked it out with table calcs.

First, it's important to understand what table calculations are... from Tableau's website:

"A table calculation is a transformation you apply to the values in a visualization. Table calculations are a special type of calculated field that computes on the local data in Tableau. They are calculated based on what is currently in the visualization and do not consider any measures or dimensions that are filtered out of the visualization."

The "table" refers to the data table I create in Tableau by pulling in dimensions and measures into the rows and columns shelves. The physical data table is all that I have to work with, so any values I'd like to use for a table calculation better be represented somewhere on my table! One of the neat things about this is that data can be aggregated or calculated prior to being populated in the table, and then that pre-aggregated or calculated data can be used for additional calculations. Some of the most common applications of table calculations include percent differences, running totals, weighted averages, etc.

Knowing I need all my data laid out on the table in order to use a table calc, I start with populating my data table with something like sales (measure) by date (dimension). For the purpose of this exercise, the date dimension contains dates from every Sunday of the week.

Essentially, on my data table, what I want to start with are the weekly sales figures for each Sunday. I drag my date dimension onto the rows shelf as a discrete, exact date. I then drag my sales measure onto the text mark.


Now that I have my data laid out the way I want it, I start piecing together the steps I'll need to take to get to my final solution. First, I know I'll need to be looking a year back in my data, so I want to figure out the calculation that gets me a data point from 52 weeks back from a given row. Essentially, I want to bring the sales value from 1/26/14 ($14,852) down to the same row as my 1/25/15 sales value ($18,697). To do this, I know I need the sum of sales. I also need a way to handle NULL sales values, so I employ the ZN() function to handle NULL values as 0. Then I insert the ZN(Sum(Sales)) as the expression of the LOOKUP() and use an offset of -52, since I need to look 52 values back in my weekly date to find last year's weekly sales value.


I double click my "Sales 52 Weeks Prior" pill in the measures shelf to add it to my data table, then check if my 1/26/14 value is now showing as the 1/25/15 sales value.


It checks out! The next calculation I need is to find the 4 week moving average. I right click on the Sales pill in my Measure Values and create a table calculation. I select the Moving Calculation, summarize values using the average, moving down along the table since my dates are sorted ascending, and then look 3 values back from the current value.


One thing to point out here is that I could click "Perform a secondary calculation on the result" as seen in the below image but Tableau does not provide an option for a custom number of values to look back on, which is a big part of why I'm writing this post! I only have the previous, next, first, and last values as an option, and I need to specifically look 52 values back, so let me click out of this option and go back to the table calc above.


If I click the "Customize..." button, I can check out Tableau's automatically generated calculation based on my selections. This calculation takes the Window Average of my sales, starting 3 periods back from a given value, to the given value. I rename this calculation as the "Sales 4 Week Moving Average" to save it as a new calculated field in my measures shelf because I'll be using it again.


When I click OK, this calculation will now replace the sum(Sales) on my chart, so I go ahead and add sum(Sales) back to the table for reference. Does the moving average calculation average out the current plus last 3 weeks of sales data for a 4 week moving average? Yup!


So now what do I do? Well, let me start with what I have... I have my weekly sales, my sales from a year back, and my 4 week moving average. I now need to find a way to get my 4 week moving average from a year back.

I have an excellent head start for this, because I not only got my 4 week moving average calc working, but I also have the lookup logic to get a value from 52 weeks back. What I need to do is create a new calculation that combines the "Sales 4 Week Moving Average" logic [WINDOW_AVG(SUM([Sales]), -3, 0)] with my "Sales 52 Weeks Prior" logic [LOOKUP(zn(sum([Sales])),-52)].

This is precisely why I replace the sum([Sales]) logic in my 1 year lookback [LOOKUP(zn(sum([Sales])),-52)] with the 4 week moving average logic [WINDOW_AVG(SUM([Sales]), -3, 0)].


I add my new calculated measure "Sales 52 Weeks Prior 4 Week Moving Average" to the data table by double clicking its pill in the measures shelf. Does this show the 4 week moving average from 1 year ago on the current row? It sure does!


Now that I have the current 4 week moving average and the 4 week moving average from 52 weeks ago, I can create a calculation that takes the ( (current 4 week average) - (4 week average from 52 weeks ago) ) / (4 week average from 52 weeks ago) to find my year-over-year 4 week moving average.


( WINDOW_AVG(SUM([Sales]), -3, 0) - LOOKUP(zn(WINDOW_AVG(SUM([Sales]), -3, 0)),-52) )

/ LOOKUP(zn(WINDOW_AVG(SUM([Sales]), -3, 0)),-52)


I add this to the data table to check if works...


It works! I have just created a YoY %Diff using 4 week moving averages to show that my 1/25/15 4 week moving average is 26.86% more than the 4 week moving average from 52 weeks back! If I play around with the Show Me options, I can chart my YoY 4 week moving average against the 4 week moving average of sales as a line graph, or whatever type of visualization will help the end users make data-driven decisions.


A few gems for you to note that played an instrumental role in my ability to work through this table calc problem in Tableau:

  • Build out your base table first using dimensions and measures needed for analysis
  • Maintain a level of granularity needed for the table calcs i.e. having weekly data for a 4 week moving average calculation
  • Try to get any calculations needed on the given row it will impact i.e. bringing the 4 week moving sales average from 1/26/14 (52 weeks ago) to the row that displays 1/25/15 data
  • Create basic calculations first, then start piecing them together to achieve what you need i.e. embedding the 4 week moving average calc into the YoY calc
  • Be creative but think practically