Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

QlikView Advanced Data Visualization

Discover Deeper Insights with Qlikview


by Building Your Own Rich Analytical
Applications from Scratch 1st Edition
Miguel Ángel García
Visit to download the full and correct content document:
https://ebookmeta.com/product/qlikview-advanced-data-visualization-discover-deeper
-insights-with-qlikview-by-building-your-own-rich-analytical-applications-from-scratch-
1st-edition-miguel-angel-garcia/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

English Grammar Exercises with answers Part 4 Your


quest towards C2 1st Edition Daniel B. Smith

https://ebookmeta.com/product/english-grammar-exercises-with-
answers-part-4-your-quest-towards-c2-1st-edition-daniel-b-smith/

Chess Explained The c3 Sicilian 1st Edition Sam Collins

https://ebookmeta.com/product/chess-explained-
the-c3-sicilian-1st-edition-sam-collins/

Starting Out The c3 Sicilian 1st Edition John Emms

https://ebookmeta.com/product/starting-out-the-c3-sicilian-1st-
edition-john-emms/

The Paper Issue 83 1st Edition Origamiusa

https://ebookmeta.com/product/the-paper-issue-83-1st-edition-
origamiusa/
Beyond Advanced Excel Building Analytical Applications
Using Excel 1st Edition Geoffrey Collins

https://ebookmeta.com/product/beyond-advanced-excel-building-
analytical-applications-using-excel-1st-edition-geoffrey-collins/

The American Revolution 1774 83 2nd Edition Daniel


Marston

https://ebookmeta.com/product/the-american-
revolution-1774-83-2nd-edition-daniel-marston/

BNF 83 (British National Formulary) March 2022 Joint


Formulary Committee

https://ebookmeta.com/product/bnf-83-british-national-formulary-
march-2022-joint-formulary-committee/

Patriot vs Loyalist American Revolution 1775 83 Combat


1st Edition Si Sheppard

https://ebookmeta.com/product/patriot-vs-loyalist-american-
revolution-1775-83-combat-1st-edition-si-sheppard/

British Light Infantryman vs Patriot Rifleman American


Revolution 1775 83 1st Edition Robbie Macniven

