Problem description: after checking the help of QlikView, you can see the loop Syntax of QlikView, as shown in the following Code: LETvTest11; LETvTest230; DOWHILE (vTest1 $ (vTest2) LETvTest1 $ (vTest1) + 1; LOOP, however, is puzzling about how to replace DOWHILE (vTest1 $ (vTest2) with the following method and then become an endless LOOP.
Problem description: after checking the help of QlikView, you can see the loop Syntax of QlikView, as shown in the following Code: LET vTest1 = 1; LET vTest2 = 30; do while (vTest1 $(vTest2 )) LET vTest1 = $ (vTest1) + 1; LOOP, however, it is puzzling why do while (vTest1 $ (vTest2) is replaced with the following method and then becomes an endless LOOP.
Problem description:
After reading the help of QlikView, you can find out the loop Syntax of QlikView, as shown in the following Code:
LET vTest1 = 1;LET vTest2 = 30;DO WHILE (vTest1 < $(vTest2))LET vTest1 = $(vTest1) + 1;LOOP
However, it is puzzling why do while (vTest1 <$ (vTest2) is replaced with the following method and then becomes an endless loop:
Do while ($ (vTest1) <$ (vTest2 )).
Google does this many times, but it only means that the while condition will be compiled once, and all values in the loop will be parsed in each loop.
The original article is as follows: Each condition is interpreted only the first time it is encountered but is evaluated for every time it encountered in the loop.
Therefore, the above condition becomes so that do while (1 <30) remains valid.
Solution:
1. DO not use dollar sign in the while condition, such as do while (vTest1 <$ (vTest2 ));
2. Use exit do when in the loop statement as follows:
LET vTest1 = 1;LET vTest2 = 30;DO WHILE ($(vTest1) < $(vTest2))LET vTest1 = $(vTest1) + 1;EXIT DO WHEN ($(vTest1) >= $(vTest2));LOOP
Question:
Why does QklikView only compile conditions once?