VizWiz

Launch, grow, and unlock your career in data
Showing posts with label Joe Mako. Show all posts

January 10, 2015

Tableau Tip: One Parameter; Unlimited Number Formats

13 comments
As a follow up to yesterday's blog post about "One Metric; Two Number Formats", Tableau Zen Master Joe Mako left a suggestion that I'm going to write about today that utilizes the Labels shelf. This method allows you to have as many different number formats as you desire, whereas my previous post only allowed two (and frankly, its use case it pretty limited).

Step 1: Create a parameter that is a list of metrics.


Step 2: Create a calculated field that returns the value of the metric selected.



October 10, 2014

Flowing with Tableau - The Tableau Wannabe Podcast Hangout with Joe Mako

No comments
Today, the wonderful hosts of the Tableau Wannabe Podcast, Matt Francis and Emily Kund, welcomed world famous Tableau legend Joe Mako for a live podcast. If you missed the session, you can watch it below.  The session starts around the 2:05 mark.

January 24, 2014

Tableau Tip: Showing all dates on a date filter after a Server refresh

34 comments
As I was preparing for my trip to Israel, the team posed an excellent question: Why doesn’t the date slider quick filter automatically show the latest date when the data is refreshed on Server?
I saw on this thread that it’s still an unsolved problem.  In a nutshell, here’s a summary of the problem:
  1. You created a dashboard that has a date slider quick filter and you’ve told Tableau to use all dates.
  2. The next day when the data source refreshes, the quick filter doesn’t automatically include the new date(s).  The slider has to be manually moved to the right to accommodate for the new data.
I didn’t have an immediate solution, so I did what I always do when I’m stuck…I asked for help!  That’s right, Zen Masters don’t know everything.  In fact, I don’t know anywhere near everything about Tableau.  I contacted my good friend Joe Mako and he graciously hopped on a join.me with me.  What I truly love about Joe is that he’s incredibly patient and wants to make sure that we work through problems TOGETHER.  Sure, he could have simply sent me a solution, but he wanted to make sure I understood completely.

Let me first explain the problem in a bit more detail.  Assume that you have a set of sales data for the first few days of the year.

image

And you built a cool dashboard with a date slider like this:

image

You publish the dashboard to Tableau Server and set the data source to refresh each night.  But when you look at it a couple of days later, you notice that the chart hasn’t changed.

image

You can clearly see that four more days should be included, but the slider is still stopped at January 10th.  Tableau does not automatically adjust the date slider; it stays at whatever dates were picked when you published the workbook.

That leaves you with two options, both of which are not satisfactory:
  1. Republish the workbook every day.
  2. Tell your users that they have to adjust it themselves every day.
Or maybe there is a workaround.  This is where Joe stepped in.

Step 1: Create a parameter that allows two options and show the parameter control.

image

Note from Joe: This allows us to default the view to including all dates, while enabling the interactor to decided to apply a date filter.

Step 2: Duplicate the data source (or alternatively create a data source that has only the dates since that’s all you need to make this work, or you could use custom SQL like “SELECT DISTINCT Date FROM Table”) 

Note from Joe: This will give us a data source with a valid date range, a kind of dynamically populated parameter.

Step 3: Unlink the Date field in the secondary data source.  Ignore any warnings. 

image

Note from Joe: This way there is no Group By clause sent in the query to the secondary date list data source.

Step 4: Create a calculated field that checks for matching dates.

image

Step 5: Replace the Date filter on the worksheet from the primary data source with the Date field from the secondary data source and show the quick filter.  Again, ignore any warnings. 

image

Note from Joe: The combination of this calculated field in the primary data source, and a filter on the Date field directly from the secondary data source, is where the magic happens. The filter on Date that we just placed will happen in the query to the secondary data source, then the aggregations to get the MIN and MAX Date in the secondary, and then the comparisons that happening the formula will happen after the results are returned from each data source. This is effectively enabling us to get the selection of the filter available to use in the calculated field.

Step 6: Add the date match calculated field that you created in Step 4 to the Filters shelf and set it to At Least 1. 

image