https://ebookmeta.com/product/british-light-infantryman-vs-
patriot-rifleman-american-revolution-1775-83-1st-edition-robbie-
macniven/
Table of Contents
QlikView: Advanced Data Visualization
Why subscribe?
PacktPub.com
Contributors
About the authors
Packt is Searching for Authors Like You
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
1. Performance Tuning and Scalability
Reviewing basic performance tuning techniques
Removing unneeded data
Reducing the number of rows
Reducing the number of columns
Replacing text keys with numbers
Resolving synthetic keys
Reviewing the basics
Generating test data
Generating dimension values
Generating fact table rows
Understanding how QlikView stores its data
A great primer
Looking at things from a simple level
Exporting the memory statistics for a document
Strategies to reduce the data size and improve performance
Optimizing field values and keys
Optimizing data by removing keys using ApplyMap
Optimizing performance by removing keys by joining tables
Optimizing memory by removing low cardinality fields
Testing chart performance for different load options
Turning the cache off
Examining the chart calculation time for different scenarios
Optimizing performance by creating counter fields
Optimizing performance by combining fact tables?
Optimizing your numbers
Optimizing chart calculation times
The QlikView calculation engine
Creating flags for well-known conditions
Sorting for well-known conditions
Using Direct Discovery
Direct Discovery restrictions
Direct Discovery syntax
Looking at an example Direct Query
Testing scalability with JMeter
Obtaining the scalability tools
Installing JMeter
Installing the scalability tools
About the scalability tools
Running an example execution
Summary
2. QlikView Data Modeling
Reviewing basic data modeling
Associating data
Automatically associating tables
Understanding synthetic keys
Creating composite keys
Using string concatenation
Using one of the Hash functions
Using the AutoNumber function
Realizing that facts are calculated at the level of their table
Joining data
Understanding Join and Keep
Inner joins
Left and right joins
Outer joins
Cartesian joins
Understanding the effect of duplicate key values on joins
Understanding Keep
Concatenating rows
Reviewing Concatenate
Differentiating Concatenate and Join
Mapping data with ApplyMap
Reviewing the basic functionality of ApplyMap
Mapping numbers
Using ApplyMap instead of Join with duplicate rows
Dimensional data modeling
Differentiating between facts and dimensions
Understanding the grain
Understanding star schemas
Summing with facts
Discovering more about facts
Transaction fact tables
Periodic snapshot fact tables
Factless fact tables
Dealing with nulls in fact tables in QlikView
Designing dimension tables
Denormalizing dimensions and conformed dimensions
Understanding surrogate keys
Dealing with missing or late arriving dimension values
Defining Kimball's four-step dimensional design process
Selecting the business process
Declaring the grain
Identifying the dimensions
Identifying the facts
Learning some useful reusable dimension methods
Creating a calendar dimension
Unwrapping hierarchies
Creating leaves with Hierarchy
Creating parent associations with HierarchyBelongsTo
Creating dimensional facts
Handling slowly changing dimensions
Taking the most recently changed record using FirstSortedValue
Using IntervalMatch with SCDs
Using hash to manage from/to dates
Dealing with multiple fact tables in one model
Joining the fact tables together
Concatenating fact tables
Changing the grain of a fact table
Linking fact tables of different grains
Drilling across with document chaining
Summary
3. Best Practices for Loading Data
Reviewing data loading concepts
Getting data from anywhere
Loading data from QlikView
Loading similar files with concatenation
Loading dissimilar files with Concatenate and For Each
Understanding QlikView Data files
Storing tables to QVD
Using QVD files
Understanding why you should use an ETL approach
Speeding up overall data loading
Reusing extracted data in multiple documents
Applying common business rules across multiple documents
Creating conformed dimensions
Provisioning a self-service data layer
Using an ETL approach to create QVD data layers
Creating a StoreAndDrop subroutine
Extracting data
Creating an extractor folder structure
Differentiating types of scripts
Executing the extractors
Transforming data
Creating a transformer and model folder structure
Executing transformers
Loading data
Creating a UserApp folder structure
Executing the load step
Mastering loading techniques
Loading data incrementally
Establishing the script for the basic process
Running an incremental load when data is only added
Loading incrementally when data might be modified
Handling deletions from the source system
Handling situations where there is no modify date
Partially reloading only one part of the data model
Replacing a table
Adding new rows to a table
Managing script execution in partial reloads
Loading the content of another QVW
Using QlikView Expressor for ETL
Introducing Expressor
Understanding why to use Expressor for ETL
Understanding workspaces, libraries, projects, and artifacts
Creating a workspace
Managing extensions
Working with libraries and projects
Understanding artifacts
Configuring connections
Configuring a File connection
Connecting to a database
Creating a QVX Connector Connection
Configuring types and schemas
Adding additional Atomic types
Creating Composite types
Configuring a schema
Creating and packaging a basic dataflow
Understanding the dataflow toolbox
Inputs
Outputs
Transformers
Utility
Creating the dataflow
Configuring a Read File operator
Adding a Transformation operation
Creating a QVX output
Packaging the dataflow
Summary
4. Advanced Expressions
Reviewing basic concepts
Searching in QlikView
Searching for text
Wildcard search
Normal search
Fuzzy search
Associative search
Advanced search
Searching numeric fields
Numeric search
Automatic interpretation of searches
Multiple values search
Searching in multiple listboxes
Understanding bookmarks
Saving a bookmark
Managing bookmarks
Using variables in QlikView
SET versus LET
Using variables to hold common expressions
Using variables with Dollar-sign Expansion
Limiting calculations
Sum of If
Flag arithmetic
Calculations using variables
Data islands
Set Analysis
Explaining what we mean by a set
Set identifiers
Set modifiers
Understanding Dollar-sign Expansion
Following the two-step process
Following the steps in the script debugger
Following the steps in a chart expression
Understanding when the steps happen in chart expressions
Using parameters with variables and Dollar-sign Expansion
Using variables in expressions
Using advanced Set Analysis
Identifying the identifiers
Understanding that modifiers are sets
Set arithmetic
Using searches in Set Analysis
Using Dollar-sign Expansion with Set Analysis
Comparing to other fields
Direct field comparison
Using Concat with Dollar-sign Expansion
Using the P and E element functions
Set Analysis with Alternate States
Using Alternate States as identifiers
Comparing fields between states
Calculating vertically
Using inter-record and range functions
Applying the Total qualifier
Creating advanced aggregations with Aggr
Using Aggr to calculate a control chart
Calculated dimensions
No to nodistinct
Summary
5. Advanced Scripting
Reviewing the basic concepts
Using Table Files Wizard
Using relative paths
Delimited files
Fixed width files
XML files
HTML files
QVD/QVX files
Connecting to databases
Using the Connect button
Understanding the Connect To statement
Explaining the Force 32 Bit option
The Select wizard
Counting records
RecNo
RowNo
FieldValueCount
NoOfRows
NoOfColumns
Loading data quickly
Understanding compression settings
Optimal loading from QVD
Using an Exists clause
Preloading fields into QVDs
Applying variables and the Dollar-sign Expansion in the script
Examining common usage
Holding dates
Holding paths
Examining variable values during reloads
Nesting Dollar-sign Expansions
Passing parameters to variables – macro functions
Subroutines
Using control structures
Branching with conditional statements
If … Then … ElseIf
A note about conditional functions
Switch … Case
When and Unless
Looping in the script
AutoGenerate
For … Next loops
For Each … Next loops
FileList
DirList
Do … Loop
Exiting
Exiting the script
Exiting other constructs
Using variables for error handling
ErrorMode
ScriptError
ScriptErrorCount and ScriptErrorList
Examining advanced Table File Wizard options
Enabling a transformation step
Garbage
Fill
Column
Context
Unwrap
Rotate
Using the Crosstable wizard
Looking at data from different directions
Putting things first
First
FirstSortedValue
Looking backwards
Previous
Peek
Reusing code
Summary
6. What's New in QlikView 12?
Common QIX Engine
64-bit only
Online documentation
Security improvements
Mobile touch improvements
Improved clustering and scaling
Clustering improvements in QlikView 12.1
What is new in the Qlik product portfolio?
Qlik Sense Enterprise and the Qlik Analytics Platform
In what way are QlikView and Qlik Sense similar?
In what way do QlikView and Qlik Sense differ?
What does this mean for users?
What is the Qlik Analytics Platform?
Qlik NPrinting
Qlik Web Connectors
Qlik GeoAnalytics
Qlik DataMarket
How do the products in the Qlik product portfolio fit together?
Summary
7. Styling Up
Design requirements
The Document Properties window
The Sheet Properties dialog
Setting the object properties
Caption colors and style
Changing the caption colors
The Color Area and Color dialog windows
Setting the caption font
Setting the content font
Setting the global font
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
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
Aligning sheet objects
Do a little house keeping
Creating and applying a default color map
Defining chart colors
Setting the default color map
Summary
8. Building Dashboards
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
Style
Presentation
Expressions and the Edit Expression window
Expressions
The Edit Expression window
Fields
Functions
Variables
Images
The Expression Overview window
Line Chart
Additional line chart properties
Expressions
Style
Presentation
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 %
More Gauge styles
Adding a Text object
Using a Text Object to display an image
Adding actions to a Text object
Adding a Pie chart
Dimension Limits
Adding the dimension value to the data point values
Creating the Reports sheet
Variables
The Expression Overview window in action
Copying sheets
KPIs per airline, origin, and destination country
Cyclic and Drill-down groups
Straight table
Not all expressions are numbers
Pivot tables
Auto minimize
The Report Editor window
Other charts
Radar Chart
Mekko Chart
Grid Chart
Funnel Chart
Block Chart
Trellis Chart
Summary
9. Advanced Data Transformation
Data architecture
Two-stage architecture
Three-stage architecture
Setting up our environment
Loading data already stored in QlikView
Cloning a QlikView data model
Loading from RAM
Resident load
Aggregating data
Aggregating the Flight Data table
The Transformation output
Aggregation functions
Sorting tables
Ordering the Order-By fields
The Peek function
Merging forces
A refresher
The objective
Getting it done
Loading the table
Sorting the table
Peeking previous records
A solo exercise
Dealing with slowly changing dimensions
The Carrier Decode table
IntervalMatch magic
Expanding the intervals
Some considerations
Applying IntervalMatch to the Carrier Decode table
Ordering, peeking, and matching all at once
The use case
Incremental loads
Summary
10. Security
Hidden script
Section access
Section access fields
Reduction fields
Initial data reduction
Omitting fields
Document-level security
Sheet-level security
Summary
11. Data Visualization Strategy
Data exploration, visualization, and discovery
Data teams and roles
Data research and development
Data governance team
Agile development
User story
Minimum Viable Product
QlikView Deployment Framework
Exercise 11.1
Summary
12. Sales Perspective
Sales perspective data model
Exercise 12.1
Data quality issues
Missing dimension values
Missing fact values
Data formatting and standardization
Case
Unwanted characters
Dates and time
Master calendar
Customer stratification.
Pareto analysis
Exercise 12.2
Exercise 12.3
Customer churn
Exercise 12.4
Exercise 12.5
QlikView extensions and the cycle plot
Exercise 12.6
Governance – design template
Summary
13. Financial Perspective
Financial perspective data model
Exercise 13.1
Financial report metadata
AsOfCalendar
Income statement
Exercise 13.2
Custom format cell
Exercise 13.3
Balance sheet
Exercise 13.4
Exercise 13.5
Cash flow statement
Exercise 13.6
Summary
14. Marketing Perspective
Marketing data model
Customer profiling
Parallel coordinates
Exercise 14.1
Exercise 14.2
Sankey
Exercise 14.3
Exercise 14.4
Market size analysis
Exercise 14.5
Exercise 14.6
Exercise 14.7
Social media analysis
Exercise 14.8
Exercise 14.9
Exercise 14.10
Sales opportunity analysis
Exercise 14.11
Summary
15. Working Capital Perspective
Working capital data model
Rotation and average days
Days Sales of Inventory
Exercise 15.1
Days Sales Outstanding
Exercise 15.2
Days Payable Outstanding
Exercise 15.3
Exercise 15.4
Working capital breakdown
Exercise 15.5
Inventory stock levels
Exercise 15.6
Aging report
Exercise 15.7
Customer stratification
Stratification by distribution
Exercise 15.8
Exercise 15.9
Visualizing stratification
Exercise 15.10
Summary
16. Operations Perspective
Operations data model
Handling multiple date fields
On-Time and In-Full
Exercise 16.1
OTIF breakdown
Exercise 16.2
Exercise 16.3
Predicting lead time
Exercise 16.4
Exercise 16.5
Supplier and On-Time delivery correlation
Exercise 16.5
Planning in QlikView with KliqPlan
Planning tool extensions
Sales forecasts and purchase planning
Other applications
Summary
17. Human Resources
Human resources data model
Slowing changing dimensions attributes
Personnel productivity
Exercise 17.1
Exercise 17.2
Personnel productivity breakdown
Age distribution
Exercise 17.3
Salary distribution
Exercise 17.4
Employee retention rate
Exercise 17.5
Employee vacation and sick days
Exercise 17.6
Employee training and performance
Exercise 17.7
Personal behavior analysis
Exercise 17.8
Summary
18. Fact Sheets
Customer fact sheet consolidated data model
Customer Fact sheet Agile design
Creating user stories
User story flow
Converting user stories into visualizations
Going beyond the first visualization
Customer Fact sheet advanced components
Bullet graph
Exercise 18.1
Exercise 18.2
Sparklines
Exercise 18.3
Customizing the QlikView User Experience
Quick access to supplementary information
Exercise 18.4
Dynamic data visualization
Exercise 18.5
Regional settings
Currency
Language
Date and number formats
Customer Fact sheet n QlikView
Summary
19. Balanced Scorecard
The Balanced Scorecard method
The financial perspective
The customer perspective
The internal business process perspective
The learning and growth perspective
The Balanced Scorecard consolidated data model
The Balanced Scorecard information dashboard design
The Gestalt principles of perceptual organization
Proximity
Enclosure
Closure
Connection
Continuity
Similarity
Creating the filter pane bubble
Exercise 19.1
Creating an interactive tutorial
Exercise 19.2
Measuring success with XmR charts
Exercise 19.3
Summary
20. Troubleshooting Analysis
Troubleshooting preparation and resources
Positive mindset
General debugging skills
Reproduce
Diagnose
Fix
Reflect
Resources
QlikView Help
Local knowledge base
Qlik Community
Qlik Support
Reporting issues
Common QlikView application issues
Common QlikView data model issues
All expression values are exactly the same
The expression total is not equal to the sum of the rows
Duplicate values in a list box
Data doesn't match user expectation
Common QlikView expression issues
The expression does not calculate every row
The amounts in the table are not accumulating
Summary
21. Mastering Qlik Sense Data Visualization
Qlik Sense and QlikView developers
Visualization extension examples for cross-selling
Plan to master Qlik Sense data visualization
Summary
Index
QlikView: Advanced Data
Visualization
QlikView: Advanced Data
Visualization
Copyright © 2018 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 author(s), nor Packt Publishing or its dealers
and distributors, will be held liable for any damages caused or
alleged to have been 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: December 2018

