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. 

CallWhen 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… loopA do… loop is an iterative statement. The code inside the statement will loop until some specified logical criteria are met. See more
Exit scriptAn 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… nextFor 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… nextFor… 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… thenIf… 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
SubThe sub statement specifies a start of a subroutine. The subroutine will not be executed until called upon by a call statement. See more
SwitchThe 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