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:
5) Now create a worksheet with Category, Dynamic SubCat and Dynamic Product in the details.
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
|
AuthorCorey Jones | @coreyj34 Archives
December 2018
Categories |