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: 
chibi
Creator
Creator

Incremental load script does not work in QlikSense

Hi I'm trying to load incremental data but it keeps fetching all the data instead of showing 0. Where am I going wrong?

 

maxAgency:
LOAD
max(sold_agency_no) AS m_sold_agency_no
from [lib://EDP_QVD/dim_agency.qvd](qvd);

Let m_sold_agency_no = num(peek(m_sold_agency_no,0,maxAgency);

drop table maxAgency;


[dim_agency]:

LOAD
agency_no AS sold_agency_no,* ;
SELECT *
FROM "magXXX_edp_prod"."sales_dw"."dim_agency"."agency_no$"
where agency_no > '$(m_sold_agency_no)';

Concatenate
LOAD * FROM [lib://EDP_QVD/dim_agency.qvd](qvd);

store dim_agency into [lib://EDP_QVD/dim_agency.qvd](qvd);

16 Replies
stevejoyce
Specialist II
Specialist II

use single quotes in peek function parameters (and close out num function):

 

Let m_sold_agency_no = num(peek('m_sold_agency_no',0,'maxAgency'));

chibi
Creator
Creator
Author

It still fetches all the records instead of showing 0

 

stevejoyce
Specialist II
Specialist II

can you look at your variable m_sold_agency_no  and see if it's being set correctly.

 

or add in your script TRACE m_sold_agency_no: $(m_sold_agency_no) and send screenshot?

chibi
Creator
Creator
Author

Where do I add TRACE m_sold_agency_no: $(m_sold_agency_no);  at the end of the script? 

stevejoyce
Specialist II
Specialist II

yea, anywhere.  i would add it right after you set it, but wherever you want is fine.

chibi
Creator
Creator
Author

maxAgency:
LOAD
max(sold_agency_no) AS m_sold_agency_no
from [lib://EDP_QVD/dim_agency.qvd](qvd);

Let m_sold_agency_no = num(peek('m_sold_agency_no',0,'maxAgency'));
TRACE m_sold_agency_no: $(m_sold_agency_no);

drop table maxAgency;


[dim_agency]:

LOAD
agency_no AS sold_agency_no,* ;
SELECT *
FROM "magXXX_edp_prod"."sales_dw"."dim_agency"."agency_no$"
where agency_no > '$(m_sold_agency_no)';

Concatenate
LOAD * FROM [lib://EDP_QVD/dim_agency.qvd](qvd);

store dim_agency into [lib://EDP_QVD/dim_agency.qvd](qvd);

stevejoyce
Specialist II
Specialist II

something's wrong...  your script log doesn't even show it loading maxAgency.  or the Trace statement.

 

Is there anything else in your load script?  I don't see anything wrong in what you've sent.

what if you add this to the beginning, are you actually loading data?

maxAgency:
LOAD
*
from [lib://EDP_QVD/dim_agency.qvd](qvd);

exit script;

chibi
Creator
Creator
Author

I don't think data is loaded 

I commented the script and added what you gave me and the result is the same 

chibi
Creator
Creator
Author

This is the initial script I have to create the QVD file. Then commented the incremental load script and added it to a different section.