Tải bản đầy đủ

QlikView 11 for developers

www.it-ebooks.info


QlikView 11 for Developers

Develop Business Intelligence applications with
QlikView 11

Miguel García
Barry Harmsen

professional expertise distilled

P U B L I S H I N G
BIRMINGHAM - MUMBAI

www.it-ebooks.info


QlikView 11 for Developers
Copyright © 2012 Packt Publishing


All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the authors, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: November 2012

Production Reference: 1161112

Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84968-606-8
www.packtpub.com

Cover Image by Barry Harmsen (barry@qlikfix.com)

www.it-ebooks.info


Credits
Authors

Project Coordinators

Miguel García

Sai Gamare

Barry Harmsen



Anugya Khurana

Reviewers

Proofreaders

Ralf Becher

Joel Johnson

Steve Dark

Bob Phillips

Stephen Redmond
Indexers
Monica Ajmera Mehta

Acquisition Editors
Rashmi Phadnis

Rekha Nair

Joanne Fitzpatrick

Tejal Soni

Lead Technical Editor
Ankita Shashi
Technical Editor
Nitee Shetty
Copy Editors
Aditya Nair

Graphics
Aditi Gajjar
Production Coordinator
Nilesh R. Mohite
Cover Work
Nilesh R. Mohite

Alfida Paiva

www.it-ebooks.info


www.it-ebooks.info


Foreword
At QlikTech we often describe ourselves as "an American company with a Swedish
soul". We celebrate our roots in the delightful and urbane university town of Lund
in southern Sweden; indeed, the development teams who built QlikView are still
mostly based there. We power our business from our headquarters and major offices
in Philadelphia, Boston, and San Mateo.
Nevertheless, we have more than a Swedish soul and a US business; in fact the
QlikView community of customers, partners, and consultants is truly international.
To understand that scope, you need only look at the authors of this excellent new
book. Barry Harmsen is well known in the Netherlands as an independent Business
Intelligence consultant. He is undoubtedly a star of the QlikTech community. Miguel
García, from Mexico, has worked globally consulting on QlikView.
The sheer range of experience that Barry and Miguel bring to this book is one
of its most valuable qualities. Their examples are carefully thought out, and
very thorough; but they also take time to explain the business background to
their thinking.
At QlikTech we often say that QlikView is not so much a tool for Business
Intelligence as it is a platform for Business Discovery. This is not just a marketing
term: we do not want only something different to say. In fact, every day we see
customers making discoveries—finding new information and insights—with
QlikView.
A traditional BI report simply tells you what you already know and is packaged and
formatted to keep that knowledge up-to-date and share it easily. A typical dashboard
enables you to track key indicators and, with some good design, also "drill down" to
understand the details or trends underlying those indicators. But Business Discovery
does this and more. Business Discovery enables users to formulate new questions
and explore the answers and implications with very few restrictions.
From the very first chapter, Barry and Miguel show you exactly how this happens.
Here, they introduce the associative model that makes QlikView so powerful, along
with the clues in the user interface (look for the green, white, and grey) that make
this model easy to use.

www.it-ebooks.info


As they progress along a thoroughly practical path, the authors introduce you to
the mechanics of collecting data from sources. They guide you through numerous
techniques for transforming, modeling, and exploring this data. They provide practical
advice on best practices for security, visualization, and more complex analyses.
In short, for new developers, this is an excellent guide to get them started. For more
experienced users, the thoughtful examples and careful notes make this an excellent
companion in your work.
Donald Farmer,
VP Product Management, QlikTech.

www.it-ebooks.info


About the Authors
Miguel García is a Business Intelligence Consultant and QlikView Solutions

Architect from Monterrey, Mexico. Having worked throughout many successful
QlikView implementations, from inception through implementation, and performed
across a wide variety of roles on each project, his experience and skills range from
applications development and design, to pre-sales, technical architecture, system
administration, as well as functional analysis and overall project execution.
He currently holds the QlikView Designer and QlikView Developer Certifications,
backed by QlikTech, for versions 9, 10, and 11.

His passion for QlikView led him to create and host the iQlik's blog (http://iqlik.
wordpress.com). You can follow his blog updates via Twitter on @iQlik.
He currently works for DataIQ, a QlikView consulting firm with presence in
Argentina, Mexico, Uruguay, and Paraguay.

I want to thank my family for their understanding and support
throughout all the projects and endeavors I undertake.

www.it-ebooks.info


