March 2018
Beginner to intermediate
514 pages
13h 11m
English
The If conditional statement forces the script execution to follow a certain path based on a condition returning true.
An If statement is usually used when creating flags while loading data.
The syntax is as follows:
If condition then [ statements ] { elseif condition then [ statements ] } [ else [ statements ] ] end if
The use of elseif is recommended when nested If is needed.
If the condition in the If statement isn't met, the code after else is executed.
The following example defines a variable in which we assign the current environment. If it is Development, we load a file with test sample data, otherwise, we load live client data:
SET vEnvironment = 'Development';IF vEnvironment = 'Development' THEN
Read now
Unlock full access