Currently (July 2013), the #1 most-voted-for Idea for Tableau is Dynamic Parameters. Here, I’ll show you a technique for using Tableau data blending to create a dynamic, data-driven “parameter”. We’re going to use a loosely coupled secondary data source to get the information associated with the “parameter” and return that information to the primary data source, where it can be used in further calculations. Some examples of where this can be useful:
Choose one value to build a comparison to other values, such as finding the distance from a chosen origin city to a set of destination cities, or a market basket-type analysis where we want to compare one against others.
Set the limits and input data to an algorithm that is then used to create other results, for example to get a starting set of data to use to build a projection, such as an executive retirement forecast model.
Read on for a description of the technique and demos of all three options!
When one data source has subcategory & measures, and another has category & subcategory, can use Primary Groups to effectively create the category within the first data source. KB has article on this, search for “creating primary groups from a secondary source”.
Last week I’d promised to explain why the solution for identifying whether All items in a Tableau Quick Filter were selected wouldn’t work under certain circumstances in Tableau version 8, here it is, and along the way I’ll explain why COUNTD(Customer Name) could be red and the “Cannot blend the secondary data source because one or more fields use an unsupported aggregation.” warning message.
This post on the Tableau forums led me to figure out a new trick with Quick Filters. The goal is to know whether a Quick Filter has (All) Customers selected or some subset of Customers, then return a different measure based on that flag. Just to make it a little more fun, we want this calculation to work when there are other filters present, or not, to look something like the following view based on the Superstore Sales data:
An update: Looks like this one is a bug… Tableau guru-to-the-gurus Joe Mako noted in the comments below that this behavior doesn’t occur for strings or numbers. I’d thought I’d seen this with other data types, but I was wrong. I’ve submitted this to Tableau tech support and updated the post, I’ll do another update when I hear back from Tableau.
I’ve got at least a couple more posts in the queue about various features of Tableau version 8 blending. Here’s how to run into one undocumented feature:
Date dimension(s) in the primary and secondary have the same name, or a defined relationship(s) in the Relationships window.
The date dimension(s) from the primary is/are in the view.
The data will blend using those date dimension(s), regardless of whether the link icon is on or off.