Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am not clear about switch control statement.
Please give an example to Switch.
Thanks in advance.
This is from the QlikView help.
If I evaluates to 1, the first load statement is executed, if I evaluates to 2 the second load statement is executed and in any other case the third load statement is executed.
Examples:
switch I
case 1
load '$(I): CASE 1' as case autogenerate 1;
case 2
load '$(I): CASE 2' as case autogenerate 1;
default
load '$(I): DEFAULT' as case autogenerate 1;
end switch
Hi,
Switch control statement(conditional statement) used to control logical flow of script execution. Executes one of many choices,based on the value of an expression. If no match is found for the value, the DEFAULT statements are executed.
SWITCH I
CASE 1
[Executed when ‘I’ is 1]
CASE 2
[Executed when ‘I’ is 2]
CASE 3
[Executed when ‘I’ is 3]
DEFAULT
[Executed when ‘I’ is not 1 or 2 or 3]
END SWITCH
Examples:
switch I
case 1
load '$(I): CASE 1' as case autogenerate 1;
case 2
load '$(I): CASE 2' as case autogenerate 1;
default
load '$(I): DEFAULT' as case autogenerate 1;
end switch
Regards
Neetha