Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Basic for...next loop in script, but can't make it to work

Hi everyone. I'm Christian, a Qlik newbie, and this is my first question

I have several days in a qvd file, have no problems to obtain maximun and minimun dates, and number of days between that dates

What I want to do is a loop that goes from 0 to that number of days. But I'm making something wrong. The loop always exits because of the 'if' condition rather than 'for' condition.

What I'm doing worng? Thanks in advance

cotas:

LOAD

min(Date(Floor(FechaAlta))) as minimo,

max(Date(Floor(FechaAlta))) as maximo,

max(Date(Floor(FechaAlta)))-min(Date(Floor(FechaAlta))) as dias

Resident carga;

LET vDiasInFile = 'dias';

LET vPasesInFile = 0;

for vI = 0 to '$(vDiasInFile)'

vPasesInFile = vPasesInFile + 1;

IF vI >= 10 then

EXIT For;

ENDIF

NEXT vI

1 Solution

Accepted Solutions
sunny_talwar

Try this:

LET vDiasInFile = Peek('dias');

View solution in original post

3 Replies
sunny_talwar

Try this:

LET vDiasInFile = Peek('dias');

Anonymous
Not applicable
Author

Tks sunny, will try and let you know!

Anonymous
Not applicable
Author

It works. Tanks!!!