Preceding Load in QlikView

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.

Picture1

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.

After clicking New option

Step 2: Open Edit Script

The second step is open the edit script window from File-> Edit Script.

window of edit script

  • Then this window will be opened.

    window

Step 3: Click on table files

tablef

Now open the table file and click on the Open button.

local file

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.

File wizard

Step 5: Code of edit script

Now, in the edit script the web file upload was successful and reload it.

reload

  1. [Preceding Load]:  
  2. Load  
  3. Sum ([Sum of Calculation]) as [Total Sum],  
  4. [Month Year]  
  5. Group by [Month Year];  
  6. LOAD [% of world population],   
  7.      [Country (or dependent territory)],   
  8.      Population,   
  9.      Rank,   
  10.      Source,  
  11.      Population * Rank as [Sum of Calculation],  
  12.    Month(Date(Date)) &'-'Year(Date(Date)) as [Month Year]  
  13. FROM  
  14. [\\MCNSERVER2\UserProfiles\ptiwari\Desktop\Excel file.xls]  
  15. (biff, embedded labels, table is Sheet1$);  
  16.   
  17.    
Step 6: Save file

The next step is to save our QlikView file.

save 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.

sheet

Now you will see this window.

main 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.

reloading

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.

sheet1

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.

final 1

Summary

This article provides an introduction to preceding load in QlikView applications and also describes how it will work in QlikView applications.

 


Similar Articles