Creating a Dynamic “Parameter” With a Tableau Data Blend

Embed Size (px)

Citation preview

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    1/29

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    2/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 2

    used in further calculations. Some examples of where this can be useful:

    Choose one value to build a comparison to other values, such as ᠔nding 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 executiveretirement forecast model.

    Read on for a description of the technique and demos of all three options!

    Process for Creating the Dynamic “Parameter”

    Here are the 7 major steps for putting this together:

    1. Set up your primary (main) and secondary (parameter) data sources.

    2. Build whatever calculated ᠔elds from the secondary that need to be used in in the primary.

    3. Create a “Blend Field” with a value of 1 in both your primary and secondary. This is necessary

    to stop the “Fields cannot be used from the [secondary] data source…” error:

    4. Build the initial view in the primary.

    5. Add the necessary ᠔lter(s) from your secondary data source. There are a few steps to this:

    a. Drag the ᠔ltered dimension from the secondary onto the Filters Shelf.b. Choose the Select from List radio button.

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-10_04_42-Tableau-dynamic-parameter-from-blend-v5.pnghttp://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-09_34_25-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    3/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 3

    c. Click OK to close the Filter dialog.

    d. Click on the pill on the Filters Shelf and choose Quick Filter.

    e. On the Quick Filter, edit the Quick Filter settings as necessary, for example to make it a

    single select ᠔lter, and choose one of the options. Depending on your view, it may change

    radically here and look totally wrong. The next step will solve that.

    6. Turn on the relationship for the Blend Field, and turn o  the relationships on as many ᠔elds

    in the secondary as you need, which is probably all of them except for the Blend Field.

    7. Finish setting up the view.

    8. If you have multiple worksheets for a dashboard, you can set up scoped or global ᠔lters.

    Demonstration #1: Choosing a Customer and Showing Prot & Sales for

    Customers within X% Sales of Selected Customer

    This is a totally made-up scenario using Superstore Sales to do a market basket analysis. Here, we’re

    picking a particular customer, ᠔nding out their sales, then showing every other customer that has sales

    within X% of the selected customer. Here’s the view:

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    4/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 4

    There are a few other ways we could go about this, such as:

    Using a parameter to identify the customer. This would have to be updated every time

    there’s a change in the list of customers.

    Putting the basket creation logic into Custom SQL or custom queries. This depends on skills thatnot all Tableau users have.

    Data blend and table calculations. This is powerful, but complicated and potentially the

    slowest option. Also depends on skills that not all Tableau users have.

    This is how I set this up the data blend for a dynamic “parameter”:

    1. For this example, I used Superstore Sales and simply duplicated the data source to make the

    secondary source of Customer Names. In practice, I’d probably use a separate data source that

    ✓   ✓   ✓

    Sales RangeExec Retirement Forecast ModelDistance from SelectedSales Range WorkoutExec Retirement Forecast WorkoutDistance from Selected Workout

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    5/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 5

     just had the names and sales to reduce the size of the secondary source (in other words, use the

    minimum number of dimensions and measures).

    2. In Superstore Sales, I built the following calculations in the primary data source:

    Sales for Selected – This is the sum of sales from the secondary

    Sales Range Filter – Used to ᠔lter the customer list based on the % dierence, using a

    “Sales Range from Selected Customer” parameter.

    IF (ABS(SUM([Sales]) ‐ [Sales for Selected])/[Sales for Selected])

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    6/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 6

    5. Now to add the quick ᠔lter on the Customer Name from the secondary source. Once I choose one

    customer, there’s now only one mark in the view:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-10_08_09-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    7/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 7

    This is because Customer Name exists in both data sources and Tableau is automatically linking

    the two dimensions. So…

    6. In the secondary data source, turn on the relationship for the Blend Field, and turn o  the

    relationship on Customer Name:

    You will now see all the marks again, as in the view from step 3 above.

    7. To ᠔nish up this view, I put the Selected Customer ᠔eld on the Color Shape, and Size Shelves, put

    the Sales for Selected Customer on the Level of Detail Shelf, put the Sales Range Filter on the

    Filters Shelf ᠔ltering for non-Null values, edited the title and added a couple of reference lines:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-10_16_50-Tableau-dynamic-parameter-from-blend-v5.pnghttp://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-10_12_38-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    8/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 8

    And there you have it, a completely dynamic view with no SQL necessary, and the only table calculation

    is to give us some extra information in the worksheet title.

    Demonstration #2: Executive 401(k) Retirement Forecasting Model

    This example comes from a scenario where I was helping another Tableau user to build a retirement

    calculator for executives, where based on some data about each executive and some choices a scenario

    would be built of what their particular 401(k) and assets would look like. Here’s a simpli᠔ed

    reproduction of one of the views:

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    9/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 9

    ✓   ✓   ✓

    Sales RangeExec Retirement Forecast ModelDistance from SelectedSales Range WorkoutExec Retirement Forecast WorkoutDistance from Selected Workout

    1. Setting up the data. This example is a bit more complicated because of the data arrangement and

    the goals. In the main data, there is a row for each executive:

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    10/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 10

    To build the forecast, we’re using table calculations. Since table calculations require something to

    address over, we need a set of dates. Unlike set of dates need to be the primary data source. The

    reason why is that if we make the executive data the primary, it doesn’t have enough level of detail to

    show the individual dates from the secondary, and we see a bunch of asterisks:

    An alternative solution that would get rid of the asterisks would be to do a Cartesian aka cross

    product query of a set of dates for every executive. In that case, we’d have everything needed

    to do the view and could use a regular ᠔lter on the executive. However, Custom SQL isn’t

    everyone’s cup of tea, so we have this data blend solution as an alternative.

    Therefore, we make the dates primary, and executive data secondary, then use the dimension

    ᠔lter on the secondary to pull the information for a particular executive. This ability to ᠔lter a

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-10_32_23-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    11/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 1

    dimension in the secondary without needing a linking dimension in the primary is one of the most

    useful new additions to data blending in v8. For the date data, I used Joe Mako’s 2 row data source

    scaold technique. You can see his Think Data Thursday presentation on data scaolding for complete

    details, the short form is that we take a data source with two values, then assign dates to them (which

    can be dynamically calculated), then turn on domain padding in Tableau via the Show Missing Values

    option to ᠔ll in the dates in-between. So this:

    …is brought into Tableau, then with a [Years to Retirement] parameter and this calculated ᠔eld for

    the Date:

    CASE [Value]

    WHEN 1 THEN TODAY()

    WHEN 2 THEN DATEADD('year',[Years to Retirement],TODAY())

    END

    Becomes this in the view when using the YEAR(Date) aggregation:

     And then we turn on domain padding to ᠔ll in the missing years:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-12_18_55-Tableau-dynamic-parameter-from-blend-v5.pnghttp://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-12_13_18-Tableau-dynamic-parameter-from-blend-v5.pnghttp://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-10_28_16-Microsoft-Excel-executive-data.xlsx.pnghttp://community.tableausoftware.com/thread/126855?start=0&tstart=0

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    12/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 12

    And end up with this padded out set of years:

    Tableau’s domain padding occurs before the blended data is added, so we can use this padded source

    (no SQL required!) to blend in the executive data. For more details, see my earlier post on Blending

    Secondary Data into Primary without Linking Data in Primary. So that’s step 1 of the process. Here’s the

    rest:

    2. In the primary data source, I built out a set of parameters and calculated ᠔elds for the data. For

    example, the 401(k) Balance calc has the following formula, where the 401(k) Growth Rate and

    Annual Contribution are both parameters. The table calculations all have a Compute Using of the

    Date.

    IF FIRST()==0 THEN

    http://drawingwithnumbers.artisart.org/blending-using-show-missing-values/http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-12_19_13-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    13/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 13

      SUM([Executive Data (executive data.xlsx)].[Starting 401(k) Balance])

    ELSE

    PREVIOUS_VALUE(0)*(1+[401(k) Growth Rate])+[Annual 401(k) Contribution]

    END

    3. In both the primary and secondary, build the Blend Field with a value of 1.

    4. The initial view is just the padded out date. I work with this way for table calculations to get the

    addressing and partitioning right, then will duplicate the sheet later to create the ᠔nal view.

    5. Add the ᠔lter on the Executive Name from the secondary.

    6. Turn on Blend Field as a linking dimension.

    7. Add the table calculations, set their Compute Using’s and validate, add the parameter

    controls, build the title, etc. Once that was working, then I duplicated the worksheet and used

    those settings to build the ᠔nal view:

    Ok, so that’s a modeling application of data blending.

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-12_38_06-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    14/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 14

    Demonstration #3: Distance from Selected Origin City to Destination

    Cities

    This one is based on a Tableau forums thread from last week. The goal here is to allow the user to

    pick an origin city and return the distance (and potentially other data about) destination cities.

    There are a couple of other ways to go about this:

    Build a data source that has a row for every origin/destination pair with latitudes and

    longitudes for both, and potentially also pre-computed distances. This is the ultimately the

    most ᠬexible in terms of what can be done in Tableau, and requires the most eort and

    resources to set up.

    Use a parameter to select the city, then a table calculation to propagate the

    latitude/longitude for the selected city to all the other cities, then further table calculations to

    compute the distance. This was what I ᠔rst tried out, and Jim Wahl completed in the thread.

    The parameter would have to be updated any time new origins are added.

    Here’s the alternative: Use a secondary data source to select the origin city, then feed back the

    latitude/longitude of that for use in a dynamic distance calculation. With the computations

    happening as regular aggregates instead of table calculations, we can then take advantage of 

    global & scoped ᠔lters, and get some nice dynamic ᠔ltering, and will automatically update when

    new origin cities are added. This should be faster than the parameter-based solution, and has a

    smaller data storage footprint than the fully computed data source. Here’s the view:

    http://community.tableausoftware.com/thread/129361

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    15/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 15

    One more time through the 7 steps:

    1. I ᠔rst set up two data sources (one for origin and one for destination) to get the latitude and

    longitude of all the cities. Because we’re needing to compute a distance between the origin

    city and other cities, we can’t use Tableau’s built-in generated latitude and longitude.

    Here’s a nice little hack for using Tableau to get your latitude/longitude data: Build a map with

    the points you want, then use Worksheet->Copy->Data, then Ctrl+V to paste the data back into

    Tableau. Voila, instant geocoding!

    2. Then I created ᠔elds in the Superstore Sales primary to bring in the origin and destination

    latitude and longitude, and used a Great Circle Distance formula from the Tableau

    ✓   ✓   ✓

    Sales RangeExec Retirement Forecast ModelDistance from SelectedSales Range WorkoutExec Retirement Forecast WorkoutDistance from Selected Workout

    http://drawingwithnumbers.artisart.org/http://kb.tableausoftware.com/articles/knowledgebase/calculating-distance

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    16/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 16

    Knowledgebase to make a Distance calculated ᠔eld.And I created an Origin City Flag in the

    primary to identify the selected city for color & shape:

    IF MIN([State+City])==MIN([Origin GeoData].[State+City]) THEN

    "Origin"

    ELSE

    "Destination"

    END

    And here’s a State+City calc for the Origin data source to use for the ᠔lter:

    [State] + " ‐ " + [City]

    3. The next step is to create Blend Field with a value of 1 in both the primary and secondary

    sources.

    4. Now to build the initial view. From the primary, drag the City to the Level of Detail and

    Tableau will automatically include the State & Country and start a map:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-13_05_11-Tableau-dynamic-parameter-from-blend-v5.pnghttp://kb.tableausoftware.com/articles/knowledgebase/calculating-distance

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    17/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 17

    5. Now to add the ᠔lter from the secondary. Switch to the secondary data source, drag the

    State+City dimension onto the Filters Shelf and pick a city from the Filters dialog. The view will

    change to only the selected city:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-13_32_06-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    18/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 18

    6. Next, turn on the relationship for the Blend Field, and turn o  the relationships for

    Country/Region, City, and State:

    7. To build the rest of the view, I put Distance on the Filters Shelf and used an “At Most” ᠔lter so the

    users couldn’t ᠔lter out 0 distance and hide the origin city, then set it up to be a Quick Filter. Origin

    City went on Shape and Size, and Distance on Color:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-16_49_28-Tableau-dynamic-parameter-from-blend-v5.pnghttp://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-13_33_44-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    19/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 19

    To get the origin city to be red and the rest blue, I tried several dierent techniques such as

    multiple discretes on colors, dierent levels of detail, and dual axes, and all of them had their

    issues. Then I ᠔gured out I could use a diverging red/blue color palette. Because only the selected

    origin city has a distance of 0, I set the center of palette to 1, so the origin would be red and the

    rest of the marks shades of blue:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-16_44_04-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    20/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 20

    Then to demonstrate how we can use the the ᠔lter across worksheets, I set up another worksheet

    to be the title:

    http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/Screen-Shot-2013-08-02-at-12.29.42-AM.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    21/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 2

    Then those sheets could be laid out in a dashboard:

    Potential Issues and Complications

    There are a few rough spots with this technique that might aect you as you work with it:

    As you can see on the map above, there are some blue circles on top of the star. Because we’re

    using data from a secondary source, in some cases we can’t get the data (and therefore the

    marks) to sort and therefore layer the marks in the way that we might want.

    We also can’t control the sort of Quick Filters on the secondary the way we can for Quick Filters

    from the primary.

    Tableau always puts a Null value at the bottom of each Quick Filter from the secondary whether it

    is actually needed or not, this is because Tableau does not fully compare the domain of the ᠔lter

    from the secondary to the primary data source.

    If the primary and secondary have dates or datetime ᠔elds that have the same name and you are

    using those dimensions in the view, then the issue with linking ᠔elds I identi᠔ed in this post will

    crop up. You’ll have to manually turn o the relationships using Edit->Data Relationships.

    If you have additional linking dimensions turned on besides the manufactured Blend Field your

    results may not be what you might expect, due to how Tableau blending and ᠔lters interact. I

    hope to explore some of those details in a future blog post.

    If any of these potential issues are showstoppers, the workaround is to use dierent method, such as

    http://drawingwithnumbers.artisart.org/version-8-blending-version-7-blending-under-the-hood/http://drawingwithnumbers.artisart.org/wp-content/uploads/2013/08/2013-08-01-16_57_25-Tableau-dynamic-parameter-from-blend-v5.png

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    22/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 22

    building a scaold data source to use as the primary that has enough detail to enable the ᠔ltering and

    computation to occur in the scaold source.

    Conclusion

    This can be a useful technique when scaolding is not an option and a dynamic solution is needed for

    doing a comparison to other like with the map and similar customer views, or performing analgorithmic computation across a set of rows of data as in the executive retirement calculator. Thanks

    to Richard Leeke, Shawn Wallwork, and Joe Mako for their help at dierent times in putting this post

    together, and go forth and blend!

    Share this:

    This entry was posted in Tableau v8 - The Kraken, Tips and Techniques and tagged blending, data

    blending, ᠔ltering, ᠔lters, forecasting, maps, parameters on August 2, 2013

    [http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/] by

     Jonathan Drummey.

    4

      8

      1

       

    Like this:

     Like

    Be the first to like this.

    Related

    http://drawingwithnumbers.artisart.org/unexpected-results-aliases-in-url-parameters/http://drawingwithnumbers.artisart.org/unexpected-results-aliases-in-url-parameters/http://drawingwithnumbers.artisart.org/user-defined-functions-and-process-control-charts/http://drawingwithnumbers.artisart.org/user-defined-functions-and-process-control-charts/http://drawingwithnumbers.artisart.org/lod-expressions-and-custom-grand-totals-replacing-table-calculations-and-self-data-blends-with-lod-expressions/http://drawingwithnumbers.artisart.org/lod-expressions-and-custom-grand-totals-replacing-table-calculations-and-self-data-blends-with-lod-expressions/http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=email&nb=1http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=reddit&nb=1http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=pinterest&nb=1http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=linkedin&nb=1http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=google-plus-1&nb=1http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=tumblr&nb=1http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=facebook&nb=1http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/?share=twitter&nb=1http://drawingwithnumbers.artisart.org/author/Jonathan%20Drummey/http://drawingwithnumbers.artisart.org/creating-a-dynamic-parameter-with-a-tableau-data-blend/http://drawingwithnumbers.artisart.org/tag/parameters/http://drawingwithnumbers.artisart.org/tag/maps/http://drawingwithnumbers.artisart.org/tag/forecasting/http://drawingwithnumbers.artisart.org/tag/filters/http://drawingwithnumbers.artisart.org/tag/filtering/http://drawingwithnumbers.artisart.org/tag/data-blending/http://drawingwithnumbers.artisart.org/tag/blending/http://drawingwithnumbers.artisart.org/category/tips-and-techniques/http://drawingwithnumbers.artisart.org/category/tableau-v8-the-kraken/

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    23/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 23

    24 thoughts on “Creating a Dynamic “Parameter” with a Tableau Data Blend”

    This look cool and promising Jonathan! It’ll take awhile to digest. I was wondering why you’d gone forum

    silent, now I know. This was a lot of work. Thanks,

    –Shawn

    Thanks! I’ve mostly been quiet with working on my TCC presentation and summer play.

    Shawn Wallwork

    August 6, 2013 at 2:42 pm

     Jonathan DrummeyAugust 6, 2013 at 3:08 pm

    Post author

    Very helpful and already put to use Jonathan! Thank you for all the hard work.

    That’s great, and thanks!

    Patrick Van Der HydeAugust 8, 2013 at 10:22 am

     Jonathan Drummey

    August 8, 2013 at 10:50 am

    Post author

    Eric Chesebro

    https://www.facebook.com/patrick.vanderhyde

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    24/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 24

    Pingback: User De᠔ned Functions and Process Control Charts | Drawing with Numbers

     Jonathan,

    Thank you very much for this very in-depth and thorough representation of dynamic parameters. I was

    able to use your example to get exactly what I was looking for using version 8 of Tableau Public.

    Question … is Demo #3 able to be reproduced in version 6 or 7? I seem to be having issues with the

    data source linkings in 6 and 7 and am unable to reproduce in these versions.

    Thank you in advance.

    Eric

    Hi Eric,

    All three of the demos depend on the new feature in Tableau v8 where we can use a dimension ᠔lter on

    a secondary data source, so they won’t work in version 6 or 7. In version 7 and earlier, what Tableau

    showed as a dimension pill from the secondary on the Filters Shelf was really an ATTR() aggregate, so it

    would return * where there wasn’t sucient level of detail. The workarounds for v6 and v7 are to

    increase the level of detail in the primary (and potentially vastly multiply your data), or to use static

    parameters.

     Jonathan

    October 24, 2013 at 7:27 am

     Jonathan DrummeyOctober 24, 2013 at 12:42 pm

    Post author

    Nick Silhacek

     June 12, 2014 at 11:32 am

    http://drawingwithnumbers.artisart.org/user-defined-functions-and-process-control-charts/

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    25/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 25

    You mentioned that “in practice, I’d probably use a separate data source that just had the names to

    reduce the size of the secondary source.”

    My question is, how does the calculated ᠔eld “Sales for Selected” work, then? I was able to get

    everything but that to work using your suggested practice.

    Oops! Great catch, thanks! I think that might have been leftover from an earlier draft, I’ve updated the

    text to say use the customer name *and* sales, to have the minimum number of dimensions. There is

    an alternative using a secondary source with just the customer name and then a table calc to get the

    sales from the primary for the chosen customer, however that can run into issues with ᠔ltering (which is

    part of why I came up with this particular solution).

     Jonathan

     Jonathan Drummey

     June 14, 2014 at 9:27 am

    Post author

    Hi Jonathan – You can’t imagine how many times I’ve hit this page and downloaded this workbook. It is

    so helpful in so many situations. Just wanted to say thanks!

    You’re welcome! And to return an appreciation, I’m in the middle of designing a dashboard right now

    and I’m regularly thinking, “What would Kelly do?”

    Kelly

     June 19, 2014 at 1:11 am

     Jonathan Drummey June 19, 2014 at 6:22 am

    Post author

    http://vizcandy.ca/

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    26/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 26

    Pingback: Tableau Tips,Tricks,Best Practices - Calculation - Jenny (Xiao) Zhang

    Hi Jonathan,

    Appreciate the information you presented. I followed the ᠔rst one exactly like you presented (x% from

    selected customer), but Tableau does not allow me to create a quick ᠔lter on the secondary duplicated

    datasource by customer name. Am I missing something? Thanks.

    SumeshSeptember 12, 2014 at 8:37 am

     Jonathan,

    It actually worked after a few iterations of trial and error. I had to drop the customer name in the ᠔lter

    and from there I was able to create a quick ᠔lter. The only issue I am now seeing is that the quick ᠔lter

    has a null option in it and I have not been successful in removing it. Thanks.

    Unfortunately, Tableau always puts in a Null option on ᠔lters using dimensions from secondary sources.

    This is a “just in case” option for the situation where the primary source doesn’t have corresponding

    values in the secondary, Tableau doesn’t go the extra step to determine whether the primary and

    secondary have complete domains. Here’s the link to voting for this to change:

    http://community.tableausoftware.com/ideas/2847

    Sumesh

    September 12, 2014 at 9:17 am

     Jonathan DrummeySeptember 25, 2014 at 5:59 am

    Post author

    Alex

    February 16, 2015 at 12:26 pm

    http://drawingwithnumbers.artisart.org/http://community.tableausoftware.com/ideas/2847http://jennyxiaozhang.com/tableau-tipstricksbest-practices-calculation/

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    27/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 27

     Jonathan – Thanks, this is a great post – a year or two old and still going strong!

    Question: I have tried to replicate your example with my data (which is using campaigns instead of 

    customers). I followed the steps exactly as you wrote and have studied your workbook, but for some

    reason my viz is not displaying the “other” marks (in your example, the 143 other customers). It seems

    that since my secondary ᠔lter (Campaign Name) is on the Filters shelf, it is limiting the view to that

    speci᠔c campaign, which obviously defeats the purpose since I’m trying to show how this particular

    campaign stacks up against all other campaigns. This leads me to believe that my join might be

    incorrect, but I have double-checked it and found no dierence between your workbook and mine. Any

    thoughts on where I might be going astray?

    Best,

    Alex

    …and of course I ᠔gure it out as soon as I posted that (feel free to remove it). I was still linking on the

    Campaign ᠔eld in addition to the Blend ᠔eld. As soon as I removed the link to Campaign Name…voila!

    Thanks again for a great workaround to dynamic parameters.

    Alex

    Hi Alex,

    I’m glad you ᠔gured it out! I’m leaving the comment up because I think it’ll be useful to others, making

    sure the linking dimensions are exactly what you want (no more, and no less) is key to getting the data

    blend to return the desired values.

    Alex

    February 16, 2015 at 12:31 pm

     Jonathan DrummeyFebruary 16, 2015 at 6:27 pm

    Post author

    http://drawingwithnumbers.artisart.org/

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    28/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    http://dr awi ngwi thnumber s.ar ti sar t.or g/cr eati ng- a- dynami c- par am eter -wi th- a- tabl eau- data- bl end/ 28

     Jonathan,

    Since the Null option in the Quick Filter cannot be removed entirely or just moved to the bottom of the

    value list, is it possible to make the Quick Filter default to a non-Null value?

    I know the setting of a default value could be achieved in Tableau Server with the Remember My

    Changes feature but I was looking for a solution that could be applied prior to publishing.

    Thanks,

    If you have selected a ᠔lter option prior to publishing, it’ll stay in place when published.

    Hi Bobby,

    When we publish a workbook to Server each worksheet & dashboard each Quick ᠔lter for a discrete

    retains the values that were set when published, so that’s the “default”. I don’t know of another way to

    choose a speci᠔c value as the default.

    Bobby Weaver

    February 16, 2015 at 4:17 pm

     Jonathan

    February 16, 2015 at 6:24 pm

     Jonathan Drummey

    March 6, 2015 at 7:33 am

    Post author

    Chandra

    August 18, 2015 at 12:21 am

    http://vayaasystems.com/http://drawingwithnumbers.artisart.org/http://nowpapa.wordpress.com/

  • 8/18/2019 Creating a Dynamic “Parameter” With a Tableau Data Blend

    29/29

    4/14/2016 Creating a Dynamic “Parameter” with a Tableau Data Blend | Drawing with Numbers

    Pingback: Alteryx Newbie Creates Dynamic Parameters in Tableau First Day by Jonathan Drummey |

    DataBlick

    Hi Jonathan

    What if I were to ᠔nd out the Penetration of a Particular Item

    i.e. Countd of Order Id (for an Item or a set of Filters) / Countd of Order Id (Across a Category – No

    Filters Applied)

    How can I do this ?

    Chandra

    Hi Chandra,

    There are a few ways to do this, see http://www.theinformationlab.co.uk/2013/01/14/maintaining-

    percent-of-total-whilst-᠔ltering/ for a roundup (including my comment at the end).

     Jonathan

     Jonathan DrummeyAugust 30, 2015 at 2:51 am

    Post author

    http://drawingwithnumbers.artisart.org/http://www.theinformationlab.co.uk/2013/01/14/maintaining-percent-of-total-whilst-filtering/http://datablick.com/2015/08/30/alteryx-newbie-creates-dynamic-parameters-in-tableau-first-day-by-jonathan-drummey/