Barry Harmsen is an independent Business Intelligence Consultant based in the
Netherlands. Originally from a background of traditional Business Intelligence, Data
Warehousing, and Performance Management, in 2008 he made the shift to QlikView
and a more user-centric form of Business Intelligence. Since then he has completed
many successful QlikView implementations in many different industries, from
Financial Services to Telecoms, and from Manufacturing to Healthcare. He writes a
QlikView blog at QlikFix.com.
I would like to thank my daughter Lucie, my son Lex, and especially
my wife Miranda for their support and patience during the writing
of this book.

www.it-ebooks.info


Acknowledgements
Writing a book is not a solo - or duo - exercise. This result could not have been
achieved without the contributions of a great team.
We want to thank Donald Farmer for writing the foreword and for helping us
acquire permission to use some of QlikTech's materials in this book. Thanks to John
Trigg for supporting this project as well.
Ralf Becher, Steve Dark, and Stephen Redmond performed the technical review
of this book. Their insightful comments and suggestions have added an extra
dimension of quality to the book. For that we thank them.
We also want to thank everyone on Packt's editorial team; Rashmi Phadnis, Joanne
Fitzpatrick, Sai Gamare, Anugya Khurana, Ankita Shashi, and Nitee Shetty. Their
guidance kept us focused and on track.

www.it-ebooks.info


About the Reviewers
Ralf Becher was born in 1968. He had his apprenticeship as an Information

Technology Officer at the Leipzig Graduate School of Management (HHL) in
1992. He worked as an IT System Architect and as an IT Consultant in the areas of
banking, insurance, logistics, automotive, and retail. He co-founded TIQ Solutions
in 2004.
The Leipzig Company specializes in modern, quality-assured data management;
since 2004 it has been helping its customers process, evaluate, and maintain the
quality of company data. TIQ Solutions supports its customers from the initial
problem analysis on, helping them introduce, implement, and improve complex
solutions in the fields of data architecture, data integration, data migration,
master data management, meta-data management, data warehousing, and
business intelligence.
He is an internationally recognized QlikView expert with a strong position in the
community. He has contributed QlikView add-on solutions for data integration,
especially in the Java and Big Data realm.

Steve Dark was a SQL Server / MS ASP developer, building web based reporting

solutions for ten years, until he was shown a demo of QlikView. Soon after this
revelation, he left his previous employer to set up Quick Intelligence—a consultancy
focusing entirely on QlikView and delivering Business Intelligence solutions.
Preferring to stay at the coalface, he spends the majority of his time with clients,
building QlikView applications, managing servers, and running projects.
He will never tire of showing QlikView to new users and seeing that "jaw
drop moment".

www.it-ebooks.info


He is active on QlikCommunity and other social media sites, where he shares
his enthusiasm for QlikView and assists other users. Through his blog he
shares tutorials, examples, and insights about QlikView. Read it at
http://www.quickintelligence.co.uk/.
I would like to thank Barry and Miguel for writing this book and the
publishers for making it possible. I honestly believe it fills a vital gap
in the QlikView universe.

Stephen Redmond is the CTO of CapricornVentis Limited (http://www.

capventis.com), a QlikView elite partner. He is the author of several books,
including the very popular DevLogix series for SalesLogix developers.

After many years working with CRM systems, reporting and analysis solutions,
and data integration, in 2006 he started working with QlikView. Since then,
CapricornVentis have become QlikView's top partner in the UK and Ireland territory
and, with Stephen as the head of the team, have implemented QlikView in a wide
variety of enterprise and large business customers across a wide range of sectors
from public sector to financial services to large retailers.
He regularly contributes to online forums, including the Qlik Community. His
QlikView blog is at http://qliktips.blogspot.com and you can follow him
on Twitter—@stephencredmond—where he tweets about QlikView, BI, data
visualization, and technology in general.

www.it-ebooks.info


www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to
your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub
files available? You can upgrade to the eBook version at www.PacktPub.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
TM

http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library.
Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?




Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser

Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view nine entirely free books. Simply use your login credentials for
immediate access.

Instant Updates on New Packt Books
Get notified! Find out when new books are published by following @PacktEnterprise on
Twitter, or the Packt Enterprise Facebook page.

www.it-ebooks.info


www.it-ebooks.info


www.it-ebooks.info


Dedicated to our families.

Miguel García
Barry Harmsen

www.it-ebooks.info


www.it-ebooks.info


Table of Contents
Preface
Chapter 1: Meet QlikView

1
7

What is QlikView?
How does QlikView differ from traditional BI?

8
8

Associative user experience
Technology
Adoption path

9
11
11

Exploring data with QlikView
Getting QlikView
Navigating the document
Slicing and dicing your data

