In Data Visualization on
April 10, 2017

Workout Wednesday Week 12: Highlight Treemap

Another week (working backward) and another #WorkoutWednesday I was sure I’d solve. The challenge for week 12 was to allow for a highlight within a treemap. Initially didn’t seem all that practical, but seeing the power of this – with the user able to select/highlight within the treemap – I may end up using this one.

A little bit of fumbling around and I nearly had it. I was left with this:

So I had successfully determined how to allow the user to ‘highlight’ within the treemap – but it was not within the right dimension – it was another dimension and therefore a standalone portion of the visualization, not within the visualization.

Finally, after a lot of ‘try this – try that – try this again’ and I got it. I needed to change the Highlight calculated field (using the parameter control) to Attribute – wrapping it with ATTR.

ATTR() is one of those items I’ve learned – 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.

ATTR() is defined by Tableau as “[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.” 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 – and therefore no longer partitions by this dimension! Try it out for yourself.

 

Andy Kriebel indicated he found three ways to solve it. How did you do it?

For me, onward … to week 11.

Previous Post Next Post

Leave a Reply

You may also like