Вы находитесь на странице: 1из 15

Keyboard Shortcuts in QlikView :

Ctrl+R-> Reload
Ctrl+E-> Edit Script
Ctrl+T-> Table Viewer
Ctrl+Alt+V-> Variable overview
Ctrl+Alt+E-> Expression overview
Ctrl+Alt+S->Sheet Properties window
Alt+Enter->Sheet O!ECT Properties window
"oldin# CTR$+ob%ect will leads to copy to another sheet..
"oldin# CTR$+Shi&t+ob%ect will leads to creating the link ob%ect to another sheet..
Load types:
. !ain Load -- "hich loads #ro$ any #ile%data base in Edit script&'trl(E)
*. Resident load -- +etching so$e o# #ields #ro$ $ain table and creating new
resident table.
,. -nline load -- 'reating a table in .li/view itsel#.
0. 1inary Load -- "hich appends existing .V" #ile with new code
Short c2ts:
. Edit script 3 'trl ( E -- "hich is 2sed to load data #ro$ any #or$at data. +or
this we are 2sing this.
*. Reload 3 'trl (R -- "hich loads&Re#reshes) the data into 4li/view engine
,. Table Viewer 3 'trl ( T -- 5aving Sche$a design &62to$atically detects the
relation b%w table i# sa$e col2$n exists in $2ltiple tables with sa$e na$e)
'i&&erent ways to load data in to Qlik(iew)
Introduction:
There are di##erent ways and $ethods to load data into .li/view. Explained below with
exa$ples and 2ses o# $ethods o# loading data into 4li/view.
Ty*es)
. Loading data #ro$ the #ile.
*. -nline Load
,. Resident Load
0. -ncre$ental Load
7. 1inary Load
8. 6dd Load
9. 12##er Load
. +, $oadin# 'ata &ro- .ile)
This $ethod is nor$al $ethod o# loading data into the .li/view application.
Load data #ro$ #iles li/e Excel:!S;1:'SV:Txt #iles etc.: can be done by creating
<;1' and connecting to yo2r database directly.
E/a-*le)
L<6; 6: 1
+R<!
=':>#ilena$e.xls? &bi##: e$bedded labels: table is ;ata@)A
. 0, 1nline $oad)
The second $ethod o# loading is -nline Load where the 2ser can de#ine their own
data and load within .li/view.
The -nline data can be de#ined in the inline ;ata "iBard .
-nsertCLoad ;ataC -nline ;ata.
E/a-*le)
L<6; D -EL-EE =
6
1
'
?A
. 2, Resident $oad)
Loading data #ro$ already loaded .li/view table is possible 2sing Resident Load.
Trans#or$ations and 'alc2lations can be per#or$ed in the resident load script.
Loading a existing #ield or a s2cceeding table is possible too.
E/a-*le)
E$ployees:
Select E$pna$e:
5ire;ate:
Salary:
-ncentives
+ro$ E$ployeeA
Load E$pna$e:
!onth&5ire;ate):
Salary ( -ncentives as FGrossSalaryH
Resident E$ployeesA
3, 1ncre-ental $oad)
-ncre$ental load is 2sed to load only the new or changed records.
-t will be very help#2ll where a database is big.
This involves loading old data #ro$ the .V; and new records #ro$ the database and
co$bine into single .V;.
E/a-*le)
S.L SELE'T Pri$aryIey: J: K +R<! ;1LT61LE
"5ERE !odi#icationTi$e >M N@&LastExecTi$e)N
6E; !odi#icationTi$e O N@&1eginningThisExecTi$e)NA
'oncatenate L<6; Pri$aryIey: J: K +R<! +ile..V;A
ST<RE .VLTable -ET< +ile..V;A
. 4, inary $oad)
Loading data #ro$ one 4li/view #ile is called 1inary Loading. The data $odel o# one .V" #ile
is copied #ro$ R6! to dis/ in Ps and s #or another 4vw #ile.
This 1inary Load will be $ore 2se#2ll when yo2 want to enhance the already b2ilt 4vw with
the sa$e $etrices de#ined.?
1inary Load is 2sed to hide the scripts #ro$ Qsers. +irst one .li/view #ile with all the
scripts re42ired #or the reports are created and then binary load this into another #ile
by 2sing
Script -> .li/view +ile -> Select the .li/view #ile created earlier.
Ko2 can load only one 4li/view #ile by 2sing 1inary load. 1y 2sing this 1inary Load
Scripts are hidden #ro$ 2sers.
E/a-*le)
1inary c:>order.4vwA
. 5, Add $oad)
6dd Load is 2sed to append or concatenate the data #ro$ one table to other table. ;2ring a
partial reload the .li/View table: #or which a table na$e is generated by the add load%add
select state$ent &provided s2ch a table exists): will be appended with the res2lt o# the add
load%add select state$ent.
Since it wont chec/ #or d2plicates: it is re42ired 2s s2itable where condition in the script.
E/a-*le)
L<6; EE<: EE6!E #ro$ E$ployees.csvA
6;; L<6; EE<: EE6!E #ro$ E$ployees.csv "here Eot Exists&EE<)A
. 6, u&&er $oad)
12##er load helps to create the .V; #iles a2to$atically. The created .V; will be $aintained
as de#ined in Qser Pre#erencesC Locations.
E/a-*le) 12##er select D #ro$ E$ployees.csvA
Synthetic Keys and Synthetic Table)
-# yo2 #ind $ore than one co$$on #ields it will leads to synthetic /eys. The table
which shows the synthetic /eys that we call it as Synthetic Table.
"ow to re-o(e synthetic keys)
. Roins
*. 'oncatenate
,. 'o$$enting
0. Rena$ing the #ields
7. .2ali#y S Qn-.2ali#y
!oins)
The .li/View script #2nctions R<-E: IEEP and '<E'6TEE6TE can so$eti$es be
2sed to solve the sa$e proble$: b2t there are i$portant di##erences that sho2ld be
2nderstood.
Exa$ine the sa$ple tables below. Eote that they share one co$$on #ield na$e:
TIeyT.
6lso note that Table has a Iey val2e T,T that is not present in Table* and that
Table* has a /ey 0 that is not present in Table.