13
13
14
15

List-boxes
Selections in charts
Search
Bookmarking selections
Undoing selections

15
16
16
17
19

Changing the view

19

Cyclic Groups
Drill down Groups
Containers

19
19
20

But wait, there's more!
The technology and components behind QlikView
The way the data flows

When QlikView use expands
Create content
Reload, publish, and distribute content
Consume content

Meet HighCloud Airlines
Summary

21
22

23

24
25
25
26

27
28

www.it-ebooks.info


Table of Contents

Chapter 2: Seeing is Believing

29

What is a SiB?
Preparing the workspace
Setting up the folder structure
Creating the QlikView document
Creating the app
The requirements
Constructing the data model

30
30
30
31
32
32
33

What is a data model?
Loading the fact table
Playing with listboxes
Associating additional tables

33
33
36
40

Creating the dashboard tab

Creating and positioning the filters and user controls
Number of flights over time
One chart and multiple analyses with cyclic expressions
Adding a time drill-down group
Top 10 routes

Summary

43

43
46
50
52
54

57

Chapter 3: Data Sources

59

Using ODBC and OLE DB drivers

60

Installing the drivers

60

Accessing custom data sources

61

Third-party custom connectors

62

Reading table files
Extracting data—two hands-on examples
Extracting data from MS Access
Configuring the driver
Creating the OLE DB connection string
Querying the database
Reloading the script

The resulting data model
Loading a table file

63
63
64

64
66
69
73

74
75

Specifying the file attributes
The transformation step
Refining the input table

76
79
80

The resulting script
QVD and QVX files
QVD files
QVX files
Loading an Inline table
Summary

82
84
84
84
85
86

[ ii ]

www.it-ebooks.info


Table of Contents

Chapter 4: Data Modeling

87

Dimensional data modeling
Back in the day
Relational databases and ER modeling
Dimensional modeling
The star schema
The snowflake schema
Creating the dimensional model

88
88
88
90
90
91
92

Dimensional models in QlikView
The associative data model
Guidelines for table associations

93
94
95

How associations are created
Avoiding data model conflicts

96
98

The Table Viewer window
Table information
Field information
Table preview
Table viewer menu
Summary

104
105
105
106
106
108

Chapter 5: Styling Up

109

Design requirements
The Document Properties window
The Sheet Properties dialog
Setting the object properties
Caption colors and style

110
112
115
117
117

Changing the caption colors
Setting the caption font
Setting the content font
Setting the global font

117
120
121
121

Propagating the object appearance
Setting the default Sheet Object Style
Hiding captions
Working with listboxes
Adding listboxes
The List Box Properties dialog
The General tab
The Expressions tab
The Sort tab
The Presentation tab
The Number tab
The Font tab
The Layout tab
The Caption tab

122
123
123
124
124
125
125
126
126
127
128
128
128
129

[ iii ]

www.it-ebooks.info


Table of Contents

The Multi Box
The Current Selections Box
Making selections from the Current Selections Box
Adding a Bookmark Object
Aligning and resizing sheet objects
Selecting objects
Moving objects
Resizing objects
Resizing a Multi Box

130
131
132
132
133
133
133
134
134

Aligning sheet objects
Do a little house keeping
Creating and applying a default color map
Defining chart colors
Setting the default color map
Summary

Chapter 6: Building Dashboards

135
135
136
136
137
138

139

User types
Dashboard users
Analysts
Report users
Applying the DAR principle to Airline Operations
Document requirements
Creating the Analysis sheet
Adding a new chart
Bar Chart
Additional bar chart properties

139
140
141
142
142
143
144
145
147
149

Expressions and the Edit Expression window
Expressions
The Edit Expression window
The Expression Overview window

150
150
150
153

Line Chart

154

Additional line chart properties

156

Combo Chart
Container
Scatter Chart
Button
Statistics box
Creating the new Dashboard sheet
Linked Objects
Gauges
Cloning the object for re-use
Adding Air Time %

157
159
161
163
164
166
167
170
175
176

[ iv ]

www.it-ebooks.info


Table of Contents
More Gauge styles

177

Adding a Text object

177

Using a Text Object to display an image
Adding actions to a Text object

179
181

Adding a Pie chart

182

Dimension Limits
Adding the dimension value to the data point values

Creating the Reports sheet
Variables

183
185

187
187

The Expression Overview window in action

Copying sheets
KPIs per airline, origin, and destination country
Cyclic and Drill-down groups

189

191
192
192

Straight table

194

Not all expressions are numbers

196

