Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi there,
in my load script i got the follwing 2 lines
set months = '2010-11', '2010-12';
FOR EACH m IN $(months)
...
in the next month the variable $(months) should be actualized to:
months = '2010-11', '2010-12', '2011-01';
and i dont get it to work ;(
so what i need: i give a start month and all following months can be calculated automatically until the actual month is reached. is this possible?
i think i can get it to work by selecting the calculated months from my database. but shouldn't it be possible with qlikview script syntax?
i tried a loop with something like
set months=months, actualMonth
but that doesn't work..
ANY help appreciated 🙂
Best regards
Tobi
Hi,
Not sure if this is what you meant...........
LET vTODAY = addmonths(monthstart(today()),-36);
LET vVAR = monthstart(today());
DO WHILE vVAR <> vTODAY
TRACE $(vTODAY);
TRACE $(vVAR);
Load Date(TODAY,'YYYY-MM') as TODAY_Formatted,
*;
Load rowno(),
'$(vTODAY)' as TODAY,
'$(vVAR)' as VAR
AUTOGENERATE 1;
LET vTODAY = addmonths(date(vTODAY),1);
SLEEP 100;
LOOP;
[\code]</body>
Hi,
thank you very much for your answer.
> Not sure if this is what you meant
mhm...let me explain it in another way.
i have a variable
startMonth='2010-10'
and then i want the variable $months to be a list with all months until the actual month.. (starting with $startMonth and automatically concatenated the following months). so after doing some qlikview script magic (i dont know) it should look like
<blockquote><pre> months = '2010-10', '2010-11', '2010-12';
set months=startMonth