Table Table*
Iey 6 Iey '
6 '
*6* *'*
,6,
0'0
Ty*e o& !oins)
R<-E will co$bine rows where the Iey val2e $atches.
The /eyword <QTER will also retain rows that do not $atch rows in the other
table.
The /eyword LE+T will retain rows #ro$ the le#t table b2t only $atching rows
#ro$ the right table
The /eyword R-G5T will retain rows #ro$ the right table b2t only $atching
rows #ro$ the le#t table
The /eyword -EEER will retain rows $atching the le#t table and right table

!oins
5ereUs what the $erged table will loo/ li/e a#ter the di##erent Voin $ethods.
Eote that .li/View $erge the two tables a#ter a Roin.
Eote: The explicit Voin /eyword &M <2ter Roin) in .li/View script lang2age per#or$s a
#2ll Voin o# the two tables. The res2lt is one table. -n $any cases s2ch Voins will res2lt
in very large tables. <ne o# the $ain #eat2res o# .li/View is its ability to $a/e
associations between tables instead o# Voining the$: which greatly red2ces $e$ory
2sage: increases processing speed and o##ers enor$o2s #lexibility. Explicit Voins
sho2ld there#ore be generally avoided in .li/View scripts. The /eep #2nctionality was
designed to red2ce the n2$ber o# cases where yo2 need to 2se explicit Voins
<QTER R<-E &Table) LE+T R<-E &Table)
Iey 6 ' Iey 6 '
6 ' 6 '
*6* '* *6* '*
,6, - ,6, -
0- '0


R-G5T R<-E &Table) -EEER R<-E &Table)
Iey 6 ' Iey 6 '
6 ' 6 '
*6* '* * 6* '*
0- '0
Kee*
The /eep pre#ix between two load or select state$ents has the e##ect o# red2cing
one or both o# the two tables be#ore they are stored in .li/View: based on the
intersection o# table data. The /eep /eyword $2st always be preceded by one o# the
pre#ixes inner:le#t or right. The selection o# records #ro$ the tables is $ade in the
sa$e way as in a corresponding Voin.
5owever: the two tables are not Voined and will be stored in .li/View as two
separately named tables.

LE+T IEEP
Table Table*
Iey 6 Iey '
6 '
*6* *'*
,6, ,-

R-G5T IEEP
Table Table*
Iey 6 Iey '
6 '
*6* *'*
0- 0'0


-EEER IEEP
Table Table*
Iey 6 Iey '
6 '
*6* *'*

Concatenate
Eow letUs loo/ at 'oncatenate. 'oncatenate appends the rows o# one table to
another. 'oncatenate never $erges any rows. The n2$ber o# rows in a
concatenated table is always the s2$ o# the rows #ro$ the two inp2t tables. 5ereUs
what o2r sa$ple data will loo/ li/e a#ter 'oncatenate.

'<E'6TEE6TE &Table) L<6; D RES-;EET Table*A

Iey 6 '
6
'
*6*
* '*
,6,
0 '0
Rows with li/e Iey val2es are not $erged together. The rows #ro$ Table* are
si$ply appended to Table. 1eca2se the tables have di##erent #ields: rows will have
n2ll val2es #or the #ields #ro$ the TotherT table.
Quali&y and 7n8uali&y)
.2ali#y state$ents rena$es all the #ields with the table na$e pre#ix which are $entioned in
the state$ent.
.Q6L-+K DA it can be 2sed above the table na$e. D is to rena$e all the #ield na$e in the
table.
<therwise 2 can also speci#y each #ield that 2 wanted to rena$e.
QE.Q6L-+K is reverse process o# .Q6L-+K state$ent.
-# 2 r not 2sing the QE.Q6L-+K state$ent a#ter 2sing .Q6L-+K: it ll rena$e all #ields o# all
the table below the .Q6L-+K.
.Q6L-+K DA %%or .Q6L-+K <rder-;: '2sto$erEa$eA
<rders: %%Table Ea$e
L<6; <rder-;:
<rderEa$e:
'2sto$erEa$e:
+R<! xxx.xlsA
QE.Q6L-+K DA
-# 2 2se D then: 2r #ields ll be li/e this:
<rders.<rder-;
<rders.<rderEa$e
<rders.'2sto$erEa$e

