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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
anriretief
Contributor III
Contributor III

Generate Multiple QVD's

I need to generate a separate QVD for each value of k (as can bee seen below)

I used the following code but the store command I am using doesn't seem to store in separate QVD's

for  k = 0 to ((if(month(today())<5, (right(year(today()),2)-1)&09, if(month(today())>=5,right(year(today()),2))&09-1709))/100);

let YearMonth = 1709 + $(k)*100;

let FinJaar = left('$(YearMonth)',2)&(left('$(YearMonth)',2)+1);

CurrentTemp:

load *

FROM

(fix, codepage is 1252);

STORE  CurrentTemp into "D:\DEV\Anri\TOETS\Takbuffer$(FinJaar).qvd" (QVD);

next k


Any help will be appreciated

Thanks in advance

2 Replies
Anonymous
Not applicable

when I understand your variable YearMonth will have values 1709, 1809,..

So you advance year by year for september

do you have already data from sept 2018? If yes I would expect that 2 qvds would have been created (one with 1709 and one with 1809).

-> your if Statement seems to have incorrect brackets (I see red underline brackets when i copy your expression

this is without Syntax error:

(if(month(today())<5, (right(year(today()),2)-1)&09, if(month(today())>=5,right(year(today()),2))&09-1709)/100 )

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The detection of causes for bad data/behavior can be advanced a lot if you simplify your script code.

If I'm not mistaken, you can replace the two LET statements in the FOR loop by something like:

LET FinJaar = 1718 + (101 * $(k)); // YearMonth not used in the example