Note from Joe: The INT() in the formula turns the Boolean value into an integer because a Boolean cannot be Continuous and Tableau cannot filter on a Discrete Measure if it is not a table calculation.  So by changing the data type, we can make the pill a Continuous Measure and filter on it.

Step 7: Clean up the dashboard – Remove the quick filter that is showing, add the quick filter for the Date slider and show the parameter control.

When you publish the dashboard, be sure to pick All Dates from the parameter created in Step 1 above.  The Date slider will still not move, but at least we are now defaulting the dashboard to always show all dates and then the user can filter if they wish.

You can download the sample workbook here.



January 14, 2013

And the winner of the VizWiz Electric City redesign contest is…

3 comments

John Matyskiel of Ontario, Canada! 

The participants were asked to redesign this viz.  The instructions were intentionally vague and I also intentionally chose a data set that had a few problems.  There were several outstanding entries, for which I’ll highlight a few of my favorites below.

We must start with John’s winning entry, which he built with Adobe Illustrator. 

 

John Matyskiel

Download a PDF version here to view at full size.

What set John apart from the others was his use of story telling.  I felt like I really learned something after reading John’s work.  Even though I‘m not typically a big fan of stacked bar charts, John’s work for me because visually the bars are asking me to compare travel methods across an individual city, not down the chart.  John makes good use of colors too, keeping travel methods within the same categories in the same color palette.  If I had to pick one thing to improve, it would be to make the gridlines lighter.

For his efforts, John will receive a super warm Facebook hoodie.  I suppose he might need it up in Canada.

FB-200

 

Robin Kennedy of The Information Lab in the UK submitted this interactive version built with Tableau.  Click on a City to see the Travel Methods update.  Then click on a Travel Method and see the Country comparisons update.  What’s really neat is how Robin uses different shapes depending on the Travel Method you select.  Try it.

 

Kalpana Behara submitted this great hand-drawn viz all the way from India (click it to see a larger view).  She’s a cartoonist and a Manchester United fan, but I didn’t count her loyalties against her.  I love the cross-tab view, the good use of colors to categorize the data, and the choice to use a lollipop chart, which emphasize precision (dots) over length (bars).  Her design also makes it easy to see where there are holes in the data.

I’m not sure if Kalpana is trying to tell me something, but there’s a hidden devil on the page.  Subtle indeed…

 

Kalpana Behara

 

Tableau Zen Master Joe Mako submitted this simple and clean design built in Tableau.  Needless to say, for anyone that knows Joe, he did a great job of using colors, particularly the shading within categories and is an overall good technical re-design.  What sets John apart from Joe is his story telling.

 

Joe Mako

 

Jon Schwabish’s entry was also built with Adobe Illustrator and it’s very similar to Joe Mako’s, except it takes up much more space.  I like how the color of the headers correspond to the colors of the bars. That’s a nice visual cue.  Jon also added some very helpful text.

Jon Schwabish

 

Thank you to all of those that entered! It was a lot of fun reviewing each submission.  I was amazed at how different people can look at the same data.

And again, congratulations to John Matyskiel!  You’re sweatshirt is on the way.

July 26, 2012

Tableau Tip: Adding totals of a 2nd measure on top of stacked bar charts

21 comments

Before I get started, credit for the technique/trick in this blog post to Jonathan Drummey.  Follow Jonathan on Twitter or follow his new blog

Also, if you don’t use the Tableau Forums for getting answers to those things that have you stumped, then you’re missing out.  It’s very rare that I can’t either (1) find the answer or (2) get the answer by starting a discussion.

Now, consider that you have a stacked bar chart of sales by Product Container color-coded by Region.

image

Great! But it would be more useful to label the top of each bar with the totals sales like this.

image

Awesome!  I was banging my head trying to figure out how to make this work.  Adding totals to a stacked bar is straight forward, but the trick here is that the bars represent % of total, not the raw sales.

It seems so simple, but I was stumped.  Fortunately Jonathan was there to save the day, and I can’t believe how simple it was. 

Here’s how it’s done, starting with the stacked bar.

Step 1 – Create a calculated field with the value of one

image

Step 2 – Drag your new “One” measure onto the right side of the chart until you see the dotted lines (which indicate a dual axis), then drop it.

