Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I've noticed that IterNo() and RowNo() seem to behave differently with While loop conditions. Using the following script, the IterNo table produces numbers up to 3 as expected based on the While condition, but the RowNo table produces numbers up to 4, which means that it loops once when the While condition is not satisfied.
Is this due to a difference in execution order of the two scripts, or is this just a bug in Qlik?
Thanks!
[Original Number]:
LOAD * INLINE [
Original No
1
2
3
];
[IterNo]:
LOAD
[Original No]
,[Original No] + IterNo() -1 AS IterNo
RESIDENT [Original Number]
WHILE [Original No] + IterNo() -1 <= 3
;
[RowNo]:
LOAD
[Original No]
,[Original No] + RowNo() - 1 AS RowNo
RESIDENT [Original Number]
WHILE [Original No] + RowNo() - 1 <= 3
;
Good question. I think this post will answer your question https://community.qlik.com/t5/QlikView-App-Dev/IterNo-vs-RowNo/m-p/1209629/highlight/true#M881824 by @Peter_Cammaert
Thanks Eddie. That post explains the difference between the functions conceptually, but doesn't explain why the iteration is continuing when the While condition is no longer satisfied for the script using RowNo() ?