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

Labeling a pie chart to replace the legend


Standard pie charts in QlikView suffer from a legendary problem – the legend. The problem is that the eye needs to move back and forth between the chart and the legend to help make sense of the data.

In this recipe, we are going to remove the legend and use the Dual function to replace it with text besides each segment that identifies the information.

Getting ready

Load the following script:

LOAD * INLINE [
    Country, Sales
    USA, 1000
    Mexico, 600
    Canada, 700
    UK, 900
    Germany, 800
];

How to do it…

These steps show you how to label a pie chart to replace the legend:

  1. Create a pie chart with Country as the dimension. Add the following expression:

    =Dual(
      if(Len(Only(Country))>0, Country, 'Others')
      & chr(10) & Num(Sum(Sales), '#,##0')
      ,Sum(Sales)
      )
  2. On the Expression tab, label the expression as Sales $ and turn on the Values on Data Points option.

  3. On the Sort tab, turn on the Y-Value option.

  4. On the Presentation tab, turn off...