Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
gargi_bardhan
Creator
Creator

Incremental Load

Hi All,

Needed help urgently :

I am implementing incremental load based on Flag 'Full_Load_Flag' (Y/N)

This Flag is in the same table from where data is coming.

So I want to know the Qlikview script for the following:

table1:

load

if (Full_Load_Flag = 'Y',

Load * from xyz;

store table1 into history.qvd

else

load * from xyz where month_key='Sep'

store table1 into current.qvd;

Thanks In advance!

Reagrds,

Gargi

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Gargi

How about this

table1:

LOAD *

From xyz

Where Full_Load_Flag='Y';

If Alt(NoOfRows('table1'), 0) > 0 Then

     STORE table1 into history.qvd;

Else

     table1:

     LOAD *

     From xyz

     Where month_key='Sep';

     STORE table1 into current.qvd;

End If

This will run the second load only if no data was returned from the first.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

4 Replies
ericcosmai
Contributor III
Contributor III

Hi Gargi.

I think you can do the following:

table1:
LOAD *
From xyz
Where Full_Load_Flag='Y';
STORE * from table1 into history.qvd;
DROP Table table1;

table1:
LOAD *
From xyz
Where month_key='Sep'
and Full_Load_Flag='N';
STORE * from table1 into current.qvd;

I hope it helps.

Regards.

Éric Cosmai

gargi_bardhan
Creator
Creator
Author

Hi Éric,

Thanks for you solution , but I want either of it to be saved based on condition. not both to be saved on daily basis.

Regards,

Gargi

jonathandienst
Partner - Champion III
Partner - Champion III

Gargi

How about this

table1:

LOAD *

From xyz

Where Full_Load_Flag='Y';

If Alt(NoOfRows('table1'), 0) > 0 Then

     STORE table1 into history.qvd;

Else

     table1:

     LOAD *

     From xyz

     Where month_key='Sep';

     STORE table1 into current.qvd;

End If

This will run the second load only if no data was returned from the first.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
gargi_bardhan
Creator
Creator
Author

Thanks Jonathan,

It worked..!!

Reagdrs,

Gargi