Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
QlikView for Developers Cookbook

You're reading from   QlikView for Developers Cookbook Take your QlikView training to the next level with this brilliant book that's packed with recipes which progress from intermediate to advanced. The step-by step-approach makes learning easy and enjoyable.

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher Packt
ISBN-13 9781782179733
Length 290 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Stephen Redmond Stephen Redmond
Author Profile Icon Stephen Redmond
Stephen Redmond
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

QlikView for Developers Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Charts 2. Layout FREE CHAPTER 3. Set Analysis 4. Advanced Aggregations 5. Advanced Coding 6. Data Modeling 7. Extensions 8. Useful Functions 9. Script 10. Improving Performance 11. Security Index

Using redundant encoding with a scatter chart


It is very typical to display values for categorical dimensions using a bar chart. This is a very powerful and simple way to understand a chart. The length of the bars models the values in a very intuitive way.

Sometimes, however, it can be valuable to add an additional level of encoding to gain additional insight.

In this example, we are going to add space as an additional encoding. We can do this using a scatter chart.

Getting ready

Load the following script:

LOAD * INLINE [
    Country, Sales
    USA, 100000
    UK, 60000
    Germany, 50000
    France, 45000
    Canada, 30000
    Mexico, 20000
    Japan, 15000
];

How to do it…

Use the following steps to create a scatter chart demonstrating redundant encoding:

  1. Create a new scatter chart.

  2. Add a calculated dimension with the following expression:

    =ValueList(1,2)
  3. Deselect the Label and Show Legend options for this dimension.

  4. Add Country as the second dimension.

  5. On the Expressions tab, add two expressions:

    Sum(Sales)
    If(ValueList(1,2)=1, 0, Sum(Sales))
  6. Both expressions can be labeled as Sales $:

  7. On the Sort tab, select the Country dimension and turn on the Expression option. Enter the expression:

    Sum(Sales)
  8. The direction should be Descending.

  9. Go onto the Axes tab and select Hide Axis under the X Axis options.

  10. On the Numbers tab, format both expressions as Integer.

  11. Click on Finish.

  12. The chart displays with apparent bars and spacing between them. We can quickly see how much bigger the gap is between the USA and other countries. We can also identify clusters of similarly performing countries.

How it works…

If a scatter chart has two dimensions, it will change from displaying bubbles to displaying lines between the values in the first dimension.

The first expression here positions where the bars will exist. It is our space encoding.

The second expression has a test to see if it is ValueList = 1, which sets a value of 0, or ValueList = 2, which sets the Sales $ value.

There's more…

This is an example of the use of pseudo dimensions using ValueList. This can be a very powerful function in dimensions.

The more frequent first dimension of a multidimensional scatter chart would be a date dimension, such as a year. This gives you the option to show lines going from year to year. Additional options in Presentation allow such items as arrows.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image