7 Replies Latest reply on May 24, 2017 7:35 AM by Remmy Kinyanjui

# Way to sort treemap cells?

Simple question; is there a way to sort treemap cells other than by their size?

Say I wanted to keep the cells the same size, but push those with a negative sales value to the bottom right. Can't see to get this to work.

Ideas welcome.

• ###### 1. Re: Way to sort treemap cells?

I played around and concur - I cannot see any way to sort the treemaps as provided... Maybe an entry for the ideas forums?

• ###### 2. Re: Way to sort treemap cells?

If the marks are the same size, then they aren't a treemap. You can set up some sort panel chart or trellis chart with square cells and sort the items in that.

Jonathan

• ###### 3. Re: Way to sort treemap cells?

And even if they are the same size (min([1]) then you still can't sort them in way other than the default.

• ###### 4. Re: Way to sort treemap cells?

I definitely would like to sort the cells by a measure other than size

• ###### 5. Re: Way to sort treemap cells?

I definitely would like to sort the cells by a measure other than size

I'm guessing there's a question that you have for your data that you're thinking a new chart type (since sizing & sorting by the same measure is intrinsic to treemaps) would answer. What's the question, and what's the data like? Someone here on the forums could likely help you build a viz that enables you to get that answer.

Jonathan

• ###### 6. Re: Way to sort treemap cells?

There is an idea for this now

https://community.tableau.com/ideas/6198

Vote Up !!

• ###### 7. Re: Way to sort treemap cells?

I found a work around to sort values in a tree map.

It occurred to me that If i sorted the tree map using a calculated field (e.g. min (1) or max(1)) I would get the squares to be the same size. Then the sorting was done based on the alphabetic asc.

To get the squares to sort how I wanted them, I created a calculated field e.g.

CASE Product

WHEN 'Chairs' then '  Chairs' -->I added a two spaces before the word 'Chair'

WHEN 'Tables' then ' Table' -->I added a one space before the word 'Table'

WHEN 'Other' then ' Other' -->I did not add a space

END

The effect of this is that it will sort the double spaces first, then the single space, then the rest.

I hope that works for you.