Creating a Treemap

Treemaps are useful for representing hierarchical (tree-structured) data as a part-to-whole relationship. It shows data as a set of nested rectangles, and each branch of the tree is given a rectangle, which represents the amount of data it comprises. These can then be further divided into smaller rectangles that represent subbranches, based on its proportion to the whole.

We can show information via the color and size of the rectangles and find out patterns that would be difficult to spot in other ways. They make efficient use of the space and hence can display a lot of items in a single visualization simultaneously.

Getting ready

We will create a Treemap to show the sales and profit across various product subcategories. Let's see how to create a Treemap.

How to do it…

  1. We will first create a new sheet and rename it as Treemap.
  2. Next, we will drag Sales from the Measures pane and drop it into the Size shelf.
  3. We will then drag Profit from Measures pane and drop it into the Color shelf.
  4. Our Mark type will automatically change to show squares. Refer to the following image:
    How to do it…
  5. Next, we will drop Sub-Category into the Label shelf in the Marks card, and we will get the output as shown in the following image:
    How to do it…

How it works…

In the preceding image, since we have placed Sales in the Size shelf, we are inferring this: the greater the size, the higher the sales value; the smaller the size, the smaller the sales value.

Since the Treemap is sorted in descending order of Size, we will see the biggest block in the top left-hand side corner and the smaller block in the bottom right-hand side corner.

Further, we placed Profit in the Color shelf. There are some subcategories where the profit is negative and hence Tableau selects the orange/blue diverging color.

Thus, when the color blue is the darkest, it indicates the Most profit. However, the orange color indicates that a particular subcategory is in a loss scenario.

So, in the preceding chart, Phones has the maximum number of sales. Further, Copiers has the highest profit. Tables, on the other hand, is non-profitable.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.153.212