DATA HAWK
  • portfolio
  • Projects
    • National Day
    • 12 Days
  • blog
  • favorites
  • about

Set action drill-through

10/30/2018

4 Comments

 
Devs on stage was awesome! While many things caught my eye, as someone who has hacked together click-and-drill dashboards using traditional Tableau actions, I immediately wanted to recreate the tree map click-and-drill demo. Soooo, let’s do it.
Turns out it is not as difficult as one may expect, and it requires only two calculated fields and two sets. Best of all, it requires no LOD calcs.
In this case, we are going to build a tree map based on superstore data that drills from Category > Sub-category > Product. We will use the category field as it appears in the data because it is at the highest level.

1)  Create a set based on the category field.
 
2)  Create a calculated field that tests what is in the set above: If the category matches the value in the set above, return the sub-category otherwise return category.
      Once a category has been selected on the dashboard, it changes the level of detail for only the select category (the one in the set) to        sub-category – “drilling-down.”
      CALC: IF [Cat Set] then [Sub-Category] ELSE [Category] END

3)  Create a second set on the new dynamic subcategory field
 
4)  Create the second calculated field which tests two conditions:
  • If both sets are true, return the product name otherwise return NULL.
  • If the result is NULL return the first calculated field, otherwise return the result from step one.
      CALC: IFNULL(if [Cat Set] and [SC Set] THEN [Product Name] END,[Dynamic SubCat])

5)  Now create a worksheet with Category, Dynamic SubCat and Dynamic Product in the details.
Picture
6)  Add the worksheet to the dashboard and add 2 Set Actions to run on select and remove all values from set when cleared. The first set action will address the Cat Set and the second the SC Set.
 
Optional: You can add dynamic product to labels, but ensure you keep the order on your marks card Category > Dynamic SubCat > Dynamic Product (label).

​You are set -- drill away! Let me know if you have questions.
4 Comments
Shin Murakami
10/31/2018 12:28:59 am

Thank you, I figured it out.

Sihn

Reply
Deepak Rai
11/1/2018 01:37:04 am

Good Job!!!

Reply
Ray
11/4/2018 09:33:42 pm

Nothing happens when I click a category..?

Reply
Nick
8/15/2019 10:39:00 am

Any way to make it so that when you click on a category, that the other categories go away and the view is filled by whatever you have clicked?

Reply



Leave a Reply.

    Author

    Corey Jones  | @coreyj34
    Data Viz Enthusiast 
    Philadelphia Area
    ​coreyjones012@gmail.com


    Archives

    December 2018
    November 2018
    October 2018
    January 2018
    June 2017
    April 2017
    December 2016
    November 2016
    September 2016
    July 2016

    Categories

    All
    Instructional

    RSS Feed

Powered by Create your own unique website with customizable templates.
  • portfolio
  • Projects
    • National Day
    • 12 Days
  • blog
  • favorites
  • about