Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
chriys1337
Creator II
Creator II

For each loop does not work

Hi,

I am not sure where my mistake is, but QV script runs through but does not generate the table:

LET vL.Week=20;

For i = right(WeekName(today()),2) to $(vL.Week) // FOR 16 to 20
Selection_Table:
Load
left(WeekName(today()),4) & right(WeekName(today()),2) +IterNo() 
as Selection;
next i

1 Solution

Accepted Solutions
Anonymous
Not applicable

try:

LET vL.Week=20;

For i = right(WeekName(today()),2) to $(vL.Week) // FOR 16 to 20
Selection_Table:
Load
left(WeekName(today()),4) & right(WeekName(today()),2) +$(i)
as Selection AutoGenerate 1;
next i

View solution in original post

4 Replies
Anonymous
Not applicable

where's your reference table?

or do you use autogenerate?

did you try an explicit noconcatenate?

Anonymous
Not applicable

try:

LET vL.Week=20;

For i = right(WeekName(today()),2) to $(vL.Week) // FOR 16 to 20
Selection_Table:
Load
left(WeekName(today()),4) & right(WeekName(today()),2) +$(i)
as Selection AutoGenerate 1;
next i

View solution in original post

chriys1337
Creator II
Creator II
Author

This worked fine, it was the missing reference table. Also it is working with autogenerate, thank you!

SET vL.FutureWeek=right(WeekName(today()),2)+6;

For i = right(WeekName(today()),2) to $(vL.FutureWeek)
Selection_Table:
Load
left(WeekName(today()),4) & (right(WeekName(today()),2)+rowno()-1)
as Selection
AutoGenerate 1 ;
next i

Anonymous
Not applicable

yes, you can't do a load on nothing...

... and iterno() only works for LOAD <-> while loops...