Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
please confirm if we can make loops under If condition
If(Condition, Loop1 ,Loop2).
It would be good if you can explain with an example.
in the script: yes
IF Condition THEN
Loop1
ELSE
Loop2
END IF
Peter
Why not, Something like below
If(Region = 'Andhra Pradesh', If(Sales > 30, 'Lowest Price', 'Highest Price'))
Actually, no. In QlikView script, there are two IFs: there is an IF() function that can be used in expressions, and there is an IF control statement that can be used in blocks of code. They look alike and may give you the impression that they do similar things. But they're to be used in different contexts.
An IF() function cannot contain loops (except if you consider the two-parameter SubField() function a "loop") because loops (like DO UNTIL/WHILE or FOR) are also control statements. And an IF (... THEN ... ELSE ... END IF) control statement can't be used inside expressions. That's how it is.
[Edit] The one in your OP is the function-version of course.