Book Image

QlikView for Developers Cookbook

By : Stephen Redmond
Book Image

QlikView for Developers Cookbook

By: Stephen Redmond

Overview of this book

QlikView has been around since 1993, but has only really taken off in recent years as a leader in the in-memory BI space and, more recently, in the data discovery area. QlikView features the ability to consolidate relevant data from multiple sources into a single application, as well as an associative data model to allow you to explore the data to a way your brain works, state-of-the-art visualizations, dashboard, analysis and reports, and mobile data access. QlikView for Developers Cookbook builds on your initial training and experiences with QlikView to help you become a better developer. This book features plenty of hands-on examples of many challenging functions. Assuming a basic understanding of QlikView development, this book provides a range of step-by-step exercises to teach you different subjects to help build your QlikView developer expertise. From advanced charting and layout to set analysis; from advanced aggregations through to scripting, performance, and security, this book will cover all the areas that you need to know about. The recipes in this book will give you a lot of the information that you need to become an excellent QlikView developer.
Table of Contents (19 chapters)
QlikView for Developers Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a box plot chart for a simple data set


Box plot charts, or box and whisker charts, are often used for displaying statistical mean and quartile information.

This can be useful for seeing how a value ranges across categories by visualizing the median, the twenty-fifth and seventy-fifth percentile, and the outlying values.

With a simple data set, it is easier to create the chart manually than using the wizard that QlikView provides—although there is a slightly strange sequence of actions to go through a "funny"—that you need to know about.

Getting ready

Load the following script:

LOAD * INLINE [
    Country, Value
    USA, 12
    USA, 14.5
    USA, 6.6
    USA, 4.5
    USA, 7.8
    USA, 9.4
    UK, 11.3
    UK, 10.1
    UK, 3.2
    UK, 5.6
    UK, 3.9
    UK, 6.9
];

How to do it…

There is a "funny" in here because you have to tell the chart properties that you are using a box plot, then click on OK and then go back in and edit the properties. Here's how you do it:

  1. Create a new combo chart. Select Country as the dimension.

  2. When the expression editor pops up, just enter 0 as the expression. It doesn't really matter what you enter, you just need to enter something.

  3. Deselect Bar and select Box Plot. At this stage, just click on Finish. Your chart will come up with No Data to Display—this is not a problem.

  4. When you go back into editing the expression properties, you will find five new subexpressions. Enter the following expressions for each of them:

    Box Plot Top

    Fractile(Value, .75)

    Box Plot Bottom

    Fractile(Value, .25)

    Box Plot Middle

    Fractile(Value, .5)

    Box Plot Upper Whisker

    Max(Value)

    Box Plot Lower Whisker

    Min(Value)

  5. Add two new expressions:

    Max(Value)
    Min(Value)
  6. For the two new expressions, deselect the Line option (or Bar if it is selected) and select the Symbol option. Select Circles from the Symbol drop-down menu:

  7. On the Presentation tab, turn off Show Legend. Set the Symbol Size option to 3 pt:

  8. Check that the box plot looks like the following screenshot:

How it works…

The five separate values define the different portions of the box plot:

Top

The top of the box

Bottom

The bottom of the box

Middle

The median value, the line in the box

Upper Whisker

The upper outlier value

Lower Whisker

The lower outlier value

There's more…

This recipe is for when you have a simple set of data and you are looking for the statistics across all of the data.

In QlikView, we can have much more control of the values in the box plot, especially where we want to look at averages and percentiles of aggregated data.

As well as box plots, within the combo chart settings there is also a Stock option, which allows us to specify the minimum, the maximum as well as an open and close value.

See also

  • The Using the wizard to create a box plot chart recipe