Preceding load in QlikView

Preceding Load is a very powerful functionality in QlikView in transforming the data.

What is Preceding load

It allows you to define multiple transformations and calculations within one load script which would otherwise will need to be created using separate load and resident load statements.

It takes input from the previous Select statement.

Preceding Load is invoked by checking the “preceding load ” while selecting the tables.

Another Advantage of Preceding Load is that it allows you to use QlikView functions in the Load script.

Let us see how your script will look when you don’t check the “preceding Load” while selecting the table.

PrecedingLoad1

Preceding Load not checked

 

PrecedingLoad2

Load Statement without Preceding Load

Loading table without preceding load will not allow you to use QlikView functions.

Now let us check “Preceding load” and see how the load script changes and what advantages it brings.

PrecedingLoad_check

PrecedingLoad3

Load statement after checking “preceding load” check box

In this script you can see that preceding load takes the input from the previous Select Statement. You can select all the columns in the Select statement but in Load statement you can select the ones you need. Also observe Year and Month Calculations. Preceding Load allows you to use QlikView functions like Year,Month,ApplyMap etc.

There can be multiple preceding loads stacked one on the top of other.

PrecedingLoad4

Preceding load can be a useful tool to simplify your data transformations.

6 thoughts on “Preceding load in QlikView

  1. excellent and it is very clear explation inever saw in any another blogs

    • Chandraish says:

      Venkat:
      Hope this topic was useful for you.
      Though i was unable to understand your comment. Are you expecting something or am i missing something.

  2. i am try to try multi load statement just above the SQL statement.
    and it fails while reloading

    —my script contains
    load year(UPDATED_DATE) AS YEAR1;
    LOAD MONTH(CREATED_DATE) AS DATEE;
    SQL SELECT
    “PRIMARY_KEY”,
    “CREATED_DATE”,
    “UPDATED_DATE”,
    YEAR,
    MONTH,
    “AIRCRAFT_TYPE_ID”,
    “DEPARTURES_SCHEDULED”,
    “DEPARTURES_PERFORMED”,
    “AVAILABLE_SEATS”,
    “TRANSPORTED_PASSENGERS”,
    “TRANSPORTED_FREIGHT”
    FROM SCOTT.”FLIGHT_DATA_1″;

    —- below is error after reload
    Field not found –
    SQL SELECT
    “PRIMARY_KEY”,
    “CREATED_DATE”,
    “UPDATED_DATE”,
    YEAR,
    MONTH,
    “AIRCRAFT_TYPE_ID”,
    “DEPARTURES_SCHEDULED”,
    “DEPARTURES_PERFORMED”,
    “AVAILABLE_SEATS”,
    “TRANSPORTED_PASSENGERS”,
    “TRANSPORTED_FREIGHT”
    FROM SCOTT.”FLIGHT_DATA_1″

    but it was not giving any error if i have only one load statement.

    • Chandraish says:

      Gurjeet:
      Preceding load takes the input from the previous load statements and transform it.

      Your correct statement should be LOAD *, MONTH(CREATED_DATE) AS DATEE;
      This will include not only CREATED_DATE but also all other columns from the previous load statement.
      Now you should not get any error as UPDATED_DATE will be present.
      Also modify your load year(UPDATED_DATE) AS YEAR1; because this will load just the UPDATED_DATE
      It should be load *, year(UPDATED_DATE) AS YEAR1;

      because you want to include other columns also in the table but just want to transform UPDATED_DATE

  3. Hi,
    Good explanation for preceding load but I have a doubt here.
    Just wanted know the necessity of using preceding LOAD statement, when we can do all the transformations with SQL.

    Thanks
    Srikanth

Leave a Reply to gurjeet Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.