Pivot tables
Auto minimize
The Report Editor window
Other charts
Radar Chart
Mekko Chart
Grid Chart
Funnel Chart
Block Chart
Trellis Chart
Summary

198
200
201
205
206
206
207
208
209
209
211

Chapter 7: Scripting

213

The Script Editor
Menu and toolbar
Script pane
Tool pane
Script statements
Building the aircraft dimension table
Loading the aircraft information
Adding the aircraft groups
Loading the second aircraft table
Making it all right

214
215
215
216
216
217
217
219
221
223

Manipulating tables

227

The JOIN statement
The KEEP statement
The CONCATENATE statement
The NOCONCATENATE statement
Using MAPPING tables
Adding comments

227
229
231
232
233
235
[v]

www.it-ebooks.info


Table of Contents
Storing tables
Renaming tables and fields
Deleting tables and fields

237
237
238

Setting variables
Controlling script flow
Conditional functions
Dealing with different data types
Strings

238
239
241
242
242

String operators
String functions

242
242

Numbers and numeric functions
Date and time functions
Debugging script
Syntax check
Saving logs to disk
The script debugger

245
246
247
248
248
249

Using breakpoints
Limited load

250
250

Tracing script
Standardizing and organizing script
Using tabs
Comments
Adding an information tab
Script layout
Naming conventions
Table naming conventions
Field naming conventions

251
252
252
253
254
256
256
256
257

Re-using scripts
Subroutines
Including script files
Managing file locations and connection strings
Summary

Chapter 8: Data Modeling Best Practices
Data consistency
Dealing with dimensions without facts
An alternative approach
A solo exercise

258
258
260
261
263

265
265
266
270
271

Dealing with facts without dimensions
Reducing storage requirements
Using number-based key fields
Removing unused fields
Splitting high-cardinality fields
[ vi ]

www.it-ebooks.info

272
277
277
278
278


Table of Contents

Design challenges of data modeling
The Airline Employment statistics table
Concatenating fact tables
Structural asymmetry
Natural and forced concatenation
Concatenating the Employment Statistics table

Working with link tables

280
280
281
281
282
284

286

A link table example
Creating a link table in the Airline Operations document

Finding a balance
The master calendar
A final note on data modeling
Summary

286
289

292
293
297
298

Chapter 9: Basic Data Transformation
Changing the source table structure
"Cleansing" a dirty table
File contents
Working with the Transformation Step wizard
The final result
Other transformation tricks

Loading a Crosstable

299
299
300
300
301
311
313

313

A Crosstable example
Working with the Crosstable Wizard
A solo exercise

313
314
318

Expanding a hierarchy

318

A hierarchy example
Working with the Hierarchy Wizard
The tree-view list-box

319
320
323

Generic load

324

Loading a generic table into QlikView

325

Summary

328

Chapter 10: Advanced Expressions
Using variables
Creating a variable
Using variables in charts
Interactively changing a variable's value
Using the Input Box object
Using the Slider object

329
329
330
331
333
333
334

Using variables based on expressions
Using variables to store expressions
Variable naming convention
The Dollar Sign Expansion syntax
Dollar Sign Expansion with parameters
Double Dollar Sign Expansion

335
337
338
338
339
341

[ vii ]

www.it-ebooks.info


Table of Contents

Using the TOTAL qualifier
The Aggr function
Using Aggr for nested aggregation
A word on calculated dimensions

344
346
346
348

Aggregations over the Aggr output
A word on using the Distinct qualifier

Getting the Average Load Factor per Route per Airline
Conditional functions
The If function
The syntax
A use case
Numeric versus text comparisons

349

351

351
353
353
353
354
360

The Class function

360

A solo exercise using the Class function

The Pick function

362

363

Using Pick with Dimensionality

363

A tip on copying expressions
Summary

366
367

Chapter 11: Set Analysis and Point In Time Reporting
The magic of Set Analysis
What is it for?
Syntax and examples

369
369
370
371

Using variables in set expressions

374

Dynamic record sets
More assignment operators
Set operators
Using element functions
Point In Time Reporting
The challenge
Defining the set modifiers

374
375
376
377
378
378
379

Obtaining the base period record set
Obtaining the compare-to period record set

Constructing the expressions
Enabling additional period comparisons
More Point In Time Reporting examples

379
380

382
383
384

Storing set expressions into variables
Set expressions with parameters

386
388

Portable set expressions

390

Set variables and the Master Calendar

392

Comparative analysis with alternate states
A comparative analysis example
Alternate states step-by-step
State-based expressions
[ viii ]

www.it-ebooks.info

393
393
394
398


Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay

×