Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Infinite loop Problem

Hi,

I am executing the following code:

LET a = 1;

do while ($(a) <= 3)

LOAD

Department_Key,

BUDGET AS NBUDGET

RESIDENT Table

LET a = a + 1;

loop



---

This is rendering me an infinite loop.

Where am I goin wrong..pls help

Regards,

Rohit

2 Replies
Not applicable
Author

I dont think you need $(a) in this case, as $(a) means to evaluate the expression, and your variable is not an expression, just a value.

Try first changing to DO WHILE a<=3


If this doesn't work then you might want to change the LET statements to SET statements, but I'm not sure you should need to do this.

biester
Specialist
Specialist

I think it should be:

do while (a <= 3)

Rgds,
Joachim