Now that we have finished the first iteration of our analysis sheet, it is time to start creating the new Dashboard sheet. As was defined before, we will need to visualize the following KPIs and metrics:
As we want to have a consistent interface throughout our sheets, let's first set up the new sheet and common objects by following these steps:
Dashboard
and click on OK to close the dialog.Now, when we switch between the Dashboard and Analysis tabs, we can see that the surrounding listboxes, current selection box, buttons, and bookmark object remain consistent; only the contents in the center area of the screen will differ from one tab to the other.
When we created the Dashboard sheet in the previous exercise, we used the Paste Sheet Object as Link command instead of Paste Sheet Object to paste the copied objects to the new sheet.
The difference between these two options is that using Paste Sheet Object creates a copy of the object, which is independent of the source object. The Paste Sheet Object as Link option, on the other hand, creates an additional instance (or linked object) of the source object. Any changes made to the layout properties of a linked object will be applied to all other linked objects, with the exception of size and position.
When the same object is used in many different places, such as listboxes that appear on every sheet, using linked objects can make maintenance a lot more convenient.
Drag and drop to copy or create linked objects
Objects can also be copied or linked by dragging and dropping.
To copy an object, hold down the Ctrl key while clicking on the object's caption and drag the object. A small green plus sign on your cursor will indicate that you are copying an object. Release the mouse cursor on an empty space on the worksheet to create a copy.
Creating a linked object works very similarly to copying an object. Hold down Ctrl + Shift while clicking on the object's caption. A small chain icon on your cursor indicates that you are linking an object. Drag and release the mouse cursor on an empty space on the worksheet to create the linked object.
Of course, we can also create copies or linked objects on sheets other than the source sheet. To do this, instead of dragging the object to an empty space on the worksheet, drag it to the tab corresponding to the target sheet. The object will appear in exactly the same position as the source object, but on the other sheet.
Let's see how linked objects work by following these steps:
Copy
.Linked Object
.The result shows the difference between copied and linked objects. Changes that were made to the copied Carrier Name listbox have not been applied to the original, while changes that were made to the linked Aircraft Group object were also applied to the original. In fact, they have even been applied to the Aircraft Group listbox on the Analysis sheet as well.
Let's undo the changes we've made by pressing Ctrl + Z until we are back to the original layout.
After our little detour on linked objects, let's start building the dashboard by adding three gauge charts, one showing a global indicator of Load Factor %, the second showing Performed vs Scheduled Departures ratio value, and the third showing the Air Time % value.
Load Factor %
as the name of the chart and click on Next.Sum ([# Transported Passengers]) / Sum ([# Available Seats])
Load Factor %
.0.5
and 1
respectivelyWhen selected, the Autowidth Segments function automatically sizes the segments based on the Min
and Max
values of the gauge. We want to avoid this as we want to set the values ourselves.
We should now have four segments and will set up each of the four segments is in the following manner:
0.5
255
; G:0
; B:0
) and the Second Color option set to Orange (R:255
; G:128
; B:0
)0.625
255
; G:128
; B:0
) and the Second Color option set to Yellow (R:255
; G:255
; B:0
)0.75
255
; G:255
; B:0
) and the Second Color option set to Light Green (R:128
; G:255
; B:128
)0.85
128
; G:255
; B:128
) and the Second Color option set to Green (R:0
; G:255
; B:0
)In these steps we configured the gauge to display values from 50 to 100 percent. Within this range we defined four separate segments, each with their own color. You may have noticed that we only set the lower boundary for each segment; this is because the upper boundary is automatically defined by the lower boundary of the following segment, or by the upper boundary of the gauge. In our example, Segment 1 runs from 50 to 62.5 percent (although we specified the limits in decimal form, that is, 0.5 and 0.625), Segment 2 covers the area ranging from 62.5 to 75 percent, and so on.
Let's continue setting up our gauge.
The result should be the following gauge chart:
As at this point it's hard to see what exact number the chart is presenting, we'll add a Text in Chart attribute to show the corresponding result value using the following steps:
=Num (Sum ([# Transported Passengers]) / Sum ([# Available Seats]), '##.#%')
The expression we just created calculates the Load Factor % value and formats it as a percentage using the Num()
function. Let's finish the text.
Initially, the added text will be placed at the upper-left corner of the object and we'll need to relocate it. To do that, follow these steps.
This will show a red border line around the text we want to move as well as around the other chart components (that is, the chart area itself, the legend, if any, and the title).
One final adjustment we are going to make to this chart is to remove the caption bar and border and to make the background of the chart fully transparent. To do this we use the following steps:
The end result should be a gauge chart that looks like this:
Since we have already created a gauge chart with several specific configurations, let's make use of it to create a new one without having to do the whole process over again.
Right-click on the gauge chart we created previously and click on the Clone option. A new copy of the object will be created exactly as the previous one; the only thing we will need to do is re-position it and change its expression and title, as well as the text in the chart.
Right-click on the new cloned object and select Properties… to make the following changes:
Performed vs Scheduled
.Sum([# Departures Performed]) / Sum([# Departures Scheduled])
Performed vs Scheduled
.1.2
=Num(Sum([# Departures Performed]) / Sum([# Departures Scheduled]), '##.#%')
The final gauge that we will be creating is the Air Time %. Now that you have seen how to create a new gauge and how to clone an existing one, take a chance and see if you can create this gauge yourself:
Air Time %
.Sum ([# Air Time]) / Sum ([# Ramp-To-Ramp Time])
1
.After applying the changes and rearranging the objects, our dashboard should look like this:
While we selected the default speedometer look for our three gauges, QlikView has a few other styles as well. These styles can be selected from the Styles tab of the Chart Properties dialog.
The following screenshot shows, pictured from left to right and top to bottom, a speedometer, vertical speedometer, thermometer, traffic light, horizontal thermometer, and digital digit gauge. These objects are included in this chapter's solution file on the Gauge Styles tab.
Now that we have added the gauges, it is time to add the following four metrics:
To display these metrics, we will be using Text Objects. A text object can be used to display a static or calculated text and, somewhat counter-intuitively, images as well.
Let's follow these steps to create the first text object that will display Enplaned Passengers:
=Num(Sum ([# Transported Passengers]) / 1000000, '#,##0.00')
Transported passengers (millions)
.After some resizing, the resulting object should look like the following screenshot.
Looking at the steps we went through to create this text object, you may have noticed a few things:
=
(equal to) sign. This is to tell QlikView to treat the entered text as an expression and evaluate it accordingly, instead of treating it as a static text.Num()
function to properly format the expression output.Now that we have created the first text object, take a few minutes to create the remaining three. Remember that you can press Ctrl and drag the mouse pointer to copy an object, so you do not have to create each text object from scratch. The caption's display and expressions are shown in the following table.
Caption |
Expression |
---|---|
Departures performed (in thousands) |
=Num(Sum ([# Departures Performed]) / 1000, '#,##0.00')
|
Revenue Passenger Miles (in millions) |
=Num(Sum ([# Transported Passengers] * Distance) / 1000000, '#,##0.00')
|
Available Seat Miles (in millions) |
=Num(Sum ([# Available Seats] * Distance) / 1000000, '#,##0.00')
|
After creating all four text objects, position them under the gauges in the following manner:
As we said at the start of this section, a text object can also be used to display an image. For example, we may want to display a small "warning" icon on our Enplaned Passengers text object whenever the amount of passengers is lower than 1 million. We can achieve that by following these steps:
Airline OperationsDesign
folder and select the warning.gif
image file.One thing to make note of is the Layer setting. By setting it to Top, we ensure that the icon is always superimposed over the Transported passengers (millions) text object. This is important, otherwise we will not be able to select it using the mouse. Furthermore, if we hadn't set the 100% transparency in the Transported passengers text object, having the icon in a lower layer would prevent it from being visible to the user.
The current result is almost what we want. However, you'll notice that the icon is displayed, even though there are more than 1 million transported passengers, which is the specified limit. Let's take a moment to fix it by using the following steps:
Sum([# Transported Passengers]) < 1000000.
Now the warning icon will only be shown when the specified condition is met; that is, when the number of transported passengers is lower than 1 million. To test it, you can make a few selections, for example, by selecting the year 2011 and Piston, 1-Engine/Combined Single Engine from the Aircraft Group.
Adding these type of visual cues to our dashboard will make it easier for the users to spot potential issues.
Another interesting feature of the Text object is that we can assign actions to it, essentially making it function as a button.
We could use this button-like functionality to allow for quick navigation across the document. For example, a text object could be used to switch to a detail sheet when a user clicks on it from a general-level dashboard. In the next example, we will assign an action that will open the Analysis sheet when a user clicks on one of the text objects:
SH_Analysis
and click on OK to close the dialog.SH_Analysis
. Click on OK.Now, whenever the user clicks on one of the text objects, the Analysis sheet will be automatically activated. Note that instead of the sheet's name we used the Sheet ID to refer to the Analysis sheet. As explained earlier, object IDs are used internally to reference objects.
Gauges can h ave actions assigned to them as well, using the Actions tab of the Properties window. A typical use case for this is to let the user drill down to a detailed view for a single KPI or metric. For example, we could create a detailed sheet specifically for the Load Factor % metric to analyze it from many different angles (over time, by airline, and so on.) and then reference it from the corresponding gauge chart.
The final metric that we want to display on our dashboard is Market Share. This metric is based on the number of enplaned passengers per carrier, relative to the total. We will use a Pie Chart to visualize this measure. Let's follow these steps:
Sum([# Transported Passengers])
The result should look like the following screenshot:
You will notice that this does not look like a pie chart at all. Maximizing the chart to full screen does show the pie, but it is unusable this way. The reason for this is that there are simply too many dimension values; with hundreds of airlines the chart looks more like a candy-cane than a pie.
As the goal of this chart is to display who the big players on the market are, we will modify the chart so that it will only show the airlines that make up 50 percent of the market. All other airlines will be grouped in an Others group.
Follow these steps:
The updated pie chart should look like the following screenshot:
We now see that there are actually only five airlines that, put together, account for 50 percent of transported passengers. Also note that the amounts are shown as a percentage, even though the expression we used returns an absolute number (amount of passengers transported). This is because we have set the Relative checkbox on the Expressions tab, which makes QlikView automatically calculate the relative amount versus the total amount for each slice.
The Dimension Limits option we have used to achieve this is a very useful feature that was introduced in QlikView 11 and enables us to control the number of dimension values handled by a chart.
In the Dimension Limits window, all dimensions available in the chart are listed to the left. Simply highlight the desired dimension to which the Dimension Limits configuration should apply to and select any of the following settings to control the number of dimension values displayed:
The difference between the second and the third options is that the former evaluates the individual result corresponding to the dimension's value, while the latter evaluates the cumulative total of that value by either sweeping from largest to smallest or vice versa. This can be used, for instance, in a Pareto analysis in which we would present all carriers that make up the 80 percent of the flights, leaving all the rest out.
Additional options can be set when working with dimension limits:
You may have noticed already that this option is not only found on pie charts but on all charts, with the exception of the gauge chart and pivot tables.
While looking at the pie chart we created, you may notice that it is somewhat inconvenient to have to switch between the pie slices and the legend to see which slice represents which carrier. Fortunately, there is a little "hack" that we can apply to place the labels on the data points as well. Follow these steps:
if(count(distinct [Carrier Name]) = 1, [Carrier Name], 'Others')
Carrier
and enable the Values on Data Points option.While we're at it, let's apply some extra styling:
Now the carrier names, along with their respective market share, are shown directly on the pie slices. Since there is no need for a legend anymore, we have disabled it. The expression that we used: if(count(distinct [Carrier Name]) = 1, [Carrier Name], 'Others')
uses a conditional function to check if the current slice corresponds to a single carrier by counting the distinct number of carrier names (count(distinct [Carrier Name]) = 1
). If the count equals one, the carrier name is used; if not, it must mean that we are looking at the "others" slice of the pie, so the "Others" label is applied. Our finished dashboard should now look like the following screenshot:
We've now finished the dashboard sheet. We re-used quite a few objects from the Analysis sheet, and added gauges, text objects, and a pie chart. Besides creating new objects, we were also introduced to linked objects, actions, and dimension limits.
Let's move on to the last sheet, the Reports sheet.