#WorkoutWednesday Week 1

Another great community activity is Workout Wednesday hosted by Andy Kriebel and Emma Whyte.  According to Andy it’s “designed to test your knoweldge of Tableau and help you kick on in your development.”  They’re alternating odd vs. even weeks.

Here’s the first task in a visual nutshell (using Superstore data set):

I’m happy to say that I was able to complete the task.  What was the most interesting part?  To get the dots on the single lines I ended up redoing a field that had a secondary table calculation and using some built in functions.  Those functions were RUNNING_SUM() and TOTAL().  The dots continued to be tricky, but I resolved to using AND logic within my IF statement and leveraging LOOKUP().

I also did a micro upgrade.  The instructions indicated that the red should highlight the “most current year.”  When interacting with the viz on the original blog, I noticed that only 2015 was red and the title was static.  So I added in logic to highlight the most recent year and added the dynamic change to the title as well.

Full viz on my Tableau Public page.

Funnel Plots

As I continue to read through Stephen Few’s “Signal: Understanding What Matters in a World of Noise” there have been some new charts or techniques I’ve come across.

In an attempt to understand their purpose on a deeper level (and implement them in my professional life), I’m on a mission to recreate them in Tableau.

First up is a funnel plot. Stephen explains that funnel plots are good when we may need to adjust something before an accurate comparison can be made. In the example video, I adjust how we’re looking at the average profit per item on a given order compared to all of the orders.

What’s interesting is that in tandem with this exercise, I’m working on an quantitative analysis class for my MBA, so there was quite a bit of intersection. I actually quickly pulled the confidence interval calculation (in particular the standard error equation) from the coursework.

I find that overall statistical jargon is really sub-par in explaining what is going on, and all the resources I used left me oscillating between “oh I totally get this” and “I have no idea what this means.” To that end, I’m open to any comments or feedback to the verbiage used in the video or expert knowledge you’d like to share.

Link to full workbook on Tableau public for calculated fields: https://public.tableau.com/views/FunnelPlot10_2_16/Results?:embed=y&:display_count=yes

Thoughts on sorting in Tableau

Now with video 🙂

Last week I ran into an interesting situation with Tableau.  I wanted to sort dimensions within larger dimensions by a measure.  After that sort, I wanted to encode an additional dimension on color.  Here’s what that would look like using Superstore:

Sorting Figure 1

In the view I am looking at sub-categories by each segment, hoping to rank them by the sum of Sales.  I’ve encoded an additional measure (discount) on color.

This could be a great visualization for understanding demographics within hierarchical type dimensions.  Like say the gender breakdown of who has diabetes at hospital A.

The issue is, getting to the view shown above is somewhat more complex than I had originally thought.  So let me walk you through what happened.

  1.  Set up my view of Customer Segment, Sub-category, by sum of sales
  2. Created initial rank calculation (index()) and then did the typical sorting.
  3. Table calculation is set as follows (Custom Sort = sort by Sum of Sales, descending order):

sorting-2

4. Gets me here:

sorting-3

5. Now when I add Discount to color, my whole viz breaks:

sorting-4

6. To correct this a few things have to be done.  Initial table calculation needs to be modified to ensure the Discount is taken into consideration, but not considered for the sorting:

sorting-5

Super important to notice here that Discount is at the lowest level, but we’re computing at the “Sub-Category” level.  We’re still restarting every “Segment.”

That gives us this:

sorting-6

So now we have the sub-categories correct, we’re looking by region.  But we’re back at that original point of our sort isn’t computed correctly.  This is because we’re sorting by the highest sum of sales for a given discount in a segment.  The first sub-category is found and grouped together.  Then the next sub-category is found with the next highest (not 2nd, just ‘next’) sum of sales for a given discount.  Check it out in comparison to the crosstab, the pink highlights how the index() is working:

sorting-7

To fix this last step, we need to let Tableau (the table calculation, the world!) know that we don’t care about discount for the sum of sales.  We only care about sub-category and segment.  To resolve let’s pull in a simple LOD:

sorting-8

Now finishing it all up, replace the measure used in the table calculation for sorting:

sorting-9

And we’re back at what we originally wanted:

Sorting Figure 1

Full workbook with story point walk-through here: https://public.tableau.com/views/LearningMoment-sortingwithtablecalculations/Learningmoment-tcalcs?:embed=y&:display_count=yes