If Statement
If Statements can be used to provide conditional logic to your report books. They are commonly used in tandem with loops to create a more fine-tuned output but they can also stand on their own. Additional logic can also be added through the use of Else If and Else statements. If Statements determine how book items within the hierarchy are processed.
Statement: Enter a conditional statement using parameters to determine whether the book items will be processed.
Example of Using Variables in If Statements
(|Loop1Variable| = [Frankfurt])
This is an example of an If Statement that would have existing with a loop. If “Frankfurt” is found within the Loop Definition for the Loop1Variables, the book items in this hierarchy will process for Frankfurt.
Example of Using Parameters in If Statements
(|!UserName!| = Administrator)
If the person running the book has a user name of Administrator, the book items in this hierarchy will be included in the book.
Example of Combining Statements
(|!UserName!| = Administrator) Or (|!UserName!| = JSmith)
If the person running the book has a user name of Administrator or JSmith, the book items in this hierarchy will be included in the book.