Databases Reference
In-Depth Information
Getting it done
First, how do we find the total change in number of employees for this month
compared to the last? Well, we take the number of employees in the current month
and subtract the number of employees we had in the previous month. If the number
is zero, it means there was no change (no one fired!), if the number is greater than
zero, it means we have new hires in the house; last, and hopefully the least, if the
number is less than zero, it means we will be missing some colleagues.
To add this field to our
Employment Statistics
table, and following the best
practices we previously discussed, we will create a new QlikView document, used
for transformations, and save it inside the
2.Workbooks
folder. Name this file as
Transform-Employment Data.qvw
. The resulting table will then be saved as QVD
inside the
3.QVD\Transformed
folder.
Loading the table
Once you have the new QlikView document created, saved and still open, go to the
Edit Script
window (
Ctrl
+
E
) and perform the following steps:
1.
Add a new tab to the script by clicking on the
Tab
menu and selecting
Add Tab…
.
2.
From the
Tab Rename Dialog
window, type
Initial Load
as the name of
the new tab and click on
OK
.
3.
Use the
File Wizard
dialog to load the
Employment Statistics
table from
the corresponding QVD file (
T_F41SCHEDULE_P1A_EMP.qvd)
stored in
the
3.QVD\Source
folder.
4.
Click on
Finish
on the first dialog window of the
File Wizard
dialog since no
alterations will be made to the file on the initial load.
5.
Assign the table a name by typing
Temp_Employment:
before the
Load
keyword of the generated script. Remove the
Directory;
statement
if necessary.
6.
Now, add a new tab to the right of the
Initial Load
tab, by clicking on
Add
Tab…
from the
Tab
menu.
7.
In the
Tab Rename Dialog
window, type
Transformation
as the name of
the tab and click on
OK
.