Working with listboxes

Currently, our QlikView document contains the following listboxes in the Dashboard sheet:

  • Carrier's Operating Region
  • Carrier Group
  • Flight Type
  • Aircraft Group
  • Year
  • Quarter
  • Month

Let's see how we can add listboxes and change their properties.

Adding listboxes

Lets add another listbox representing the Carrier Name field by right-clicking on the worksheet and selecting Properties… (or by pressing Ctrl + Alt + S, which is the shortcut for the Settings | Sheet Properties menu command). Next, open the Fields tab, locate the Carrier Name field under the Available Fields list, and click on Add > to add it as a new listbox.

Tip

Many routes lead to Rome

To add an object to a worksheet, there are three basic methods: using the menu, using the toolbar, or using the pop-up menu:

Menu: By selecting Layout | New Sheet Object

Toolbar: By using the design toolbar

Adding listboxes

Pop-up: By right-clicking on a blank space within the worksheet and choosing the desired object from the New Sheet Object submenu

The examples throughout this book will use a different method each time, but of course you are free to choose your preferred method.

In a moment we will discuss the positioning of the objects we are adding, but for now let's add another listbox, this time using a different method:

  1. Right-click anywhere on the sheet and select New Sheet Object | List Box.
  2. Select Aircraft Type from the Field drop-down list.
  3. Click on OK to close the dialog window.

The List Box Properties dialog

Besides the default settings, there are quite a few other options that can be set for listboxes. In this section, we will review the most common of these options. Right-click on any listbox and select Properties… to open the List Box Properties dialog window.

Note

While the customization of the listboxes' appearance is quite flexible, one of the options that cannot be changed, at least not out-of-the-box, are the colors used to identify selections. Green always means selected, while white and gray mean associated and excluded values respectively.

The General tab

As the name implies, the General tab contains general options for the listbox. Notable options are:

  • Title: This option is used to set the Title label to be different from the default field name. The Title label can also be set based on a calculated value.
  • Object ID: While the title shows the pretty-print frontend name, the Object ID option contains the name under which the listbox is known to QlikView. This ID can be used to reference the listbox from other QlikView objects.
  • Always One Selected Value: This checkbox is only available when a single value is selected at the time we open the Properties dialog. This option locks the listbox so that it can only have one value selected at any given time.
  • The Show Frequency and In Percent checkboxes: These options are used to display the absolute number of times that each value appears in the active data set. When In Percent is checked, the relative number of appearances versus the total is shown.

The Expressions tab

