Introduction
In QlikView, a preceding load is a very important and powerful functionality for transforming the data.
What is preceding load
The preceding load can be used to define multiple calculations and transformations within one load script. The preceding load takes input from a previous select statement. Preceding load is invoked by checking "preceding load" while selecting load statements. There is a direct option for preceding load when making the connectivity with ODBC or OLEDB. That is the main difference between a preceding load and a resident load. In a preceding load, transformations and calculations are performed within one load script but in resident load all transformation and calculations are performed in an existing field and succeeded table.
Basically a preceding load is also known as a select statement because that loads data from the load and select statement.
Why is a preceding load evaluated first?
The main reason is that the select statement is closest to the source data and select statement evaluated first so the preceding load is evaluated first. You see in this figure that the select statement is closest to input (source data), so we can say that a preceding load is evaluated first.
Advantage
- The main advantage of a preceding load is that it allows you to use QlikView functions in the load script.
- By using a preceding load you don't need to perform the same calculation in several places.
Now I discussed in this article, the power of a preceding load in QlikView.
Step 1: Open the QlikView application
In the first step you need to open the QlikView application then go to, File-> New, then this window will be opened.
Step 2: Open Edit Script
The second step is open the edit script window from File-> Edit Script.
- Then this window will be opened.
Step 3: Click on table files
Now open the table file and click on the Open button.
Step 4: File wizard type
Then this window will be opened. Here you can see your table file table and click on the Finish button.
Step 5: Code of edit script
Now, in the edit script the web file upload was successful and reload it.
- [Preceding Load]:
- Load
- Sum ([Sum of Calculation]) as [Total Sum],
- [Month Year]
- Group by [Month Year];
- LOAD [% of world population],
- [Country (or dependent territory)],
- Population,
- Rank,
- Source,
- Population * Rank as [Sum of Calculation],
- Month(Date(Date)) &'-'& Year(Date(Date)) as [Month Year]
- FROM
- [\\MCNSERVER2\UserProfiles\ptiwari\Desktop\Excel file.xls]
- (biff, embedded labels, table is Sheet1$);
-
-
Step 6: Save file
The next step is to save our QlikView file.
Step 7: Sheet property window
The sheet property window will be opened. In this window you add fields that you want to display as a table and click on the
OK button.
Now you will see this window.
Step 8: Open edit script
Now the next step is to open the edit script again and perform code for the resident load and then reload it.
Step 9: Sheet property window
The sheet property window will be opened. In this window you add fields that you want to display as a table and click on the
OK button.
Now you can see the total sum of rank and population and using a group by clause in the preceding load it shows only month year field.
Summary
This article provides an introduction to preceding load in QlikView applications and also describes how it will work in QlikView applications.