Tải bản đầy đủ (.pdf) (534 trang)

QlikView 11 for Developers ppt

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (8.53 MB, 534 trang )

QlikView 11 for Developers
Develop Business Intelligence applications with
QlikView 11
Miguel García
Barry Harmsen
P U B L I S H I N G
professional expertise distilled
BIRMINGHAM - MUMBAI
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 ()
Credits
Authors
Miguel García
Barry Harmsen
Reviewers
Ralf Becher
Steve Dark
Stephen Redmond
Acquisition Editors
Rashmi Phadnis
Joanne Fitzpatrick
Lead Technical Editor
Ankita Shashi
Technical Editor
Nitee Shetty
Copy Editors
Aditya Nair
Alda Paiva
Project Coordinators
Sai Gamare
Anugya Khurana
Proofreaders
Joel Johnson
Bob Phillips
Indexers
Monica Ajmera Mehta
Rekha Nair
Tejal Soni
Graphics

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

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 ofces
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—nding 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 rst 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.
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.
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 Certications,
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 rm 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.
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.
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.
About the Reviewers
Ralf Becher was born in 1968. He had his apprenticeship as an Information
Technology Ofcer 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 elds 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".
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
/>I would like to thank Barry and Miguel for writing this book and the
publishers for making it possible. I honestly believe it lls 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 nancial services to large retailers.
He regularly contributes to online forums, including the Qlik Community. His
QlikView blog is at
and you can follow him
on Twitter—@stephencredmond—where he tweets about QlikView, BI, data
visualization, and technology in general.
www.PacktPub.com
Support les, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support les and downloads related to
your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub
les 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
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

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 notied! Find out when new books are published by following @PacktEnterprise on
Twitter, or the Packt Enterprise Facebook page.


Dedicated to our families.
Miguel García
Barry Harmsen

Table of Contents
Preface 1
Chapter 1: Meet QlikView 7
What is QlikView? 8
How does QlikView differ from traditional BI? 8
Associative user experience 9
Technology 11
Adoption path 11
Exploring data with QlikView 13
Getting QlikView 13
Navigating the document 14
Slicing and dicing your data 15
List-boxes 15
Selections in charts 16
Search 16
Bookmarking selections 17
Undoing selections 19
Changing the view 19

Cyclic Groups 19
Drill down Groups 19
Containers 20
But wait, there's more! 21
The technology and components behind QlikView 22
The way the data ows 23
When QlikView use expands 24
Create content 25
Reload, publish, and distribute content 25
Consume content 26
Meet HighCloud Airlines 27
Summary 28
Table of Contents
[ ii ]
Chapter 2: Seeing is Believing 29
What is a SiB? 30
Preparing the workspace 30
Setting up the folder structure 30
Creating the QlikView document 31
Creating the app 32
The requirements 32
Constructing the data model 33
What is a data model? 33
Loading the fact table 33
Playing with listboxes 36
Associating additional tables 40
Creating the dashboard tab 43
Creating and positioning the lters and user controls 43
Number of ights over time 46
One chart and multiple analyses with cyclic expressions 50

Adding a time drill-down group 52
Top 10 routes 54
Summary 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 les 63
Extracting data—two hands-on examples 63
Extracting data from MS Access 64
Conguring the driver 64
Creating the OLE DB connection string 66
Querying the database 69
Reloading the script 73
The resulting data model 74
Loading a table le 75
Specifying the le attributes 76
The transformation step 79
Rening the input table 80
The resulting script 82
QVD and QVX les 84
QVD les 84
QVX les 84
Loading an Inline table 85
Summary 86
Table of Contents
[ iii ]
Chapter 4: Data Modeling 87
Dimensional data modeling 88

Back in the day 88
Relational databases and ER modeling 88
Dimensional modeling 90
The star schema 90
The snowake schema 91
Creating the dimensional model 92
Dimensional models in QlikView 93
The associative data model 94
Guidelines for table associations 95
How associations are created 96
Avoiding data model conicts 98
The Table Viewer window 104
Table information 105
Field information 105
Table preview 106
Table viewer menu 106
Summary 108
Chapter 5: Styling Up 109
Design requirements 110
The Document Properties window 112
The Sheet Properties dialog 115
Setting the object properties 117
Caption colors and style 117
Changing the caption colors 117
Setting the caption font 120
Setting the content font 121
Setting the global font 121
Propagating the object appearance 122
Setting the default Sheet Object Style 123
Hiding captions 123

Working with listboxes 124
Adding listboxes 124
The List Box Properties dialog 125
The General tab 125
The Expressions tab 126
The Sort tab 126
The Presentation tab 127
The Number tab 128
The Font tab 128
The Layout tab 128
The Caption tab 129
Table of Contents
[ iv ]
The Multi Box 130
The Current Selections Box 131
Making selections from the Current Selections Box 132
Adding a Bookmark Object 132
Aligning and resizing sheet objects 133
Selecting objects 133
Moving objects 133
Resizing objects 134
Resizing a Multi Box 134
Aligning sheet objects 135
Do a little house keeping 135
Creating and applying a default color map 136
Dening chart colors 136
Setting the default color map 137
Summary 138
Chapter 6: Building Dashboards 139
User types 139