The Expressions tab lets us add calculations and mini charts into listboxes, for example, adding the number of departures to the Carrier Name listbox by using the expression Sum([# Departures Performed]). The following screenshot shows the Carrier Name listbox with an expression in place:

The Expressions tab

The Sort tab

The Sort tab is commonly found across many objects. It offers the option to order the data using any of the following sort orders, outlined in descending order of priority:

  • State: This option sorts values based on the selection state of the items. Ascending will put all selected or associated items at the top, followed by all non-selected items. Descending performs the opposite sorting. Auto Ascending puts all selected items at the top, but only if the listbox is not big enough to show all of the values at the same time. If all of the values are visible, no sorting has been performed.
  • Expression: This option sorts the values based on the result of an expression. For example, we could sort carrier names based on the number of departures they have performed.
  • Frequency: This option sorts the values based on how often the value appears in the dataset.
  • Numeric Value: This option sorts the values based on the numeric values of each item.
  • Text: This option sorts the values based on the alphanumerical representation of each item.
  • Load Order: This option sorts the values based on the order in which the items were loaded into QlikView.

The Presentation tab

The Presentation tab lets us change some of the presentation aspects of the listbox. Some of the important options are as follows:

  • Selection Style Override: This option allows for some (limited) variations on the selection style. For example, it's possible to replace the green background on selected items with a checkbox.
  • Single Column: This option forces QlikView to use only a single column to list the corresponding field values, even if space is available for multiple columns.
  • Suppress Horizontal Scroll Bar: When values are longer than the width of a listbox, a horizontal scroll bar is automatically created. Checking this option prevents that from happening.
  • Fixed Number of Columns: When the Single Column checkbox is deselected, this option can be used to set a fixed number of columns for the listbox.
  • Order by Column: When this option is checked, sorting is performed by column, instead of by row.
  • Alignment: This option is used to set the alignment of Text and Numbers within the listbox.
  • Wrap Cell Text: This option wraps text over multiple lines (as set in the Height input box). This can be useful for lengthy instances of text that need to be completely visible.

    Tip

    Suppress Horizontal Scroll Bar

    Now might be a good time to suppress the horizontal scroll bar on the Carrier Group, Aircraft Group, Aircraft Type, and Carrier Name listboxes.

The Number tab

Like the Sort tab, the Number tab is used by many different objects. It allows us to control how the listbox content looks by using either predefined or custom formats. For example, if we always want numbers to be displayed with two decimals, we can follow these steps:

  1. Check the Override Document Settings checkbox.
  2. Select the Fixed to radio button.
  3. Enter 2 in the Decimals input box.

By clicking on the Change Document Format button, a dialog is opened that lets us set the default number format for every individual field at the document level. This means we will only need to specify the format once, and it will be used everywhere within our document. This option is also available via the Document Properties dialog window (Settings | Document Properties | Number).

The Font tab

The Font tab is also a common one, and its purpose is very straightforward. We already worked with these properties earlier in the chapter while changing the caption font.

The Layout tab

Just as with the others, the Layout tab is also one that is used for nearly every object in QlikView. As the name suggests, it allows us to set various layout options.

The different properties available through this tab are directly affected by the document styling mode (Simplified or Advanced). The Advanced styling mode adds more options for styling borders and enables the possibility for rounded corners to be set.

Note

Since the Advanced styling mode is more comprehensive, this section assumes the Advanced styling mode is turned on.

Important options on this tab are as follows:

  • Use Borders: This checkbox is used to enable/disable the object's border.
  • Shadow Intensity: This option selects whether a shadow effect should be added to the object, and if so, specifies its intensity.
  • Border Width: This option sets the width of the border, when enabled.
  • Rounded Corners: This checkbox is used to set whether rounded corners should be used. By (de)selecting individual corners, we can specify which corners should have a rounded effect.
  • Layer: This option is used to establish the ordering to be used when multiple objects are overlapping. In case of complex, overlapping objects, a Custom layer can be used. In this case, higher numbers overlap lower numbers.
  • Apply To…: This option is used to apply the current format to other objects. We used this function before to apply the same caption layout to every object in the document.
  • Theme Maker and Apply Theme: This option stores the current format in an external theme file. This file can then be used to apply the same format to objects in other documents.
  • Show: This option allows us to either always show the object, or to apply a condition which must be fulfilled for the object to be shown. An example of this would be to use the expression GetSelectedCount([Aircraft Group]) = 1 to the Aircraft Type listbox so that it is only visible when a single aircraft group is selected.
  • Allow Move/Size: Deselecting this option locks the object's size and position.
  • Allow Copy/Clone: Deselecting this option prevents the object from being copied.

The Caption tab

The Caption tab is also a common tab across all QlikView objects. We used it before to set the listbox caption colors and fonts, but it contains a few other interesting options:

  • Multiline Caption: This option wraps the caption text over the number of lines defined through the Caption Height field.
  • X-pos, Y-pos, Width, and Height: While it is easier to just drag, align, and size objects using the mouse, these options let you define the size and location of an object with pixel-level precision. These options can be set for both the Normal and the Minimized state of the object.
  • Caption Alignment: This option defines how the display text is aligned in the caption.
  • Special Icons: This option adds icons to the caption which perform specific actions. An example of these icons would be the one used to send the chart's data to Excel. It is not advisable to add too many icons as this may clutter the interface. When many icons are needed, it is better to select only the Menu icon. This option creates an icon that shows a drop-down menu with all of the available actions.
  • Allow Minimize and Auto Minimize: The Allow Minimize option enables an object to be minimized. This setting will add a minimize icon to the caption, much like the one on a regular Windows window. When Auto Minimize is also marked, different objects with this setting enabled can be interactively and alternately switched between the restored and the minimized states. This means that, when restoring a minimized object, another currently restored object will be automatically switched to the minimized state for the new object to take its place.
  • Allow Maximize: This option enables an object to be maximized. It adds a maximize icon to the caption, in the same style as in a regular Windows window.
  • Help Text: This option adds a question mark icon to the caption that, when clicked, will show a pop-up message with the entered help text. The Help Text option can contain calculated expressions as well.

This concludes the side-step into the various listbox properties. Don't worry if you didn't memorize all of them at first, we'll encounter them often enough in the rest of the book.

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

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