{"id":99,"date":"2017-04-10T00:45:48","date_gmt":"2017-04-10T00:45:48","guid":{"rendered":"https:\/\/www.datahasbyte.com\/blog\/?p=99"},"modified":"2017-04-10T00:45:48","modified_gmt":"2017-04-10T00:45:48","slug":"workout-wednesday-highlight-treemap","status":"publish","type":"post","link":"https:\/\/www.a-j-c.com\/welcome\/2017\/04\/10\/workout-wednesday-highlight-treemap\/","title":{"rendered":"Workout Wednesday Week 12: Highlight Treemap"},"content":{"rendered":"<p>Another week (working backward) and another <a href=\"https:\/\/twitter.com\/search?q=WorkoutWednesday\">#WorkoutWednesday<\/a> I was sure I&#8217;d solve. The challenge for <a href=\"http:\/\/www.womanindata.co.uk\/2017\/03\/workout-wednesday-week-12-highlight.html\">week 12<\/a> was to allow for a highlight\u00a0<em>within<\/em> a treemap. Initially didn&#8217;t seem all that practical, but seeing the power of this &#8211; with the user able to select\/highlight within the treemap &#8211; I may end up using this one.<\/p>\n<p id=\"jXGbLrV\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-155 size-medium\" src=\"https:\/\/www.a-j-c.com\/wp-content\/uploads\/2017\/04\/img_58eeeb00248da-193x300.png\" alt=\"\" width=\"193\" height=\"300\" srcset=\"https:\/\/www.a-j-c.com\/wp-content\/uploads\/2017\/04\/img_58eeeb00248da-193x300.png 193w, https:\/\/www.a-j-c.com\/wp-content\/uploads\/2017\/04\/img_58eeeb00248da.png 408w\" sizes=\"auto, (max-width: 193px) 100vw, 193px\" \/><!--more--><\/p>\n<p>A little bit of fumbling around and I nearly had it. I was left with this:<\/p>\n<p id=\"Wwoibzn\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-100 size-medium\" src=\"https:\/\/www.a-j-c.com\/wp-content\/uploads\/2017\/04\/img_58ead275915cb-300x186.png\" alt=\"\" width=\"300\" height=\"186\" srcset=\"https:\/\/www.a-j-c.com\/wp-content\/uploads\/2017\/04\/img_58ead275915cb-300x186.png 300w, https:\/\/www.a-j-c.com\/wp-content\/uploads\/2017\/04\/img_58ead275915cb.png 572w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>So I had successfully determined how to allow the user to &#8216;highlight&#8217; within the treemap &#8211; but it was not within the right dimension &#8211; it was another dimension and therefore a standalone portion of the visualization, not\u00a0<em>within<\/em> the visualization.<\/p>\n<p>Finally, after a lot of &#8216;try this &#8211; try that &#8211; try this again&#8217; and I got it. I needed to change the Highlight calculated field (using the parameter control) to Attribute &#8211; wrapping it with ATTR.<\/p>\n<p>ATTR() is one of those items I&#8217;ve learned &#8211; and then forgotten what it actually did. My use of it would inevitably come from a moment of need, and trying different things within Tableau to get it to work.<\/p>\n<p>ATTR() is defined by Tableau as &#8220;[r]eturn(ing) the value of the given expression if it only has a single value for all rows in the group, otherwise it displays an asterisk (*) character.&#8221; Great. Makes sense. But why did this solve the conundrum for me? Well, not only does ATTR() return a single value in this case, it converts the dimension to a label &#8211; and therefore no longer partitions by this dimension! Try it out for yourself.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/public.tableau.com\/views\/WorkoutWednesday2017Week12\/Dashboard1?:showVizHome=no&amp;:device=tablet&amp;:embed=true&amp;:toolbar=no&amp;:tabs=no\" width=\"420\" height=\"725\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<p>Andy Kriebel <a href=\"http:\/\/www.womanindata.co.uk\/2017\/03\/workout-wednesday-week-12-highlight.html#top-comment\">indicated<\/a> he found three ways to solve it. How did you do it?<\/p>\n<p>For me, onward &#8230; to week 11.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another week (working backward) and another #WorkoutWednesday I was sure I&#8217;d solve. The challenge for&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[15,19],"class_list":["post-99","post","type-post","status-publish","format-standard","hentry","category-viz","tag-tableau","tag-workout-wednesday"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}