You now probably have an ugly chart like this:

image

Step 3 – Change the aggregation for the One measure from Sum to Average (right-click on the One pill, go down to Measure, then pick Average)

Step 4 – Right-click on the right axis and choose Synchronize Axis

Step 5 – Click on the carrot on the top-right of the Marks card and choose Multiple Mark Types

Step 6 – Scroll to the right on the Marks card until you get to SUM(Sales).  Change the mark type to Bar.

image

Step 7 – Scroll to the right again to get to AVG(One). 

  1. Remove Region from the Color shelf
  2. Set the color transparency to 0%
  3. Change the mark type to Gantt Bar (Joe Mako suggested using Gantt Bar instead of Bar because it creates a line at the top and it will eliminate the chance that the user could select a hidden bar.)
  4. Drag the Sales measure onto the Label shelf
  5. Set the Label alignment to Top

image

You should now have a chart that looks like this:

image

Step 8 – Right-click on the right axis and uncheck Show Header

That’s it!  Pretty simple! (Now that I know how to do it.)

image

Download the workbook here.

May 24, 2012

Creating an interactive monthly calendar in Tableau is easier than you might think

26 comments
If you’re not following the InterWorks blog, you should be.  They routinely crank out fantastic tips and tricks for Tableau.  Dustin Wyers, a BI Analyst for InterWorks, recently wrote about “Creating Calendar Views in Tableau”. 

Dustin’s post does an excellent job of taking you through creating a calendar viz step-by-step.  But I felt it fell a bit short in the end since you didn’t actually see a calendar.  Dustin’s end product looks like this:
Interworks Calendar
I wanted something that looked more like a true calendar.  I did so utilizing some of the techniques I outlined recently for creating a heat map, but also adding in some of the suggestions by Joe Mako.  The end result, if you follow the tutorial below, will look like this:

image

Ok, let’s get to it.

Step 1 – Create a list of dates in Excel and open the data in Tableau.

image

Step 2 – Right-click drag the Date field onto the Column shelf and choose the MY(Date) discrete format

image

Your view should look like this:

image

Step 3 - Right-click drag the Date field onto the Column shelf and choose the WEEKDAY(Date) discrete format

image

Your view should look like this:

image

Step 4 - Right-click drag the Date field onto the Row shelf and choose the WEEK(Date) discrete format

image

Your view should look like this:

image

Step 5 – Clean up the view a bit by right-clicking on the Date label and choosing Hide Field Labels for Columns

image

Step 6 – Right-click on the WEEK(Date) pill on the Rows shelf and uncheck Show Header

image

Your view should look like this:

image

We’re getting close! 

Step 7 – Right-click drag the Date field onto the Text shelf and choose DAY(Date)

image

