Читать книгу QlikView Your Business - Troyansky Oleg - Страница 15
II
Learning the Core Techniques: Sales Analysis
Chapter 4
Visualizing Sales Analysis in QlikView
Preparing the Environment and Getting Ready
ОглавлениеIn this section, you open the template document and make some initial preparations. You will learn about the following:
● Opening and saving QlikView documents
● Utilizing user settings to save your work automatically
● Creating and working with sheets
● Defining colors in QlikView
If you haven’t installed the book’s electronic materials yet, please revisit the Introduction and follow detailed instructions for preparing your work environment for this book’s tutorial. You need to download and install QlikView and Qlik Sense, download our electronic materials, and preferably install our font. We described all the necessary preparations at the end of the Introduction.
Opening a Template Document
The first step in developing any QlikView document is opening the QlikView Developer tool from the Windows Start menu. Going forward, we refer to it simply as QlikView, for simplicity.
QlikView opens with a default start page that provides quick access to Examples, Recent Documents, and Favorites. Other than that, QlikView is a standard Windows application, with the familiar menu, toolbars, and other attributes of Windows applications. QlikView documents can be opened, saved, and managed overall in the same way you manage MS Office documents.
We will highlight now a few specific options within QlikView menus that are important at the beginning. You’ll discover more options when they become relevant to your development.
The View menu offers a few helpful commands that deal with zooming, sizing the window, and other options. You will use the View menu to enable the Design toolbar, which is extremely useful for designing visualizations.
The Settings menu contains User Preferences, Document Properties, and a few other useful commands (some of those commands are only available when a document is opened). For your current purposes, you will use User Preferences to define the Auto Saving settings, which will help you preserve your work in case of any failures. Feel free to browse other settings on your own. We will just mention that Document Properties describe settings for the current document, and they follow the document wherever it needs to go. Conversely, User Preferences store settings that describe your individual preferences as a developer and a user of QlikView. Those settings remain local and apply to all the documents that you work with. In the following exercise you set the user preferences for the sales analysis document that you downloaded for this chapter.
Exercise 4.1: Opening the Sales Analysis Document
1. Open QlikView.
2. In QlikView, open an existing document using the menu command File⇒Open. Navigate to the folder
\QlikView Your Business\Apps
, and open the documentSales Analysis Template.QVW
.3. Create your own version of the document by using File⇒Save As… and replacing the word
Template
with your initials.4. Navigate to the View⇒Toolbars menu and enable the Design toolbar. Now you should see a second row of icons added below the Standard toolbar.
5. Navigate to Settings⇒Document Properties, open the General tab and verify that Sheet Object Style is set to Transparent. In the Presentation tab, verify that Default Theme for New Objects is set to NS_Flat.qvt. If it’s set to [None], navigate to the folder
\QlikView Your Business\Resources\Themes\
and select the theme file from there. This might happen if you installed your book materials under a different path.6. Navigate to Settings⇒User Preferences, open the Save tab, and check the first three check boxes– Save Before Reload, After Reload, and Every 30 Minutes(see Figure 4-1, points 5-7). If your computer should crash for any reason, you will not lose more than the last 30 minutes of your work. Once you open QlikView again, you will be offered a chance to recover the document from the automatically saved copy.
Figure 4-1 presents some of the basic elements of the QlikView environment – the main menu (1), the main toolbar (2), the Design toolbar that you just enabled (3), and the User Preferences window, opened on the Save tab (4), with the three checkboxes that we recommended you check (5-7).
Figure 4-1: QlikView menus, toolbars, and user preferences
Sheets and Sheet Objects
QlikView visualizations are called sheet objects, and they are kept in sheets. By default, each new application is created with a single sheet called Main. Developers can rename the Main sheet and add more sheets as needed for the application. There is no technical limitation to the number of sheets, but it’s advised to keep the number of sheets manageable, to avoid unnecessary clutter.
Creating a new sheet is simple. You can use Layout ⇒ Add Sheet or simply click on the first icon on the Design toolbar. Both options are shown in Figure 4-2.
Figure 4-2: Adding new sheets
When multiple sheets exist, they can be moved up or down the list using the Promote Sheet and Demote Sheet options (either in the Layout menu or with the toolbar icons).
New sheets are created with a full set of default properties, inherited from the Document Properties. The properties can be accessed and modified as needed, by right-clicking on the sheet (any empty space on the screen) and selecting Properties from the context menu. For example, the Title of the sheet is the first attribute that you need to change, unless you like using default titles Sheet1, Sheet2, and so on. As an alternative, you can access the Sheet Properties by using the toolbar icon Sheet Properties, located in the Design toolbar, next to the Promote and Demotebuttons.
Fortunately, not too many Sheet Properties need to be adjusted. For the most part, it’s recommended to accept the document defaults, in order to keep the look and feel of the sheets consistent. For this reason, we are going to cancel our scheduled 45-minute tour around the detailed list of all Sheet Properties. You will instead discover each setting as it comes up.
About Tabs and Tabrow
Sheet titles appear on the tabs on top of the screen. The area that hosts all the tabs is called the tabrow. When you right-click on the tab of an active sheet, you get a choice of either Tabrow Properties or Sheet Properties. You usually need to access Sheet Properties. You may notice that Sheet Properties are not available when you right-click on the tab of an inactive sheet, hence you need to activate the sheet before you can access its properties.
Exercise 4.2: Creating and Renaming New Sheets
1. Add a new sheet by clicking on the Add Sheet toolbar icon in the Design toolbar or by selecting the Layout⇒Add Sheet menu option.
2. Now you should have two sheets – Main and Sheet1. Rename the two sheets to Template and Sales. In order to rename a sheet, do the following (see Figure 4-3):
Figure 4-3: Accessing sheet properties
a. Click on the sheet label to activate it (1).
b. Right-click anywhere on the empty space (2)
c. Select Properties from the context menu (3).
d. Find the Title field on top of the General tab and replace the default title with the new one (4).
Working with Colors in QlikView
Every pixel on a QlikView sheet is painted in a certain color, and each one of those colors is configurable through dozens of properties – text colors, line colors, background colors, and so on. This section describes the process of defining a color in QlikView, and you will use the same process every time you need to define another color.
All the colors in QlikView are defined in a similar way. Let’s examine Figure 4-4, which describes the process of defining a default background color for the document.
Figure 4-4: Defining a color in QlikView
The Background Color setting appears as a button with the same color that it describes (A). Once you click on the button, QlikView opens the Color Area window.
Each color area can be defined with a solid color or two types of gradient colors (B). The base color is presented with a similar button (C). Clicking on this button leads to the Color window, which allows picking the color itself.
The color can be picked from 48 basic colors or from a continuous palette on the right, or it can be entered manually as a combination of HSL numbers or RGB numbers. Most organizations are very particular about their branding colors, and it’s good to identify those and use them in your layouts. To help with this process, QlikView offers a selection of up to 16 custom colors that can be saved for easy retrieval in the future.
As an alternative to selecting the color manually, the color can be also defined as calculated (Figure 4-4, E). You will learn more about calculated colors in Chapters 8 and 12. In the following exercise, you define the default Background Color and the Tab Text Color.
Exercise 4.3: Defining Colors
1. Open Settings⇒Document Properties, then click the General tab and locate Background Color.
2. Experiment with the Background Color settings. Set the background to the Two Color Gradient, using your high school’s colors as a base.
3. Once you’ve had enough fun, scratch it off and replace the background color with a solid color of pure white.4. Open Sheet Properties, select the General tab, and locate the setting for the Tab Text Color. Set the color to RGB(0,100,200). Throughout the book, we will be using this format for red-green-blue color definitions. It corresponds to red: 0, green: 100, and blue: 200. The RGB numbers can be entered in the lower-right corner of the Color dialog
3.
At this time, the sheets are ready to be filled with sheet objects. Let’s begin filling them up, starting from simple objects and continuing on to charts and gauges.