Qlikview
Qlikview
Qlikview
• Q&A
What do we mean by Data Model?
Traditional definition:
• A traditional data model is a
visual representation of the
people, places and things of
interest to a business and is
composed of symbols that
represent the concepts and
their business rules.
• QlikView builds a
smaller and more
reporting friendly
schema from the
transactional
database.
• This schema is
persistent and
reacts as a whole to
user “queries”.
• A selection affects
the entire schema.
QlikView is not SQL (Aggregation and
Granularity)
Store FloorArea Store Product Price Date
Store Sales A 1 $1.25 1/1/2010
Table A 1000 Table
A 2 $0.75 1/2/2010
B 800
A 3 $2.50 1/3/2010
B 1 $1.25 1/4/2010
B 2 $0.75 1/5/2010
Select * From Store, Sales Where Store.Store = Sales.Store will return:
Floor Store Product Price Date
Area
1000 A 1 $1.25 1/1/2010
1000 A 2 $0.75 1/2/2010
1000 A 3 $2.50 1/3/2010
800 B 1 $1.25 1/4/2010
800 B 2 $0.75 1/5/2010
Sum(FloorArea) will return: 4600
• Excel Files
• Delimited Files
• XML Files
• Web Files
• Database Connection
• Inline Data
• QVD
• Resident / Preceding Load
Qlikview Data Exchange
4
1.An ANSI JOIN
2.A Concatenated Key
3.Concatenated Tables
4.A Link table
Synthetic Keys Solutions - Join
Q: How do I avoid a synthetic key? - #1
Sales: Customer:
Load Load
Year, [Customer Number],
Month, [Customer Name]
[Customer Number], FROM Customer;
[Sales Amount]
FROM Sales; Problem!
• Not getting all the data from Budget table
LEFT JOIN Load results in missing months for the rest of the
Year, year
Month, • Even if joining the sales table to budget table,
[Customer Number], still missing customers’ activities who are not
[Budget Amount] budgeted
FROM Budget;
• May become a problem if tables don’t have a
one-to-one relationship
Synthetic Keys Solutions – Create key
Q: How do I avoid a synthetic key? - #2
Sales:
Load
Year,
Month,
[Customer Number],
[Sales Amount],
Null() as [Budget Amount]
FROM Sales;
Budget: Note:
Load • When QlikView finds multiple tables with
Year, the exact same fields, it combines them
Month, into one table automatically
[Customer Number],
Null() as [Sales Amount], • Create empty fields (dummy fields) using
[Budget Amount] null() function for missing ones in each
FROM Budget; table
Synthetic Keys
Q: What is the benefit of combining tables into one?
A: Yes. Its the single most widely utilised QlikView method for
resolving synthetic keys.
Example 1:
Most of the fields from each FACT table are not shared
How do I create a link table?
Sales:
Load
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as Key,
Year,
Month,
[Branch],
[Item Number],
[Customer Number],
[Invoice Number],
[Order Number],
[Salesman Number],
[Invoice Date],
[Sales Amount],
[Sales Qty],
[Cost Amount],
[Margin Amount],
[Unit of Measure]
FROM Sales;
How do I create a link table?
3. Create a new table with the same key
and the common fields separately
LinkTable:
Load DISTINCT
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as Key,
Year,
Month,
[Branch],
[Item Number]
FROM Sales;
How do I create a link table?
• If all the tables do not share the exact same fields,
create separate
create separate keys
keys for
for each
each table
table in
in the
the link
link table
table
Sales:
Load
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as Key,
SalesKey,
[Customer Number],
[Invoice Number],
…
[Margin Amount],
[Unit of Measure]
FROM Sales;
LinkTable:
Load DISTINCT
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as Key,
SalesKey,
Year,
Month,
[Branch],
[Item Number]
FROM Sales;
How do I create a link table?
Sales:
Load
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as SalesKey,
[Customer Number],
[Invoice Number],
…
[Margin Amount],
[Unit of Measure]
FROM Sales;
LinkTable:
Load DISTINCT
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as SalesKey,
Branch
Year, & ‘_’ & [Item Number] as InvKey,
Year
Month,& ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as POKey,
Year,
[Branch],
Month,
[Item Number]
[Branch],
FROM Sales;
[Item Number]
FROM Sales;
How do I create a link table? -
Final Scripts
Sales:
Load
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as SalesKey,
[Customer Number],
[Invoice Number],
[Order Number],
[Salesman Number],
[Invoice Date],
[Sales Amount],
[Sales Qty],
[Cost Amount],
[Margin Amount],
[Unit of Measure]
FROM Sales;
Inventory:
Load
Branch & ‘_’ & [Item Number] as InvKey,
[On Hand Qty]
FROM Inventory;
Purchasing:
Load
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as POKey,
[PO Number],
[Req Delv Date],
[PO Amount],
[Ordered Qty]
FROM Purchasing;
How do I create a link table? -
Final Scripts
LinkTable:
Load DISTINCT
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as SalesKey,
Branch & ‘_’ & [Item Number] as InvKey,
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as POKey,
Year,
Month,
[Branch],
[Item Number]
FROM Sales;
LinkTable:
Load DISTINCT
Null() & ‘_’ & Null() & Branch & ‘_’ & [Item Number] as SalesKey,
Branch & ‘_’ & [Item Number] as InvKey,
Null() & ‘_’ & Null() & Branch & ‘_’ & [Item Number] as POKey,
Null() as Year,
Null() as Month,
[Branch],
[Item Number]
FROM Inventory;
LinkTable:
Load DISTINCT
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as SalesKey,
Branch & ‘_’ & [Item Number] as InvKey,
Year & ‘_’ & Month & ‘_’ & Branch & ‘_’ & [Item Number] as POKey,
Year,
Month,
[Branch],
[Item Number]
FROM Purchasing;
How do I create a link table? –
Finished Result
Summary
2.
order to reduce flaking, stop if de-
normalising means replicating records
millions of times – the memory pointers
required to store the same value
enormous amounts of time now becomes
significant.
General Guidelines
3.
see if a concatenated solution meets the needs.
If transaction record traceability is crucial, rather
than analysis through association of common
dimensions, then look at whether a link table
would suit. If neither model is a good fit, a
custom data model must be delivered through
careful consideration of requirements and
iterative delivery. It may incorporate elements of
both link and concatenated tables.
General Guidelines
4.
data volume, complexity or concurrency of
user perspective, efficient QlikView
document design become increasingly
important. To this aim, please utilise the
tools at your disposal regarding
performance testing.
A Word about Requirements
• Joins
• Inner, Outer, Left, Right
• Keeps
• Inner, Left, Right
• Concatenate
• Master Calendar (Data Population)
• Mapping Table
• Transformation Wizard
• Cross Table
QlikView - Functions
QlikView - Functions
• IntervalMatch
• Aggregate Functions (Sum, Avg, Min, Max)
• Match Function (Match(), Wildmatch())
• Rank Function (Max(Field,1), Firstsortedvalue())
• Peek Function
• RangeSum Function
• Previous Function
Qlikview - Settings
• Document Properties
• User Preferences
• Sheet Properties
• Variable Overview
• Expression Overview