Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 ankit777
		
			ankit777
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi all,
I have a table with two columns Name and adress. How can I apply incremental load for this.
In SQL we have 'in' function. Is there any similar function in qlikview.
 
					
				
		
 yduval75
		
			yduval75
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		In Qlikview, instead of 'in' function, you can apply match()
For example :
LOAD
Name,
Adress
From table1
where
Match(Country, "'France', 'Spain', 'USA'")>0
;
 
					
				
		
 ankit777
		
			ankit777
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Can I use this for incremental load?
 
					
				
		
 yduval75
		
			yduval75
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		No, its' not for incremental load, it's to replace the "in" with sql
Here, a link to understand incremental load
http://www.quickintelligence.co.uk/qlikview-incremental-load/
 
					
				
		
For Incremental Load, you would need a Last Updated time in DB or any flag field. This way you can pull only latest record
 
					
				
		
I hope it helps you. You must detect a primary key and a data field in order to realize incremental loading.
The primary check is important to avoid double keys in your save
LET var_qvdexists=isnull(QvdCreateTime('$(var_yourpath)$(var_yourtable)'));
IF ($(var_qvdexists) = 0) THEN
TABLE:
LOAD max(date(floor(YOURDATE))) as MAXDATE
FROM $(var_yourpath)$(var_yourtable) (qvd)
;
let var_startdate = peek('MAXDATE');
let var_startdate = date(num(var_startdate), 'YYYY.MM.DD');
Drop table TABLE;
ELSE
let var_startdate = date(today() -1, 'YYYY.MM.DD');
END IF
//INCREMENTAL LOADING
BUFFER:
LOAD
YOURFIELDS,
%PRIMARYKEY
;
SQL SELECT *
FROM YOURTABLE
WHERE convert(nvarchar,YOURDATE ,102) >= '$(var_startdate)'
;
History:
load *, '1' as flag resident BUFFER;
IF ($(var_qvdexists) = 0) THEN
Concatenate
load *, '1' as flag
from $(var_yourpath)$(var_yourtable) (qvd)
WHERE NOT EXISTS (%PRIMARYKEY, %PRIMARYKEY)
;
ENDIF
drop field flag;
drop table BUFFER;
STORE History INTO $(var_yourpath)$(var_yourtable);
DROP TABLE History;
 maxgro
		
			maxgro
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		something like this?
// load from the database
Name:
load *;
SQL select Name, Address from YourSqlTable;
// load from previously (usually day before) stored table
// skip existing Name
Concatenate (Name)
load
*
From Name.qvd (qvd)
where not exists(Name);
// store for next reload
store * from Name into Name.qvd (qvd);
 
					
				
		
Thank u.
Thanks and Regards
Amol Khochare