Production reference: 1191218

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78995-599-6
www.packtpub.com

mapt.io

Mapt is an online digital library that gives you full access to over
5,000 books and videos, as well as industry leading tools to help you
plan your personal development and advance your career. For more
information, please visit our website.

Why subscribe?
Spend less time learning and more time coding with practical
eBooks and Videos from over 4,000 industry professionals
Learn better with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
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.
Contributors
About the authors
Miguel Ángel García is a Business Intelligence consultant and Qlik
Solutions Architect from Monterrey, Mexico. Having worked
throughout many successful Qlik implementations, from inception
through implementation, and performed across a wide variety of
roles on each project, his experience and skills range from pre-sales
to applications development and design, technical architecture,
system administration, as well as functional analysis and overall
project execution. He currently holds the QlikView Designer, QlikView
Developer, and QlikView System Administrator Certifications.

Barry Harmsen is a Business Intelligence Consultant based in the


Netherlands. Here he runs Bitmetric, a boutique consulting firm
specialized in the Qlik product suite. Originally from a background of
traditional business intelligence, data warehousing, and performance
management, in 2008 Barry made the shift to Qlik and a more user-
centric form of Business Intelligence. Since then, he and his team
have helped many clients get the most out of their investments in
the Qlik platform.

Barry is one of the four Qlik experts teaching at the Masters Summit
for Qlik, an advanced 3-day training for experienced Qlik
professionals. He also runs the Amsterdam chapter of the Qlik Dev
Group, an open and informal gathering where Qlik professionals can
share knowledge and experiences.

Stephen Redmond is the CTO and Qlik Luminary at


