Monday, June 24, 2013

Creating Fast Navigation Buttons in Tableau

Today, we will talk about how to create fast navigation buttons in Tableau.  In most cases, navigation is quite easy to do by simply using the tabs.  However, if you have a very large workbook or are using a mobile device, such as an iPad, the tabs can be difficult to work with.  Let's look at an alternative.  As usual, we will use the Superstore Sales sample data set in Tableau.

Step 1:
  • Create some dashboards
Step 2:
  • Create the following text file
Portal Text File
Step 3:
  • Create a Tableau Extract using this text file.
Portal Connection
Step 4:
  • Connect directly to the extract
Portal Extract Connection
Step 5:
  • Create the following calculated field in the "Portal" Data Source
Dashboard 1 Portal
Step 6:
  • Drag it onto the Label Shelf of a Blank Sheet
  • Format it however you would like
Dashboard 1 Portal Sheet
Step 7:
  • Drag it onto Dashboard 2
  • Add the following filter action
Dashboard 1 Portal Action
Now you have a navigation button that takes you to another dashboard.  While this method takes up more processing time than using the tabs, it is a useful alternative when tabs are not a viable option.  The main processing issue with method is that the sheet must execute a query and compute the visualization.  However, executing a query against a one-element extract and computing a text table are the fastest possible processes.  We hope you found this informative.  Thanks for reading.

Brad Llewellyn
Associate Consultant
Mariner, LLC
llewellyn.wb@gmail.com
https://www.linkedin.com/in/bradllewellyn

Sunday, June 16, 2013

Creating Waterfall Charts in Tableau

Today, we will talk about how to create waterfall charts in Tableau.  A waterfall charts is a good tool for seeing how sequential processes contribute to the whole.  It is very similar to a stacked bar, albeit with a different twist.  Here is a sample we pulled from Google.

Sample Waterfall Chart
For this, we created a sample checking account statement in Excel.  Here is a snippet of it.  In case you were wondering, this is fictitious and in no way reflects the statement of ourselves or anyone that we know of.

Row ID Date Description Amount Daily Posted Balance
2 4/2/2013 Direct Deposit $485.00 $1,596.56
3 4/2/2013 Rent ($804.74) $791.82
4 4/4/2013 Food ($16.00) $775.82
5 4/4/2013 Car ($374.43) $401.39
6 4/5/2013 Cable ($34.23) $367.16
7 4/8/2013 Direct Deposit $1,598.75 $1,965.91
8 4/8/2013 Gas ($39.56) $1,926.35

Step 1:
  • Create a Negative Amount calculation
  • Create the following calculation
Negative Amount
Step 2:
  • Drag MONTH( [Date] ), DAY( [Date] ) and [Row ID] to the Columns Shelf
  • Drag [Daily Posted Balance] to the Rows Shelf
  • Drag [Amount] to the Colors Shelf, play with it if you choose
  • Drag [-Amount] to the Size Shelf
  • Drag [Description] and [Date] to the Details/Tooltip Shelf
Waterfall Chart
Now, we can see a simple representation of our account balance throughout the month.  However, what if your data set doesn't contain a nice [Daily Posted Balance] field.  Have no fear, you can recreate it using table calculations.  Obviously, we would lose the ability to see the start balance, but that's a topic for another post.

Step 1.5:
  • Create a Running Sum of Amount
  • Create the following calculation
Balance
Step 2:
  • Create the same chart as before, using [Balance] instead of [Daily Posted Balance]
  • Also, you will need to place [Description] and [Date] on the Tooltip Shelf this time
Waterfall Chart (with Running Sum)
Look familiar?  It should because it is the same exact chart we just saw, except that we now start at 0 instead of ~1100.  Depending on how your data looks you may have to slightly alter the way you approach this.  There are a ton more cases where you can use Waterfall Charts.  We hope you found this informative.  Thanks for reading.

Brad Llewellyn
Associate Consultant
Mariner, LLC
llewellyn.wb@gmail.com
https://www.linkedin.com/in/bradllewellyn

Monday, June 3, 2013

Top N% Filters in Tableau

Today, we will talk about Top N% Filters in Tableau.  In our opinion, there are two types of Top N% Filters.  These are showing the top N% of Customers by Profit or the Customers that correspond to the top N% of Sales.  To our knowledge, neither of these features are built-in to Tableau, yet they can be easily achieved using calculated fields.  As usual, we will use the Superstore Sales sample data set in Tableau.

First, we will look at the Top N% of Customers.

Step 1:
  • Create a chart of Profit by Customer, sorted by SUM( Profit )
Profit by Customer
Step 2:
  • Create a parameter for the N% you want
  • Duplicate the parameter
    • We will use the 2nd parameter for the 2nd filter
Top N% Parameter
Step 3:
  • Calculate the Total Number of Customers
  • Create the following calculated field
Total Customers
For those of you who read this blog often, you will recognize this method.  It is an extremely simple method for executing a distinct count.  Basically, it adds 1 for each row of Customer.

Step 4:
  • Create a calculated field that returns true for customers less than or equal to the cut-off point.
  • Create the following calculated field
  • Add it to the filters shelf, filtering on "True"
Top N% Filter 1
Now, let's see if it works.

Profit by Customer (Filter 1)
As you can see, there are a lot less customers in this chart than the original.  You can play with the parameter to make sure it works.  Now, let's work on filtering Customers that correspond to the Top N% of Sales.  You might wonder why we don't just use Profit again.  Since, Profit can, and sometimes will, be negative, you will get funny results if you use this technique on it.  You are welcome to do it on your own to see.

Step 1:
  • Create a chart of Sales by Customer, sorted by SUM( Sales )
Sales by Customer
Step 2:
  • Calculate the Total Sales
  • Create the following calculated field
Total Sales
We could have used WINDOW_SUM() here, just like we did earlier.  However, we'd imagine that WINDOW_SUM() is slower than TOTAL(), so we used TOTAL() here, primarily because this is exactly what TOTAL() is meant for.

Step 3:
  • Calculate the Running Sum of Sales
  • Create the following calculated field
Running Sum of Sales
Step 4:
  • Calculate which Customers are above the threshold
  • Create the following calculated field
  • Add it to the Filters Shelf, filtering on "True"
Top N% Filter 2
Now, let's see the results.

Sales by Customer (Filter 2)
As you can see, calculated fields are very powerful when it comes to creating custom filters.  I hope you found this informative.  Thanks for reading.

Brad Llewellyn
Associate Consultant
Mariner, LLC
llewellyn.wb@gmail.com
https://www.linkedin.com/in/bradllewellyn