12. Report-Writer Statements : Conditional and Assignment Statements : .If Statement--Specify Alternative Statements
 
Share this page                  
.If Statement--Specify Alternative Statements
The .if statement specifies alternative blocks of statements to be executed under specified conditions.
This statement has the following format:
.if condition .then {statement}
    {.elseif condition .then {statement}}
    [.else {statement}]
.endif
The parameters for the .if statement are as follows:
condition
A boolean expression that evaluates to true or false.
statement
Any action statement, including the .if statement (this excludes the setup and structure statements in the sections, Report Setup Statements and Report Structure Statements).
Both the expression in the condition and/or the parameters to statement can contain column names that are delimited identifiers enclosed in double quotes ("), if you have previously specified the .delimid statement.