CapricornVentis - a QlikView Elite Partner. He is the author of several
books, including QlikView for Developers Cookbook and QlikView
Server and Publisher, both published by Packt Publishing. He is also
the author of the popular DevLogixseries for SalesLogix developers.
In 2006, after many years of working with CRM systems, reporting
and analysis solutions, and data integration, Stephen started
working with QlikView. Since then, CapricornVentis has become
QlikView's top partner in the UK and Ireland territories, and with
Stephen as the head of the team, they 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. In 2014, Stephen was awarded the Luminary status
by Qlik in recognition of his product advocacy. He regularly
contributes to online forums, including the Qlik Community.

Karl Pover is the owner and principal consultant of Evolution


Consulting, which provides QlikView consulting services throughout
Mexico. Since 2006, he has been dedicated to providing QlikView
presales, implementation, and training for more than 50 customers.
He is the author of Learning QlikView Data Visualization, and he has
also been a Qlik Luminary since 2014.
Packt is Searching for Authors
Like You
If you're interested in becoming an author for Packt, please
visit authors.packtpub.com and apply today. We have worked with
thousands of developers and tech professionals, just like you, to help
them share their insight with the global tech community. You can
make a general application, apply for a specific hot topic that we are
recruiting an author for, or submit your own idea.
Preface
QlikView is one of the most flexible and powerful business
intelligence platforms around, and if you want to transform data into
insights, it is one of the best options you have at hand. Use this
Learning Path, to explore the many features of QlikView to realize
the potential of your data and present it as impactful and engaging
visualizations.

Each chapter in this Learning Path starts with an understanding of a


business requirement and its associated data model and then helps
you create insightful analysis and data visualizations around it. You
will look at problems that you might encounter while visualizing
complex data insights using QlikView, and learn how to troubleshoot
these and other not-so-common errors. This Learning Path contains
real-world examples from a variety of business domains, such as
sales, finance, marketing, and human resources.

With all the knowledge that you gain from this Learning Path, you
will have all the experience you need to implement your next
QlikView project like a pro.
Who this book is for
This Learning Path is designed for developers who want to go
beyond their technical knowledge of QlikView and understand how
to create analysis and data visualizations that solve real business
needs. To grasp the concepts explained in this Learning Path, you
should have a basic understanding of the common QlikView
functions and some hands-on experience with the tool.
What this book covers
Chapter 1, Performance Tuning and Scalability, is where we look at
understanding how QlikView stores its data so that we can optimize
that storage in our applications. We will also look at topics such as
Direct Discovery and testing implementations using JMeter.

Chapter 2, QlikView Data Modeling, looks in detail at dimensional


data modeling and learning about fact and dimension tables and
using best practices from Ralph Kimball in QlikView. We also learn
about how to handle slowly changing dimensions (SCDs), multiple
fact tables, and drilling across with document chaining.

Chapter 3, Best Practices for Loading Data, is where we look at


implementing ETL strategies with QVD files. We also introduce
QlikView Expressor.

Chapter 4, Advanced Expressions, is where we look at areas such as


the Dollar-sign Expansion, set analysis, and vertical calculations
using Total and Aggr.

Chapter 5, Advanced Scripting, looks at optimizing loads, Dollar-sign


Expansion in the script, and control structures. We also introduce the
concept of code reuse.

Chapter 6, What's New in QlikView 12, presents a summary of the


changes in the QlikView software, as well as in the Qlik ecosystem in
general, that happened since the previous version of this book was
published in 2012. In this chapter, we will bring you up to speed with
the changes over the past few years.

Chapter 7, Styling Up, will help us learn how to style our QlikView
documents. We will learn about the various document and sheet
properties and will use them to manage the visual style of our
document. We will also take a closer look at some of the most
fundamental objects and learn how we can change their
appearance.

Chapter 8, Building Dashboards, introduces us to the three basic


types of QlikView users, and how we can best cater to their needs.
We will learn about the various charting options that are available in
QlikView, and will see how we can add interactivity to our QlikView
documents. We will also be introduced to basic calculations.

Chapter 9, Advanced Data Transformation, returns to the topic of


data transformation. We will learn about the most commonly used
data architectures that can ease QlikView development and
administration. Next, we will take a close look at aggregating and
sorting data in the data model. In the fi nal part of the chapter, we
will learn how to take advantage of some of QlikView's most
powerful data transformation capabilities.

Chapter 10, Security, shows how to secure our QlikView documents.


We will see how we can allow only authorized users to open our
documents and will learn how we can limit what a user can do and
see within our document.

Chapter 11, Data Visualization Strategy, begins our journey to create


a data-driven organization using QlikView.

Chapter 12, Sales Perspective, explains the data model's importance


to data visualization, and shows us how to create advanced
analyses, such as customer stratifi cation, churn prediction, and
seasonal trends.

Chapter 13, Financial Perspective, illustrates the usage of metadata


to format an income statement, a balance sheet, and a cash flow
statement.

Chapter 14, Marketing Perspective, walks us through various types of


visualization that reveal customer profiles, potential markets, social
media sentiment, and the sales pipeline.
Chapter 15, Working Capital Perspective, describes how to analyze
days sales of inventory, days sales outstanding, and days payable
outstanding, at both a high and a detailed level. It also explains how
they are important in order to determine customer stratification.

Chapter 16, Operations Perspective, shows us how to analyze our


service levels, predict supplier lead times, and investigate whether
on-time deliveries depend on the supplier.

Chapter 17, Human Resources, reveals how to visualize personnel


productivity and personal behavior analysis.

Chapter 18, Fact Sheets, demonstrates an ad hoc design method to


create a customer fact sheet that includes bullet graphs, sparklines,
and a customized UX.

Chapter 19, Balanced Scorecard, details a more formal design


method to build an information dashboard containing balanced
scorecard metrics.

Chapter 20, Troubleshooting Analysis, takes a look at resources and


methods to debug problems in our QlikView applications.

Chapter 21, Mastering Qlik Sense Data Visualization, explains what


Qlik Sense means to a QlikView developer and proposes a plan to
master Qlik Sense data visualization.
To get the most out of this
book
To use this book, you primarily need the QlikView Desktop software.
With regards to computer requirements, you will need a PC with at
least Windows XP (or better), 2 GB of hard disk space, and 2 GB of
RAM. A 64-bit machine is required if you want to use QlikView 12 or
a higher version, and is the recommended environment for this book
and QlikView development in general. If you prefer to use a 32-bit
machine, you can install QlikView 11 instead.

For best understanding, a general knowledge of BI and its


terminology is required. Basic understanding of databases and SQL
is preferred, but not compulsory for this book.

