Designer Developer - Exercises QlikView
Designer Developer - Exercises QlikView
Exercises
www.pmd.com.mx
| Exercises
Table of contents
Ex. 1: Creating a Connection to the Database
Ex. 2: Loading Data
Ex. 3: Loading Additional Data
Ex. 4: Structuring the Script
Ex. 5: Orders and Order Details
Ex. 6: Loading a Text File in XML Format
Ex. 7: Qualify Statement
Ex. 8: Layout basics
Ex. 9: Sorting Data
Ex. 10: Creating Variables
Ex. 11: Master Calendar
Ex. 12: Adding Excel Files
Ex. 13: Creating Data in the Script
Ex. 14: Creating Quarters
Ex. 15: Reading the Shipments Table: Synthetic Keys
Ex. 16: Circular References
Ex. 17: Charts & Themes
Ex. 18: QVD Generation
Ex. 19: Mapping LOAD
Ex. 20: Cross Tables
Ex. 21: Condition on a Field in a Table
Ex. 22: Aggregation & Joining tables
Ex. 23: Concatenation
Ex. 24: Preceding Load on Preceding Load
Ex. 25: Set Analysis & MiniCharts
Ex. 26: Cyclic Groups
Ex. 27: Advanced Charts
Ex. 28: Buttons & Bookmarks
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
10. As you can see, the Shippers table has a field name in common with the Customers
table. The field CompanyName exists in both tables. In QlikView, any filed with the
same name will be linked. This field should not be a key field between these two
tables. We have to rename this field in one of the tables to avoid a connection
between these two tables. Put the cursor directly after CompanyName in the
Shippers table and rename this field to Shippers using the word AS. The script
should look like the following:
// *************** Shippers table ***************
Shippers:
LOAD CompanyName as Shippers,
ShipperID;
SQL SELECT *
FROM Shippers;
11. Save the document and Reload the script.
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
3. After the Suppliers table has been loaded, we must add the following statement so
that all the fields loaded after this one do not have the table qualifier.
UNQUALIFY *;
4. Save and Reload the document.
5. Open the Table Viewer. You will now see the results of adding the table name to
the field name.
www.pmd.com.mx
| Exercises
List Box
The list box is the most basic sheet object on the screen. It contains a list of all the possible
(distinct) values of a specific field. In a list box you often make selections and look at logical
connections and associations.
Table Box
Think of a table box as a combination of list boxes. Instead of placing each field in its own object
separately, however, the table box combines them. The content of every row is logically connected.
The columns may be fetched from different input tables, allowing the creation of tables from any
possible combination of input tables.
Multi Box
A multi box is like a set of dropdown list boxes gathered within the same frame. Every field is
represented by a row in the multi box. Multiple fields can be combined into a single multi box.
www.pmd.com.mx
| Exercises
Search Object
Search objects can be used for searching for information anywhere in the document. W e can select
certain fields or tables or allow a full search across the document.
Current Selections
The current selections box displays the selection status of your document. It is a good idea to place
a current selections box on every sheet in your application. The current selections box lists all fields
where selections have been made as well as the selected values or if there are too many of them
to display in the space allocated the number of selected values.
Text Object
Text objects are used for adding information to a QlikView document. They can be used to show
text information or an image in the layout. They can be moved and positioned anywhere on a sheet,
just like any other sheet object. Text objects can also be used effectively for displaying the results of
calculations, and to create backgrounds, borders and titles for groups of objects on a QlikView
page.
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
Sort
Presentation
Number
Actions
Type Sales Country in the Window Title field
Choose the Pie Chart icon
Add Country
Label: Sales
Definition: sum(LineSalesAmount)
Check the Relative Box
Check Y-value and select Descending
Maximum Number of Slices: 7
Check Show Numbers in Legend
Fixed to: 2 Decimals
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
| Exercises
www.pmd.com.mx
Exercises
Expression
Sum({$<Year={$(=Only(Year))}>} LineSalesAmount)
Sum({$<Year={$(=Only(Year)-1)}>} LineSalesAmount)
Sum({$<Year={$(=Only(Year))}>} LineSalesAmount) Sum({$<Year={$(=Only(Year)-1)}>} LineSalesAmount)
4. On the Visual Cues tab, make the negative values for the year-to-year comparison
red and the positive values green.
5. Return to the General tab and add a Calculation Condition to ensure that the user
selects a Year to begin the comparison by entering the following into the
Calculation Condition box:
Count(distinct [Year])=1
6. Click on the Error Messages button on the General tab and then on Calculation
Condition Unfulfilled in the Standard Messages list.
7. Type Select a Year to compare with a previous year in the Custom Message box
and click OK.
8. Create a new expression and name it Trend
=sum({1}LineSalesAmount)
9. In the Display Options choose Mini Chart and click the Mini Chart Settings button
10. Select Year as the Dimension and Sparkline as the Mode.
11. Save your file
www.pmd.com.mx
| Exercises
Expression
=sum(LineSalesAmount)
# orders
Margin
=count(OrderID)
=sum(Margin)/sum(LineSalesAmount)
=Sum(LineSalesAmount)/Count(DISTINCT
OrderID)
5. A Cyclic Group is used to check the same expressions over multiple dimensions
(one at a time). In the chart there is a button next to the dimension label. If you
click it, you can change between country, company and Sales person and analyze
its sales data.
www.pmd.com.mx
| Exercises
Expression
=sum(LineSalesAmount)
=sum(Margin)
=sum(Margin)/sum(LineSalesAmount)
Display Options
Bar
Line
Symbol (Cross)
Radar Chart
7. Create a new Radar Chart with Month as dimension and sum(LineSalesAmount) as
the expression. This will represent the distribution of the sales in different months.
Gauge
8. Create a new Gauge Chart
9. In the Show Title in Chart textbox (General tab) type:
=num(sum(Margin)/sum(LineSalesAmount)*100, '0.00%')
www.pmd.com.mx
| Exercises
10. Click Next in the Dimension tab (Gauges are dimensionless charts) and for the
expression type:
=sum(Margin)/sum(LineSalesAmount)
11. In the Presentation tab set the Max value to .3, uncheck the Autowidth Segments
option and specify the following segments:
Segment
Bad
Medium
OK
Color
Red
Yellow
Green
Lower Bound
0.0
0.05
0.1
Cyclic Charts
12. Return to the Sales Tab and go to the pie chart properties.
13. In the General Tab check Pie Chart and Block Chart.
14. There is a new icon in the charts caption. If you click it, the chart with toggle
between the types selected.
Ex. 28: Buttons & Bookmarks
1. Create a new Button Object.
2. In the name textbox type Clear .
3. In the next tab add a new action: Selection Clear All.
4. There are a number of different actions, try some of them.
5. Insert a new Bookmark Object.
6. Make any selections and click Add Bookmark.
7. Every time you select that bookmark those selections will be presented.
www.pmd.com.mx