Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

Load stmnt vs SQl statement

Hi all

which statement will give you more performance ?

Means in my project they have written like below  what does it means?

Sales:

LOAD *;

SQL SELECT

   "pl",

   "SalesName" ,

   case when SalesName in('PI','SM') then 'It' es 'Dt' end DTM,

   " Quarter",

   "Sub_rn" ,

     'Ac' as Type

FROM "PE_SE"."VW_S_EP"

where Sub_rn<>'EA';

what is load *;  ?

and  instead of sql script cant wee write in load script [Qlik]  ?

Can anyone help me to understand this?

Thanks

Sony

1 Reply
Peter_Cammaert
Partner - Champion III
Partner - Champion III

LOAD and SELECT are different statement to load data from (possibly external) sources into QlikView internal tables. They are not interchangeable. They must be used to access their specific data sources. For example:

SQL Statements (of which SELECT is a member) are non-QlikView statements that can be used to obtain data from an external DBMS or data source that has an open connection through a previous CONNECT statement. Usually, those connections are built on top of an ODBC or OLE DB connection. The main condition to make this work is that your external data source has to provide a SQL engine to interprete and execute SQL statements, as QlikView won't do this. QlikView just sends the entire SQL statement as-is through the currently open connection for interpretation and execution to whatever engine is available at the other end.

See: Select - QlikView

A LOAD statement is a QlikView statement that lets you obtain data from either:

  • a file in your file system (using keyword FROM)
  • a resident table = an internal table loaded previously (using keyword RESIDENT)
  • an in-line table (using keyword INLINE)
  • a single field from an existing table (using keyword FROM_FIELD)
  • a generator, also called an "iterator" (using keyword AUTOGENERATE)

There is a sixt possible data source: the statement that follows a LOAD without keyword. This LOAD-without-keyword is called a PRECEDING LOAD because it appears before the following LOAD/SELECT statement. A Preceding LOAD uses the output from the following LOAD/SELECT as a data source, before storing the result in a resident table. A Preceding LOAD works row-by-row.

See: Load - QlikView

In your example, the SELECT statement loads individual rows from table PE_SE.VW_S_EP and stuffs each one of them in the Preceding Load statement, which in turn processes the data before finally storing each row in a table called Sales. The Preceding Load in this case (LOAD *;) doesn't really do anything, so you could consider it superfluous.


Best,


Peter