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

variable with a list in load script

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

2 Replies
Anonymous
Not applicable
Author

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>
Not applicable
Author

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';


so i can start with
set months=startMonth

but how can i concatenate the following months until the actual month is reached?

thank you very much and best regards
Tobi