Qlikview Shared Dimension Charts a la Tableau (*With FREE Multi-Expression Trellis Chart!)
As promised in my recent ‘Upcoming Chart Types Inspired by Tableau’ post this is a detailed ‘How To’ for one of the shown chart types / techniques; displaying several charts with a shared Dimension. The original post can be seen here: http://qvdesign.wordpress.com/2012/02/29/upcoming-new-qlikview-chart-types-inspired-by-tableau
I’m sure a good number of you will already know how to do this; even from just seeing the chart it’s fairly simple to guess…but if you don’t then don’t worry just ready on to be informed.
I’m sure Tableau weren’t the first people to create this type of chart but it’s where I first noticed it via the Tableau Demo Depot: http://demodepot.tableausoftware.com/workbooks
I’m a fan of this as it makes efficient use of space without loosing too much if any clarity so my natural thought was to recreate it in Qlikview – just as many if not all Tableau charts can be recreated with a little thought & effort. My end result is below and without bragging too much I think it looks better than the original…the Tableau version will probably be deployable out of the box.
The first thing you should be thinking should be ‘Isn’t that just an amended Trellis Chart?’ and the swift answer would be ‘No’ but the more useful one would be; ‘No, because…’. Let’s look at what we can achieve with a Trellis chart from the same dataset (This could be useful in its own right). Firstly we need to do something a Trellis can’t ordinarily do; show different expressions in each ‘pane’ – usually it’s a different Dimension value in each, here we’re taking Sales, Volume and Average Unit Price. This is achieved via my old friend ‘valuelist()’ in that we use it in a Calculated Dimension to create a Synthetic Dimension (‘Sales’, ‘Vol’ & ‘Avg’) which drives the creation of the Trellis’ pane’s. However the problem with using a Trellis as a solution even with valuelist() is that a) the Dimension Legend is still shown 3 times when we only need it once and more importantly: b) the Y-Axis scale is set for the largest requirement (that of Sales) meaning that ‘Avg’ is barely visible (This is one of the major flaws of the traditional Trellis implementation as not all dimensions are close in value meaning some are lost in the way ‘Avg’ has been here):
Now, there may be a way to amend the Axis via an expression and hide the Dimension Legend and add it back in again via a listbox but as yet I’ve not found it…so on to my solution.
The basic ‘How To’ is best illustrated by the following image:
It’s as easy as that; we’re just using 3 separate charts and one Text Object to group them all together – simple but in my view; effective. There are of course some adjustments that have to be made to achieve the effect as best as it can be so read on.
- Layer up correctly – the Text Object providing the border should be set to the lowest layer (Properties > Layout > Layer) as we still want to interact with the charts.
- Remove the Dimension Legends for the 2 right hand charts (Properties > Dimension > Settings for Selected Dimension).
- I’ve added the axis labels as ‘Text in Chart’ to allow a bit more flexibility.
- You may need to use Ctrl+Shift to adjust the size of the charts to get them to line up correctly with the left hand charts Dimension Legend.
- Setting the borders to be thin and square makes lining things up neatly much easier.
- Ensure the Sort Orders are the same for all 3 charts.
As for expressions it’s as simple as it could be; each has a Dimension of ‘Product’ and then the relevant Expression: eg: sum(Sales) – literally nothing more complex than that. As all 3 charts are based on the same dimension they stay perfectly aligned even when selections are made and thus always give the appearance of a unified chart.
This is very much one of those implementations where if it’s done correctly users won’t even notice it’s any different from a standard 3 chart implementation but for me that makes it no less useful. It creates a really unified, efficient ‘chart’ that maximizes the available screen real-estate and preserves the clarity of information by allowing for separately scaled axis.
You can of course push things a bit further:
Here we’re showing Distribution Dots and a 100% Bar Chart across the shared Product Group dimension, I’ve used Persistent Colors to ensure the legend from the left hand chart applies to the right as well.
It’s a bit of a workaround solution but it’s not at all time consuming or difficult; this example took less than 5mins to put together from scratch and it achieves the desired subtle, efficient result admirably.
***UPDATE: As Chris points out in the Comments below; if you’re using Version 11 then you can achieve a similar effect by placing the 3 seperate charts in a Grid Container Object, this will make the alignment much easier.
A copy of the .qvw can be downloaded via the following link so you can poke around the settings and properties for yourself: https://docs.google.com/open?id=0B0nQ9tZcY4wzOFVncTVzWHBzMmc
The same principals can also be applied to Line Charts as in this solution I recently put together in answer to a query.
The .qvw for this can be downloaded here: https://docs.google.com/open?id=0B0nQ9tZcY4wzeHBLUDI5ZHZqSTQ
I hope it’s of use.
As always; all the best,