Control statements within the Qlik Sense app script are usually used to control the flow of the script execution. This article will list the control statements and their purpose. Click on the statement to see further information such as the syntax and an example.
Note that control statements span a single line only. The execution can be stopped by using a ‘;’ or by a line break.
Call | When a sub statement has been defined previously, the call statement calls this subroutine to execute. You can pass a specific parameter into the call statement. See more |
Do… loop | A do… loop is an iterative statement. The code inside the statement will loop until some specified logical criteria are met. See more |
Exit script | An exit script statement ends the script execution. Without this statement, the script execution will end at the natural end. This statement can be inserted partway through the script to exit the execution at a different stage. See more |
For each… next | For each… next is an iterative statement. In the statement, single or multiple parameters will be specified. The script inside the statement will execute for each parameter given. See more |
For… next | For… next is an iterative statement based on a counter. In the statement, a counter is specified. The script within the statement will execute for each counter value. See more |
If… then | If… then is a logical statement. You can specify different execution scripts that run only when a given condition is met. Multiple conditions can be specified. See more |
Sub | The sub statement specifies a start of a subroutine. The subroutine will not be executed until called upon by a call statement. See more |
Switch | The switch statement is a logical statement. You can specify different execution scripts that run only when a given condition is met. Multiple conditions can be specified. See more |