-# not 2sing D: it ll rena$e oly the #ields 2 have $entioned.
a good way to 2se .Q6L-+K and QE.Q6L-+K to bring in new tables and yo2 want
to lin/ on one /nown #ield: b2t yo2 arenUt s2re whether yo2 will have na$e clashes
with the rest.

.Q6L-+K DA
QE.Q6L-+K <rder-;A
<rders:
L<6; <rder-;:
<rderEa$e:
'2sto$erEa$e:
+R<! xxx.xlsA

QE.Q6L-+K DA
This will res2lt in a table with #ields li/e this:
<rder-;
<rders.<rderEa$e
<rders.'2sto$erEa$e
1-* State-ents
+9 !O1:->Le#t:Right:<2ter&;e#a2lt):inner
09 KEE;&Le#t:Right:<2ter&;e#a2lt):inner)
Sa$e as Voin: b2t it /eeps both the so2rce table <1T" =O'1.1CAT1O: ie.: -t #ilters data
over tables depending 2pon on the Voin
29 CO:CATE:ATE)
Eo $atter what: it si$ply appends all the rows to the concatenated table within the
appropriate #ieldWW
39 :OCO:CATE:ATE) explicitly speci#ying that: there S"O7$' :OT E any
concatenation even tho2gh there are si$ilar #ieldsWW
49 =A;;1:>) -ts V2st a sort o# re#erence table: thereby val2es can #etched #ro$ that $apping
table which can have only * #ields&<ne #or loo/ 2p and another #or the #etch able state$ents)
59 CO==E:T TA$E ? .1E$')
'<!!EET T61LE =Tab Ea$e? "-T5 U 5ai how r 2UA
'<!!EET +-EL; =+ield Ea$e? "-T5 U 5ai how r 2UA
Concatenate happens in di##erent ways.
. 62to$atic 'oncatenation
*. +orced 'oncatenation
,. Eo 'oncatenation
In this Part 1 i will cover Automatic Concatenation
Auto-atic Concatenation
6s stated above:when #ield na$es and #ield n2$bers o# * or $ore tables is sa$e
then the tables are concatenated into one table. <rder o# the col2$ns in tables does
not $atter. 6lso The S2$ o# records in the res2lting table is the S2$ o# the n2$ber
o# records in Table and Table *.
Let 2s load #irst table and see it in the table viewer




6s yo2 can see that this table has #ollowing 0 rows.
Let 2s now load * tables: with sa$e na$e and n2$ber o# col2$ns.
Table '2stL has 0 rows and table '2stL* has , rows. <rder o# col2$ns are
di##erent.
<bserve Table viewer and n2$ber o# rows in the res2lting table.








6s yo2 can see the n2$ber o# rows in the res2lting table is 9 rows. The S2$ o#
records in the res2lting table is the S2$ o# the n2$ber o# records in Table and
Table *.
+or details on .orced Concatenation and ;re(entin# Concatenation: please visit
'oncatenate
.orced Concatenation
-# two or $ore tables do not have exactly sa$e na$e and n2$ber o# #ields: it is still
possible to concatenate the$ by 2sing
concatenate /eyword be#ore the load state$ent.
Let 2s load * tables with di##erent sets o# #ields







'oncatenation do not occ2r as Tables have di##erent set o# #ields.

Eow to #orce concatenation 2se 'oncatenate /ey word be#ore the load o# second
table







<bserve that the tables are concatenated and n2$bers o# rows is 9 i.e. S2$ o# rows
in Table and Table*.
;re(entin# Concatenation
-# the #ield na$es and n2$ber is sa$e in * or $ore tables the$ .li/View per#or$s
an a2to$atic concatenation b2t it is possible to prevent this a2to$atic concatenation
by 2sing :oConcatenate
Let 2s load the sa$e tables as in Part i.e. Table '2stL and '2stL*. These tables
have sa$e set o# #ields so they sho2ld get concatenated b2t this ti$e load the$ by
2sing Eo'oncatenate









Table viewer shows * tables. 62to$atic concatenation was prevented by 2sing
Eo'oncatenate.
Eote that * tables are created b2t since they have $ore than one #ield in co$$on: it
created a synthetic table. Resolving synthetic table and /eys is a di##erent topic and
yo2 can get details on it #ro$ $y earlier blog on XResolving synthetic /eysY.
+or this excercise we wanted to see that 2sing Eo'oncatenate we can avoid
a2to$atic concatenation.
Su--ary )
. 62to$atic concatenation occ2rs when the na$e and n2$ber o# #ields are sa$e in
* or $ore tables
*. +orced concatenation is done by 2sing 'oncatenate /eyword. -t will concatenate
tables even i# they do not have sa$e set o# #ields
,. Eo 'oncatenate can be 2sed to prevent a2to$atic concatenation: even i# tables
have sa$e set o# #ields.

Вам также может понравиться