Download the example code files


You can download the example code files for this book from your
account at http://www.packtpub.com. If you purchased this book
elsewhere, you can visit http://www.packtpub.com/support and
register to have the files emailed directly to you.

You can download the code files by following these steps:

1. Log in or register at http://www.packtpub.com.


2. Select the SUPPORT tab.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box and follow the
on-screen instructions.

Once the file is downloaded, please make sure that you unzip or
extract the folder using the latest version of:

WinRAR / 7-Zip for Windows


Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub


https://github.com/PacktPublishing/QlikView-Advanced-Data-
Visualization. We also have other code bundles from our rich catalog
of books and videos available at
https://github.com/PacktPublishing/. Check them out!
Conventions used
There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names,


folder names, filenames, file extensions, pathnames, dummy URLs,
user input, and Twitter handles. For example; "In the
QVScriptGenTool_0_7 64Bit\Analyzer folder there is a ZIP file called
FolderTemplate.zip."

A block of code is set as follows:

Sales:
Load * INLINE [
Country, Sales
USA, 1000
UK, 940
Japan, 543
];

When we wish to draw your attention to a particular part of a code


block, the relevant lines or items are set in bold:

Sales:
Load * INLINE [
Country, Sales
USA, 1000
UK, 940
Japan, 543
];

Any command-line input or output is written as follows:

C:\Program Files\QlikView\qv.exe

New terms and important words are shown in bold. Words that you
see on the screen, for example, in menus or dialog boxes, appear in
the text like this: "Click on the Execution tab."

Note
Warnings or important notes appear in a box like this.

Tip
Tips and tricks appear like this.
Get in touch
Feedback from our readers is always welcome.

General feedback: Email feedback@packtpub.com, and mention the


book's title in the subject of your message. If you have questions
about any aspect of this book, please email us at
questions@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy


of our content, mistakes do happen. If you have found a mistake in
this book we would be grateful if you would report this to us. Please
visit, http://www.packtpub.com/submit-errata, selecting your book,
clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any
form on the Internet, we would be grateful if you would provide us
with the location address or website name. Please contact us at
copyright@packtpub.com with a link to the material.

If you are interested in becoming an author: If there is a topic


that you have expertise in and you are interested in either writing or
contributing to a book, please visit http://authors.packtpub.com.

Reviews
Please leave a review. Once you have read and used this book, why
not leave a review on the site that you purchased it from? Potential
readers can then see and use your unbiased opinion to make
purchase decisions, we at Packt can understand what you think
about our products, and our authors can see your feedback on their
book. Thank you!

For more information about Packt, please visit packtpub.com.


Chapter 1. Performance
Tuning and Scalability
"The way Moore's Law occurs in computing is really unprecedented
in other walks of life. If the Boeing 747 obeyed Moore's Law, it
would travel a million miles an hour, it would be shrunken down in
size, and a trip to New York would cost about five dollars. Those
enormous changes just aren't part of our everyday experience."

— Nathan Myhrvold, former Chief Technology Officer at Microsoft,


1995

The way Moore's Law has benefitted QlikView is really


unprecedented amongst other BI systems.

QlikView began life in 1993 in Lund, Sweden. Originally titled


"QuickView", they had to change things when they couldn't obtain a
copyright on that name, and thus "QlikView" was born.

After years of steady growth, something really good happened for


QlikView around 2005/2006—the Intel x64 processors became the
dominant processors in Windows servers. QlikView had, for a few
years, supported the Itanium version of Windows; however, Itanium
never became a dominant server processor. Intel and AMD started
shipping the x64 processors in 2004 and, by 2006, most servers sold
came with an x64 processor—whether the customer wanted 64-bit
or not. Because the x64 processors could support either x86 or x64
versions of Windows, the customer didn't even have to know. Even
those customers who purchased the x64 version of Windows 2003
didn't really know this because all of their x86 software would run
just as well (perhaps with a few tweaks).
But x64 Windows was fantastic for QlikView! Any x86 process is
limited to a maximum of 2 GB of physical memory. While 2 GB is
quite a lot of memory, it wasn't enough to hold the volume of data
that a true enterprise-class BI tool needed to handle. In fact, up
until version 9 of QlikView, there was an in-built limitation of about 2
billion rows (actually, 2 to the power of 31) in the number of records
that QlikView could load. On x86 processors, QlikView was really
confined to the desktop.

x64 was a very different story. Early Intel implementations of x64


could address up to 64 GB of memory. More recent implementations
allow up to 256 TB, although Windows Server 2012 can only address
4 TB. Memory is suddenly less of an obstacle to enterprise data
volumes.

The other change that happened with processors was the


introduction of multi-core architecture. At the time, it was common
for a high-end server to come with 2 or 4 processors. Manufacturers
came up with a method of putting multiple processors, or cores, on
one physical processor. Nowadays, it is not unusual to see a server
with 32 cores. High-end servers can have many, many more.

One of QlikView's design features that benefitted from this was that
their calculation engine is multithreaded. That means that many of
QlikView's calculations will execute across all available processor
cores. Unlike many other applications, if you add more cores to your
QlikView server, you will, in general, add more performance.

So, when it comes to looking at performance and scalability, very


often, the first thing that people look at to improve things is to
replace the hardware. This is valid of course! QlikView will almost
always work better with newer, faster hardware. But before you go
ripping out your racks, you should have a good idea of exactly what
is going on with QlikView. Knowledge is power; it will help you tune
your implementation to make the best use of the hardware that you
already have in place.
The following are the topics we'll be covering in this chapter:

Reviewing basic performance tuning techniques


Generating test data
Understanding how QlikView stores its data
Looking at strategies to reduce the data size and to improve
performance
Using Direct Discovery
Testing scalability with JMeter

Reviewing basic performance


tuning techniques
There are many ways in which you may have learned to develop
with QlikView. Some of them may have talked about performance
and some may not have. Typically, you start to think about
performance at a later stage when users start complaining about
slow results from a QlikView application or when your QlikView
server is regularly crashing because your applications are too big.

In this section, we are going to quickly review some basic


performance tuning techniques that you should, hopefully, already
be aware of. Then, we will start looking at how we can advance your
knowledge to master level.

Removing unneeded data


Removing unneeded data might seem easy in theory, but sometimes
it is not so easy to implement—especially when you need to
negotiate with the business. However, the quickest way to improve
the performance of a QlikView application is to remove data from it.
If you can reduce your number of fact rows by half, you will vastly
improve performance. The different options are discussed in the next
sections.