Dashboard users 140
Analysts 141
Report users 142
Applying the DAR principle to Airline Operations 142
Document requirements 143
Creating the Analysis sheet 144
Adding a new chart 145
Bar Chart 147
Additional bar chart properties 149
Expressions and the Edit Expression window 150
Expressions 150
The Edit Expression window 150
The Expression Overview window 153
Line Chart 154
Additional line chart properties 156
Combo Chart 157
Container 159
Scatter Chart 161
Button 163
Statistics box 164
Creating the new Dashboard sheet 166
Linked Objects 167
Gauges 170
Cloning the object for re-use 175
Adding Air Time % 176
Table of Contents
[ v ]
More Gauge styles 177
Adding a Text object 177
Using a Text Object to display an image 179

Adding actions to a Text object 181
Adding a Pie chart 182
Dimension Limits 183
Adding the dimension value to the data point values 185
Creating the Reports sheet 187
Variables 187
The Expression Overview window in action 189
Copying sheets 191
KPIs per airline, origin, and destination country 192
Cyclic and Drill-down groups 192
Straight table 194
Not all expressions are numbers 196
Pivot tables 198
Auto minimize 200
The Report Editor window 201
Other charts 205
Radar Chart 206
Mekko Chart 206
Grid Chart 207
Funnel Chart 208
Block Chart 209
Trellis Chart 209
Summary 211
Chapter 7: Scripting 213
The Script Editor 214
Menu and toolbar 215
Script pane 215
Tool pane 216
Script statements 216
Building the aircraft dimension table 217

Loading the aircraft information 217
Adding the aircraft groups 219
Loading the second aircraft table 221
Making it all right 223
Manipulating tables 227
The JOIN statement 227
The KEEP statement 229
The CONCATENATE statement 231
The NOCONCATENATE statement 232
Using MAPPING tables 233
Adding comments 235
Table of Contents
[ vi ]
Storing tables 237
Renaming tables and elds 237
Deleting tables and elds 238
Setting variables 238
Controlling script ow 239
Conditional functions 241
Dealing with different data types 242
Strings 242
String operators 242
String functions 242
Numbers and numeric functions 245
Date and time functions 246
Debugging script 247
Syntax check 248
Saving logs to disk 248
The script debugger 249
Using breakpoints 250

Limited load 250
Tracing script 251
Standardizing and organizing script 252
Using tabs 252
Comments 253
Adding an information tab 254
Script layout 256
Naming conventions 256
Table naming conventions 256
Field naming conventions 257
Re-using scripts 258
Subroutines 258
Including script les 260
Managing le locations and connection strings 261
Summary 263
Chapter 8: Data Modeling Best Practices 265
Data consistency 265
Dealing with dimensions without facts 266
An alternative approach 270
A solo exercise 271
Dealing with facts without dimensions 272
Reducing storage requirements 277
Using number-based key elds 277
Removing unused elds 278
Splitting high-cardinality elds 278
Table of Contents
[ vii ]
Design challenges of data modeling 280
The Airline Employment statistics table 280
Concatenating fact tables 281

Structural asymmetry 281
Natural and forced concatenation 282
Concatenating the Employment Statistics table 284
Working with link tables 286
A link table example 286
Creating a link table in the Airline Operations document 289
Finding a balance 292
The master calendar 293
A nal note on data modeling 297
Summary 298
Chapter 9: Basic Data Transformation 299
Changing the source table structure 299
"Cleansing" a dirty table 300
File contents 300
Working with the Transformation Step wizard 301
The nal result 311
Other transformation tricks 313
Loading a Crosstable 313
A Crosstable example 313
Working with the Crosstable Wizard 314
A solo exercise 318
Expanding a hierarchy 318
A hierarchy example 319
Working with the Hierarchy Wizard 320
The tree-view list-box 323
Generic load 324
Loading a generic table into QlikView 325
Summary 328
Chapter 10: Advanced Expressions 329
Using variables 329

Creating a variable 330
Using variables in charts 331
Interactively changing a variable's value 333
Using the Input Box object 333
Using the Slider object 334
Using variables based on expressions 335
Using variables to store expressions 337
Variable naming convention 338
The Dollar Sign Expansion syntax 338
Dollar Sign Expansion with parameters 339
Double Dollar Sign Expansion 341
Table of Contents
[ viii ]
Using the TOTAL qualier 344
The Aggr function 346
Using Aggr for nested aggregation 346
A word on calculated dimensions 348
Aggregations over the Aggr output 349
A word on using the Distinct qualier 351
Getting the Average Load Factor per Route per Airline 351
Conditional functions 353
The If function 353
The syntax 353
A use case 354
Numeric versus text comparisons 360
The Class function 360
A solo exercise using the Class function 362
The Pick function 363
Using Pick with Dimensionality 363
A tip on copying expressions 366

Summary 367
Chapter 11: Set Analysis and Point In Time Reporting 369
The magic of Set Analysis 369
What is it for? 370
Syntax and examples 371
Using variables in set expressions 374
Dynamic record sets 374
More assignment operators 375
Set operators 376
Using element functions 377
Point In Time Reporting 378
The challenge 378
Dening the set modiers 379
Obtaining the base period record set 379
Obtaining the compare-to period record set 380
Constructing the expressions 382
Enabling additional period comparisons 383
More Point In Time Reporting examples 384
Storing set expressions into variables 386
Set expressions with parameters 388
Portable set expressions 390
Set variables and the Master Calendar 392
Comparative analysis with alternate states 393
A comparative analysis example 393
Alternate states step-by-step 394
State-based expressions 398

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

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