Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 chibi
		
			chibi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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);
 stevejoyce
		
			stevejoyce
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
		
			chibi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It still fetches all the records instead of showing 0
 stevejoyce
		
			stevejoyce
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
		
			chibi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Where do I add TRACE m_sold_agency_no: $(m_sold_agency_no); at the end of the script?
 stevejoyce
		
			stevejoyce
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		yea, anywhere. i would add it right after you set it, but wherever you want is fine.
 chibi
		
			chibi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
		
			stevejoyce
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
		
			chibi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I don't think data is loaded
I commented the script and added what you gave me and the result is the same
 chibi
		
			chibi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
