QlikView for Developers Cookbook
上QQ阅读APP看书,第一时间看更新

Using containers as an alternative to multiboxes

Multi Boxes have been around in QlikView for a long time. They can be a useful way of adding many selectors to the layout when there is little room for a lot of listboxes.

They can be presented either in the default, lateral mode, with the drop-down list across from the label, or in Grid Mode, with the drop-down list underneath the label.

I used Multi Boxes for many years and quite liked the Grid Mode style. However, there was a major problem. Unfortunately, the Grid Mode style is not supported in the AJAX ZFC web client.

Since Version 10 of QlikView, I have moved away from Multi Boxes and instead use a container control with listboxes. I believe that it is a much better way of accessing many fields in a small form factor.

Getting ready

Load the following script:

LOAD * INLINE [
    Country, Product, SalesPerson, Category, Sales
    USA, Widget, Joe, Widgets, 1234
    USA, Woggle, Joe, Widgets, 1983
    USA, Brogue, Jane, Footwear, 1175
    USA, Clog, Jane, Footwear, 1376
    UK, Widget, Tom, Widgets, 954
    UK, Woggle, Tom, Widgets, 953
    UK, Brogue, Tom, Footwear, 989
    UK, Clog, Tom, Footwear, 875
    Japan, Widget, Mike, Widgets, 1265
    Japan, Woggle, Mike, Widgets, 1345
    Japan, Brogue, Jane, Footwear, 1425
    Japan, Clog, Jane, Footwear, 1324
];

How to do it…

To implement a container as an alternative to a Multi Box, follow these steps:

  1. Add listboxes to the layout for the four dimensions – Country, Category, Product, and SalesPerson.
  2. Add a Container object to the layout. Don't add any objects using the Properties dialog, and just click on OK.
  3. Drag each of the listboxes into the container.
  4. Edit the properties of the container. On the Presentation tab, change the Appearance to Tabs to the right.
  5. On the Caption tab, set the Title Text to Selections.

How it works…

Containers are a really useful type of object because they can contain any other object, including other containers.

Many people have seen them used to display several charts, but forget other possible uses such as this one. I pretty much use this for every QlikView document that I create.