Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

laujerry
Contributor

Optimized load using where Exists

Hi all,

I read from web resources that you can use "where exists" to do an optimized load

I have tried a simple example below but it does not perform what is expected

Can anyone point out what's wrong with it?  Thanks

//tmp:

//load * Inline [

//   id, flag

//   1, 1

//   2, 1

//   3, 1

//   4, 0

//   5, 0

//   6, 1

//   7, 0

//   8, 1

//   9, 0

//   10, 1

//];

//

//STORE tmp into tmp.QVD;

//DROP Table tmp;

flag:

LOAD

   1 as flag

AutoGenerate 1;

tmp:

load

   id

From tmp.QVD(qvd)

where exists (flag,flag);

DROP Table flag;

Tags (2)
1 Solution

Accepted Solutions
evan_kurowski
Valued Contributor

Re: Optimized load using where Exists

Jerry Lau wrote:

Hi all,

I read from web resources that you can use "where exists" to do an optimized load

I have tried a simple example below but it does not perform what is expected

Can anyone point out what's wrong with it?  Thanks

tmp:

load

  id

From tmp.QVD(qvd)

where exists (flag,flag);

DROP Table flag;

Hello Jerry,

When I take this script segment and add the field [flag] to the statement involving exists(), I get a restoration of the optimized load message.  try:

tmp:

load id, flag

From tmp.QVD(qvd)

where exists (flag, flag)

3 Replies
evan_kurowski
Valued Contributor

Re: Optimized load using where Exists

Jerry Lau wrote:

Hi all,

I read from web resources that you can use "where exists" to do an optimized load

I have tried a simple example below but it does not perform what is expected

Can anyone point out what's wrong with it?  Thanks

tmp:

load

  id

From tmp.QVD(qvd)

where exists (flag,flag);

DROP Table flag;

Hello Jerry,

When I take this script segment and add the field [flag] to the statement involving exists(), I get a restoration of the optimized load message.  try:

tmp:

load id, flag

From tmp.QVD(qvd)

where exists (flag, flag)

laujerry
Contributor

Re: Optimized load using where Exists

Hi Evan

Thanks that works

But so does that mean the field to be used for controlling optimized load must be loaded to the data?

evan_kurowski
Valued Contributor

Re: Optimized load using where Exists

Hello Jerry,

It looks that way, at least at the time the load statement is being performed.  However you can drop the EXISTS field from any tables after the import is done.

DROP field flag from tmp;

Community Browser