Reducing the number of rows


The first option is to simply reduce the number of rows. Here we are
interested in Fact or Transaction table rows—the largest tables in
your data model. Reducing the number of dimension table rows
rarely produces a significant performance improvement.

The easiest way to reduce the number of these rows is usually to


limit the table by a value such as the date. It is always valuable to
ask the question, "Do we really need all the transactions for the last
10 years?" If you can reduce this, say to 2 years, then the
performance will improve significantly.

We can also choose to rethink the grain of the data—to what level of
detail we hold the information. By aggregating the data to a higher
level, we will often vastly reduce the number of rows.

Reducing the number of columns


The second option is to reduce the width of tables—again, especially
Fact or Transaction tables. This means looking at fields that might
be in your data model but do not actually get used in the
application. One excellent way of establishing this is to use the
Document Analyzer tool by Rob Wunderlich to examine your
application (http://robwunderlich.com/downloads).

As well as other excellent uses, Rob's tool looks at multiple areas of


an application to establish whether fields are being used or not. It
will give you an option to view fields that are not in use and has a
useful DROP FIELD Statements listbox from which you can copy
the possible values. The following screenshot shows an example
(from the default document downloadable from Rob's website):
Adding these DROP FIELD statements into the end of a script makes it
very easy to remove fields from your data model without having to
dive into the middle of the script and try to remove them during the
load—which could be painful.

There is a potential issue here; if you have users using collaboration


objects—creating their own charts—then this tool will not detect that
usage. However, if you use the DROP FIELD option, then it is
straightforward to add a field back if a user complains that one of
their charts is not working.

Of course, the best practice would be to take the pain and remove
the fields from the script by either commenting them out or
removing them completely from their load statements. This is more
work, because you may break things and have to do additional
debugging, but it will result in a better performing script.
Replacing text keys with numbers
Often, you will have a text value in a key field, for example,
something like an account number that has alphanumeric characters.
These are actually quite poor for performance compared to an
integer value and should be replaced with numeric keys.

Note
There is some debate here about whether this makes a
difference at all, but the effect is to do with the way the data is
stored under the hood, which we will explore later. Generated
numeric keys are stored slightly differently than text keys, which
makes things work better.

The strategy is to leave the text value (account number) in the


dimension table for use in display (if you need it!) and then use the
AutoNumber function to generate a numeric value—also called a
surrogate key—to associate the two tables.

For example, replace the following:

Account:
Load
AccountId,
AccountName,

From Account.qvd (QVD);

Transaction:
Load
TransactionId,
AccountId,
TransactionDate,

From Transaction.qvd (QVD);

With the following:


Account:
Load
AccountId,
AutoNumber(AccountId) As Join_Account,
AccountName,

From Account.qvd (QVD);

Transaction:
Load
TransactionId,
AutoNumber(AccountId) As Join_Account,
TransactionDate,

From Transaction.qvd (QVD);

The AccountId field still exists in the Account table for display
purposes, but the association is on the new numeric field,
Join_Account.

We will see later that there is some more subtlety to this that we
need to be aware of.
Resolving synthetic keys
A synthetic key, caused when tables are associated on two or more
fields, actually results in a whole new data table of keys within the
QlikView data model.

The following screenshot shows an example of a synthetic key using


Internal Table View within Table Viewer in QlikView:
In general, it is recommended to remove synthetic keys from your
data model by generating your own keys (for example, using
AutoNumber):

Load
AutoNumber(CountryID & '-' & CityID) As
ClientID,
Date,
Sales
From Fact.qvd (qvd);

The following screenshot shows the same model with the synthetic
key resolved using the AutoNumber method:
Another random document with
no related content on Scribd:
The Project Gutenberg eBook of Frankie's
dog Tony
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Frankie's dog Tony

Author: Madeline Leslie

Release date: November 4, 2023 [eBook #72019]

Language: English

Original publication: Chicago: Henry A. Sumner and Company, 1867

*** START OF THE PROJECT GUTENBERG EBOOK FRANKIE'S


DOG TONY ***
Transcriber's note: Unusual and inconsistent spelling is as
printed.

AUNT HATTIE'S LIBRARY

FRANKIE'S DOG TONY.


BY

AUNT HATTIE

[MADELINE LESLIE]

AUTHOR OF THE "BROOKSIDE SERIES," ETC., ETC.

"GO TO THE ANT, THOU SLUGGARD; CONSIDER HER


WAYS AND BE WISE."—Solomon.

CHICAGO:
HENRY A. SUMNER & COMPANY.
1880.

Entered, according to Act of Congress, in the year 1867, by


REV. A. R. BAKER,
In the Clerk's Office of the District Court for the District of
Massachusetts.
AUNT HATTIE'S LIBRARY
for Boys.

SERIES II.

VOL. I. THE APPLE BOYS.

VOL. II. THE CHEST OF TOOLS.

VOL. III. THE FACTORY BOY.

VOL. IV. FRANKIE'S DOG TONY.

VOL. V. THE GOLDEN RULE.

VOL. VI. LYING JIM.

AUNT HATTIE'S LIBRARY


for her Little Friends.

SERIES I.

VOL. I. THE SHEEP AND LAMBS.

VOL. II. LILY'S BIRTHDAY.

VOL. III. THE CHEST OF TOOLS.

VOL. IV. MAGGIE AND THE MICE.


VOL. V. THE LOST KITTY.

VOL. VI. IDA'S NEW SHOES.

To

NELLIE, ROLAND COTTON, ANNIE, AND FULLER


APPLETON,

CHILDREN OF MY BELOVED NEPHEW,

THE REV. JOHN COTTON SMITH, D.D.,

THESE SMALL VOLUMES ARE AFFECTIONATELY INSCRIBED,

WITH THE EARNEST PRAYER

THAT THEIR LIVES MAY PROVE THEM TO BE LAMBS IN THE FOLD

OF THE GREAT AND GOOD

Shepherd of Israel.

CONTENTS.

CHAPTER I. THE SOLDIER'S DOG

CHAPTER II. FRANK AND TONY


CHAPTER III. FRANKIE'S MUSIC LESSON

CHAPTER IV. FRANKIE'S NEW LESSON

CHAPTER V. THE STOLEN DOG

CHAPTER VI. TONY'S LOVE FOR HER MASTER

CHAPTER VII. CONCLUSION

FRANKIE'S DOG TONY.

CHAPTER I.
THE SOLDIER'S DOG.

DID you ever see a dog with a coat on? I am going to tell
you about one who was a great traveller. I think you will say
it was a remarkable dog, and will not be surprised that
Frank was very proud of her.

But first I must tell you who Frank was, and where he lived.

In the beautiful village of W—, a few miles from the city of


Boston, there was a lovely cottage almost covered with
woodbine, which had been trained over the walls. In this
cottage lived Mr. and Mrs. Colvin, with their two sons,
Edward and Frank.

Mr. Colvin had been a sea-captain, and in one of his


voyages, he brought home an English officer, who had been
wounded in the battle before Sebastopol. This gentleman,
whose name was Jameson, had a little dog Tony, who was
greatly attached to him. They ate together and slept
together, and wherever Colonel Jameson was, whether
walking the deck or sitting near the helmsman, or standing
in the door of the captain's office, there you would see Tony,
also.

One day the captain said,—

"Colonel Jameson, you seem very fond of your dog."

"Yes, sir," the gentleman answered, "and if you have time, I


will tell you where I found her."

"I should like to hear it," Captain Colvin answered.

"Well, sir. It was one day, just after a terrible battle; I was
making my way over the bloody field to see whether I could
find any of my comrades, when I heard a low moan, coming
from a tent. I went in and found a poor fellow with his arm
shot off. Some injury he had received on his head had made
him quite delirious. I tried to bathe the wound, but a little
puppy lying close to his side would not let me touch him."

"To make a long story short, the brave boy died a few days
later; but not until he had sent messages by me to his
widowed mother and sister at home, and had given me his
only treasure, his faithful friend Tony."

"I took her to my tent, and she has been true to me ever
since. In all the battles in which I afterwards engaged, Tony
was in my pocket. When I was wounded, she moaned until
she grew sick."

"We understand each other very well, don't we, Tony?" he


asked, turning to the dog.

"Bow! Wow!" barked Tony, in a joyful tone.

"She knows I have been talking about her. See how intently
she watches my every movement. Here, Tony, stand up and
shake hands with me."

The creature instantly raised herself on her hind feet, and


held out her right paw.

"Is that the hand you offer to a gentleman? Give me the


other," said the colonel.

But Tony knew she was right; and she continued holding out
her paw, till he said, laughing,—

"You think it's my mistake, then; excuse me, Tony."

Then the dog jumped on her master, and wagged her tail as
if she were very much pleased.

Before the voyage was over, Captain Colvin and Colonel


Jameson had become such good friends that the captain
insisted the other should go home with him.

At first, Frank was afraid of Tony, but in a day or two, he


grew to like her so much, that he was not content unless he
could have her to play with him.

It was surprising how quickly the dog learned to like her


new home. Her master could not now, as when he was on
shipboard, feed her from his plate at dinner; but after one
or two meals, she submitted very quietly and allowed
Frankie to feed her from a plate in the kitchen.

When company came in, Tony had to be dressed up as well


as anybody. I forgot to tell you that every morning her
master gave her a bath; and then she lay in the sun, and
licked herself dry.

Colonel Jameson was not an officer now; but he had saved


a piece of his uniform, which was bright-red broadcloth, and
a lady friend of his had made it into a coat for Tony, and
trimmed it with the gold cord of which the epaulets were
made.

Frankie laughed merrily when he first saw Tony sitting in a


chair with her coat on. She looked so prim and funny, as if
she thought herself very fine indeed.

The next day, he begged his mother to give him a collar,


which made the dog look funnier than ever.

I don't think Tony liked the linen collar, which was starched
very stiff; for she kept turning her head from one side to
another, and uttering a low kind of a growl. I think she
wanted to say,—

"Please, Frank, take off my collar. I'm a soldier's dog, and


not used to such things, you know."

But Frank thought the collar a great improvement, and told


Tony she must get used to it, if she expected to live in
genteel society.

By and by, Mrs. Colvin basted into the neck of the coat a
white frill, which had no starch in it. Tony was so much
pleased at this, that she began at once to lick the lady's
hand, and ever after considered her a good friend.
CHAPTER II.
FRANK AND TONY.

AFTER Colonel Jameson had stayed a month or so at the


cottage, and told his new friends all about the great battles
in which he had fought, he went to the city to find
employment. Tony, of course, went with him; and then poor
Frankie was so lonesome that he had two or three hearty
cries for his pet.

Mrs. Colvin told her husband she would try and find a dog
for Frank, he took so much comfort with Tony.

One day they went to the city, when, on calling at a friend's


house, there sat Colonel Jameson with his favorite in his
lap.

Every one could see that the love was not all on Frankie's
side, for Tony seemed almost out of her wits with joy. She
jumped up and down, giving short, joyful barks, and then
stopping a moment to lick his hands and kiss his face.

Frankie was delighted, and mother had to remind him twice


that he had not spoken to the lady of the house, before he
noticed that any one else was present.

Colonel Jameson laughed heartily when he saw what a


pleasant meeting it was. By and by he asked,—
"How would you like to take Tony home and keep her for
me?"

"O sir! I should like it very much, indeed. I would take nice
care of her, and let her go to school with me every day."

"I rather think the teacher would object to such a scholar,"


answered the gentleman, laughing.

He then told Mrs. Colvin that he had found some business,


and had a very good boarding-place; but they would not
consent to keep Tony. He felt very sad to part from the dog,
but as he found there were few boarding-houses, where a
dog was not considered a nuisance, he was willing Frankie
should take her, if his mother would consent.

It was some time before Tony could be made to understand


that she was to be separated from her master. When
Frankie called, she ran to him, but would instantly run back,
and catch hold of the Colonel's coat for him to come, too.

You may be sure that Mrs. Colvin did not like the officer any
the less because she saw a tear in his eye when he was
caressing the dog. She knew that he was thinking of all the
dangers they had encountered together, and also, how
desolate he should feel on going to his room at night, to
have no little friend there to welcome him.

At last, the lady where they were visiting proposed that the
Colonel should take advantage of the time when Frankie
was playing with the dog, and slip into another room, when
she would go with the boy more readily.

This he did; but Tony barked and ran to the door, scratching
with all her might to get it open. But when she found she
could not, she allowed her next loved friend to take her in
his arms and carry her away.
When they reached the cottage, she was delighted. She
would jump up into a chair by Frankie, or down again, just
as he bid her; but whenever the door opened, or she heard
a step on the walk, her ears would be cocked up, and she
would listen with all her might for her old master.

Frankie was very proud of his power over the dog, and was
continually showing his father, mother, and Edward how
quickly she understood and obeyed him.

At last it came time for the boy to go to bed.

He brought a shawl to wrap his baby in, and said he should


take her to bed with him as Colonel Jameson did. But Eddy
objected at once.

"I know just how it will be," he said; "Tony will bark and
wake us, and Frankie is such a sleepy head that he will not
get up to attend to her, and I shall have all the trouble with
her."

"No, no!" exclaimed Frankie; "I'll promise to keep her my


side, and take all the care of her."

Mrs. Colvin, however, thought it best to have a bed made


for Tony in the corner of the room, where she lay, wrapped
in the shawl, very quietly till morning.

The next day, when Frankie was getting ready for school, he
told his mother he was going to take Tony into the seat with
him.

"I am afraid your teacher will object, my dear," she said,


"and the dog will take your mind from your studies."

But the boy pleaded very earnestly that he might take her
once. "I want to show Willie Miles and George Holmes how
she obeys me," he exclaimed.

He came home at noon, just as his mother expected, very


indignant because the boys had tried to stone his pet.

"The teacher wouldn't let her stay in the school-room," he


exclaimed, his face growing very red, "though I told her
Tony would be perfectly quiet; and so I had to put her in the
entry, and when the boys went out at recess they teased
her dreadfully."

His mother comforted her boy by reminding him how


pleasant it would be for him to come home and have Tony
bark out her welcome. So that was the last of Tony's school
education.

Every day, though, she learned something new at home.


Even Captain Colvin took pains to teach her new and
cunning tricks. Whenever she wanted anything to eat, she
always stood up on her hind feet and asked for it, and then
she would bark out her thank you in the funniest manner
imaginable.

CHAPTER III.
FRANKIE'S MUSIC LESSON.

FRANKIE was generally a good boy; but sometimes, he did


not like to obey his mother, and tried to argue with her. This
is very naughty; for God has commanded children to obey
their parents promptly and cheerfully.

One morning, Frankie ran into the sitting-room, where his


mother was writing a letter, and said,—

"Ma, the boys are going to the woods for nuts,—may I go?"

"What time do they start, my dear?" she asked.

"Oh, we're going to get an early dinner! Ann can give me a


piece of pie, and I'll be off by one o'clock. Say, ma, may I
go?"

"But, Frankie, don't you remember you promised to carry


some yarn to poor Nancy? That must be done first."

"But, ma, I didn't know then that the boys were going to
the woods. I'll carry the yarn some other day."

"Poor Nancy is dependent on her knitting for her daily


bread, my son."

"Can't Edward carry it to her, then?"

"Edward has his drawing lesson."

Frankie began to look red and angry; but presently


brightened with the words,—"I'll run to Nancy's right away,
if you'll let me. Tony may go with me."

"Have you practised your music, my dear?"

The boy's face grew dark.

"No, ma, I haven't. I hate music, and I wish I never need


take another lesson, Mr. Lenox is so cross."
The lady looked grieved. "I can remember," she said, "when
a little boy begged his father to allow him to take lessons on
the piano; and, when his mother objected on account of the
time it would be necessary for him to practise, he
exclaimed,—"

"'Oh, you never need fear for me! I had rather learn music
than to play. I will promise to practise the lessons as much
as you wish me to.'"

"I didn't know then how hateful music was. I wish now I
need never see a piano again."

Mrs. Colvin was displeased to hear her son talk in this way,
and to see him look so angry. She raised her heart in prayer
to God that she might rightly train this darling child.

Presently she said, in a firm voice,—

"Frankie, go to the parlor and practise one hour by the


clock. Then, if you can run to Nancy's before dinner with the
yarn, I am willing you should join your companions in the
woods. But remember all depends on your prompt attention
to your music."

"It's lonesome in the parlor, ma."

"Your aunt is there sewing, and she will help you count the
time."

Frank went through the hall slowly, as if to an unpleasant


task; for every day he grew more neglectful of his practice,
and gave greater offence to his teacher. The piano was
already open; so, after spending four or five minutes in
finding the place in his book and pushing the music-stool
back and forth, he took his seat.
"How long are you going to practise," inquired his aunt, in a
cheerful voice.

"An hour," answered Frank, gloomily.

"Well, it's exactly ten now."

"But I've been here five minutes. I looked when I came in."

"Come, now, Frankie," urged the lady, "be a good boy, and
I'll help you. If you give your whole attention to it, you will
learn the lesson well in an hour."

Frankie's lingers Cell upon the keys; but his eyes had a
vacant look, and Aunt Sarah knew then, just as well as she
did at the end of the hour, that the time would be wasted.
She took up her book again, and the boy began to play over
and over one of his first lessons, which he could do without
any effort.

Five minutes more passed in this manner, when Tony poked


her nose through the crack of the door, which stood ajar,
and then made her way into the room, barking joyfully that
she had found her young master. This was a very good
excuse, the boy thought, for taking a recess; so down he
got from the stool, and had a fine romp with the dog on the
floor.

"Do you call that practising your lesson?" asked his aunt,
laughing.

"My fingers ache so," he began; but she interrupted him.

"I'll keep the time for you. Five minutes lost already."

Frankie suddenly recollected the nutting, and, seating


himself quickly, began to thumb over the same lesson
again.

"Now, Frankie, that's too bad!" she said, reprovingly. "Begin


on the new lesson. You have diddled that over and over till
I'm tired of it."

A merry laugh from behind the door made them both turn
in a hurry.

"Yes, Frankie, that's just it. You do nothing but diddle over
that one strain. I should think you would be ashamed of
yourself when pa's paying so much money for your
lessons."

"Now, Frank, I'm going to lay by my book, and attend to


you," said Aunt Sarah; "you must give your mind to it."

She drew a chair close to his side, and, pointing out the
notes, said, firmly, "Begin there!"

He did so, and for a short time picked out the notes quite
correctly, his aunt counting the time for him; but a slight
movement of Tony from the floor to the sofa, which she
thought would be an easier resting-place, upset him again.

"My head aches terribly," he exclaimed.

"You always say so," muttered Edward. "I wouldn't be such


a baby."

After this, it was quite in vain that Aunt Sarah tried to fix
his attention. He did indeed touch a few chords; but nothing
was accomplished. He complained continually that his head
ached.

It wanted fifteen minutes of eleven when his mother came


in.

You might also like