Creating a colored treemap using colormix

Treemaps were originally designed by Ben Shneiderman, a professor of Computer Science at the University of Maryland. They are a very effective way of displaying hierarchical data. Within QlikView, the basic implementation of the Treemap, using the size of the rectangles to encode a value, can be effectively rendered by using the block chart.

If you want to encode a secondary measure, you can use a color function such as colormix1, along with an advanced aggregation statement.

In this recipe, we are going to compare sales values using the size of the rectangles and average order size using color.

Getting ready

Load the following script:

LOAD * INLINE [ Country, City, Sales, Orders USA, San Diego, 24567, 546 ...

Get QlikView for Developers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.