Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Scripting Issue


I have generated yearly QVDs based on the year field present in the file.

Now, i have to store the QVDs prior to 2013 into an archive folder and the QVDs after 2013 in the current folder.

I have used the below code for generating yearly QVDs

temp:

load min(Year) as MinY,

max(Year) as MaxY

resident tab;

let MI= peek('MinY', 0 , 'temp');

let MA= peek('MaxY' , 0, 'temp');

for i= $(MI) to $(MA)

tabtemp:

noconcatenate

load * resident tab where Year=$(i);

store * from tabtemp into ../../Abc_$(i).qvd(qvd)

drop table tabtemp;

How do i modify the above code so that it stores the QVDs prior to 2013 in Archvie folder and the QVDs genertaed after 2013 in another folder.

10 Replies
Not applicable
Author

Thanks Marcus!!! I made a slight change in the code too...

Instead of using if i>=(year(today())-3) , i stored year(today()-3) in a variable var and in the if statement , i used if $(i)>=$(var)