QlikView Viz Hodgepodge
by Speros Kokenes, on Dec 5, 2013 3:55:11 PM
Here is an assortment of random ideas I've been playing with in QlikView recently:
Visualizing Press Sizes
Imagine you produce cardboard. You want to visualize the different sizes of cardboard you can produce against the different size machine presses you have to make the cardboard. There are two ways to accomplish this.
The blue box is the press size and the red box is cardboard size.
The scatter chart approach plots the corners of the rectangles and draws the lines between them. This chart utilizes a valueloop() so that we can write an x-expression for each point and a y-expression for each point. The valueloop goes to 5 for this shape, since we want to draw all 4 corners and then close the gap. In order for this chart to scale correctly, we need the axes to be the same size, regardless of the dimension ratio of the plotted boxes. We can force the axes to be the same size by setting a static min of 0 and a static max of the biggest dimension. The rangemax() function can be used to figure out the longest dimension possible. In this example, we use
to determine the size of both axes.
Once this has been done once, you will need to size the object so that the axes are the same displayed length, which will create the appropriate scale regardless of what size cardboard or press is selected.
The downside to this approach is that you can't fill in the boxes with a solid color. That is one reason to use a bar chart instead.
The bar chart has the same constraints on the axes static min and max values as well as physically altering the object layout so that it is properly scaled. This chart requires that you use a continuous axis. While it appears that two boxes are drawn here, in reality there are over 100 bars being drawn here, with the gap between them disappearing as the chart is sized down. There are two expressions: 1 for the blue bars and 1 for the gray bars. The bars are set to stack. For this example, the blue bar represents the cardboard (called "Paper") and the gray represents the press (called "Base"):
Expression1 (Blue bar): =if(valueloop(1,BaseWidth)<=PaperWidth,PaperHeight,0)
Expression2 (Gray bar): =if(valueloop(1,BaseWidth)<=PaperWidth,BaseHeight-PaperHeight,BaseHeight)
Dark Crust, Light Filling
Sometimes when visualizing trend lines, you want to just see the line. Other times, you want to see the underlying area highlighted. Showing both at the same time, with colors adjusted appropriately, can produce a nice visual effect. This is not possible in a single chart as far as I can tell but it can be done by overlapping two charts:
Each of these graphs is really two charts that are overlaid:
The bottom chart rests on top and has a transparent background.
It is common to use dates as a dimensional value but what most people don't know is that you can format the expression axis of a chart as a date as well. QlikView does a surprisingly decent job of handling this, including auto-switching to month years, years, and decades as the scale gets bigger.
One application of a date formatted axis is the monitoring of a sequence of events, or phases. Imagine each event has a start date and an elapsed time taken to complete the event before proceeding to the next event. We can produce the following bar chart in QlikView:
In this sample data set, I use QlikView projects with 4 sequential phases: data extraction, data transformation, data modeling, and front end design (I wish it was that simple and sequential in reality). By using the start dates of the phases as bar offsets and the number of days spent on a phase as the length of the bars, I can visualize how time was spent from project to project over time. I also had to set a static min and max to utilize the entire area of the chart available; the auto min and max produced huge margins. I am not sure if this is related to the date formatting.