Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Last 6 months data using incremental load in qlik sense

Hi All,

My requirement is to keep only 6 months of data in qvd file. once in a month the qvd generator will run to append the new file and delete the last file i.e. if the data is from july to dec , then when jan data comes .. jan data will get added and july will get deleted and qvd will have data from Aug to jan.

Sample script will be beneficial .

 

Thanks,

Yogendra

Labels (1)
2 Replies
shiveshsingh
Master
Master

Hi You can use below logic. Suppose you are having 6 months data in your qvd. Now when generator will run in next month, then extract the latest month data from the source, concatenate it with old qvd and store it as temp_qvd Now from the temp_qvd, take only data for 6 months and store it in your final qvd. drop temp_qvd; let me know if you need the script as well
shiveshsingh
Master
Master

T:

load * from QVD ;

concatenate

Load * from Source where Month = 'Jan'

store T into Temp_qvd;

noconcatenate

F:

load * from Temp_qvd where Month > 'July';( Month-7)

store F in to QVD;

 

drop table Temp_qvd;