Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
srihitha
Contributor III
Contributor III

for ..next

Hi,

Can someone pls give me a code to load values from 1 to 9 into field numbers using for..next loop

Labels (4)
3 Replies
vinieme12
Champion III
Champion III

for a=1 to 9

Numberlist:

LOAD $(a) as number

AUTOGENERATE 1;

next;

 

You can find more to read here 

https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptC...

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MarcoWedel

Why a for-next-loop?

Wouldn't it be easier (and faster) to load e.g. like this?:

LOAD RecNo() as numbers Autogenerate 9;
srihitha
Contributor III
Contributor III
Author

Hi Vineeth ,

Above script is fine but I have a small question.

What is the difference between " load $(a) AutoGenerate 1"  and

"load $(a) as number Autogenerate 1"

If I don't give alias name as number for $(a) , output has just 1 and not the list of numbers from 1 to 9.