Step 8 – Align the Text to the top right, center the header for the WEEKDAY(Date (copy) field, re-size the view a bit and we now have a beautiful calendar.

image

Ok, sweet, we have something that looks exactly like a calendar, but so what?  This doesn’t tell us anything. 

Consider that you want to see the profit ratio for your sales (or any other metric) displayed on each day as a color.  This is where data blending comes in handy. 

Step 9 – Connect to the Superstore Sales data source (or any other data you want to use, as long as it has a date field)

You might ask at this point why I used a separate data source for the calendar dates when a Date field exists in the Superstore Sales data.  The reason is quite simple.  The Superstore Sales data does not have sales for every day.  Therefore I will not see the Day labels on each of the boxes.  For example, if there are no sales on January 13, 2009, then the 13 label on that day will be blank.

Step 10 – Create the data blending relationships.  Go to the Data menu and choose Edit Relationships.  You will need to create these Custom relationships:

image

Step 11 – Create a calculation for Profit Ratio by right-clicking on any field and choosing Create Calculated Field

image

Step 12 – Drag the Profit Ratio measure onto the Color shelf

Step 13 – Change the Mark Type to Square

Step 14 – Set the size to its maximum

image

That’s it!  You must admit this is pretty cool. 

Note that Tableau defaults positive and negative colors to the Red-Green palette; you might want to change it for those color blind folks out there (and to keep Steve Wexler off your back).

If you want to take it a couple steps farther, you could show the quick filter for the MY(Date) field, create a parameter to allow for any of several metrics to be chosen, and on an on to make it a truly interactive analysis.

In the version embedded below, I changed the color palette to Red-White-Green so that those days without any sales would be white instead of gray.

Try this with your own data.  I bet your users will find this incredibly useful, especially as a performance monitoring tool.

November 28, 2011

Tableau Tip: Adding dynamic Top X labels in 9 easy steps (add Bottom X for even more goodness)

4 comments

There a good chance you’ve run into this scenario before, maybe in a past life in Excel or with Tableau:  You have a chart with a bunch of bars or columns or maybe a line chart, and you want the top 5 values labeled.  Ideally, the chart would look something like this:

image

With Tableau, you can manually assign labels to these points, but wouldn’t it be better for the points that are labeled to change dynamically based on the data you have selected?  There’s no easy way to do this in Tableau, but as always, there’s a workaround that’s quite simple once you implement it once or twice.

Be patient as you read your way through this; it might seem a bit complicated, but I’ll detail every step.  Let’s get started.

1. Drag the Order Date dimension onto the Columns shelf, right-click on the pill and choose All Values (This changes the Order Date field from a Discrete dimension to Continuous; not a critical step, simply personal preference)

image

2. Drag the Sales measure onto the Rows shelf (I’ve filtered the Order Date to 2010 only, but that’s not necessary either)

image 

3. Create a parameter, I named mine Top X, with the following properties:

image

NOTE: I could have chosen to always label the top 5 or top 10 values, but I want the consumers of the dashboard to be able to select the number of values they want to see labeled, thus the need for a parameter.

4. Right-click on the “Top X” parameter and choose “Create Calculated Field…”  Name the field “Top X Label” and enter this formula:

IF INDEX()<=[Top X] THEN SUM([Sales]) END

I’ll explain the need to use the INDEX function in a bit.

5. Right-click on the “Top X” parameter and choose “Show Parameter Control”

6. Drag the Top X Label calculated field (from step 4) onto the Label shelf on the Marks card.

image

7. Here comes the trick: Right-click on the Top X Label measure and choose “Edit Table Calculation”

image

8. In the Table Calculation dialog box, change the Compute Using option to Advanced

image

9. In the Advanced window, change the Order Along settings to the Sum of Sales Descending.  This will force the Top X Label field to index the values based on Sales from highest to lowest (thus the reason the calculated field compares to the INDEX() function).

image

That’s it!  The top 5 points are now labeled. You’re chart should look like this:

image

You can use the Top X parameter to pick the number of values you want to label.  Even if you filter the data, maybe to only show the East Region, the labels will still work properly.

But this is Tableau, so let’s take it a step farther.  Maybe you need to label the top 5 and the bottom 5.  There’s a neat little way to do this too.

1. Duplicate the Top X parameter and rename it Bottom Y and the show the Bottom Y parameter control

2. Duplicate the Top X Label calculated field, update it to reference the Bottom Y parameter and rename it to Bottom Y label:

IF INDEX()<=[Bottom Y] THEN SUM([Sales]) END

So now what?  There’s no way to add a second label!  True, but there IS a way to add a secondary axis.

3. Drag Sales onto the Rows shelf, right-click on it and choose Dual Axis

image

4. Remove “Measure Names” from the color shelf (we don’t need different colors since we’re using the same measure twice)

image

5. On the Marks card, click on the carrot on the upper-right of the card and choose Multiple Mark Types

image

6. Click the right arrow twice until you see “SUM(Sales) (2)”, then drag the Bottom Y Labels calculated field onto the Label shelf

image

7. Right-click on the Bottom Y Labels field, choose Edit Table Calculation, then repeat steps 8 & 9 above.  The only difference is that the advanced table calculation should be in ascending order for the Bottom Y Labels:

image

You’re done!  You now have an interactive chart that allows the user to pick the number of top and bottom values they want to see.  Interact with it, download it and see how it works for yourself.

Finally, I would like to thank Joe Mako for his help in walking through this situation.  He helped me with the formula and advanced table calculation for the Top X Label field.