Conditional Builder
The Conditional Builder is an interface that makes it easy to add simple and complex conditionals to your ATL script.
Tip
For more detailed information about conditionals, see Key Concepts > Conditionals.
To open the Conditional Builder, click the Insert Conditional button:
This opens the Conditional Builder dialog.
The image below shows the dialog after various fields have been populated:
PARAMETER A and PARAMETER B is where you specify the two values to be compared. The CONDITION field provides a drop-down menu offering a standard set of comparison operations. The RESULT field is where you specify the output for when the condition is met.
The above example includes two cases. Case 1 asks whether the value of CapitalPop2016 is greater than the value of CapitalPop2010. If this condition is met, the output result is the text "up". Case 2 asks whether the value of CapitalPop2016 is less than the value of CapitalPop2010. If this condition is met, the output result is the text "down".
Note
In the above example, PARAMETER A and PARAMETER B each contain a reference to a variable, which can be selected from the field drop-down menu. However, the parameters can be literal strings (do not put quotes around strings or you will get an error), numeric values, or ATL expressions.
Tip
The RESULT field can be populated using literal text, as in the example above; however, it can also contain arbitrarily complex ATL expressions. It’s usually easier to build such expressions in the script editor in Compose View, and then copy and paste the resulting expressions into the RESULT field.
The Conditional Builder also supports complex conditionals, in which more complex comparisons or combinations of comparisons can be specified. To enable this functionality, toggle the Use complex conditions switch to ON at the top of the builder window.
You can then type an arbitrarily complex condition in the CONDITION field.
Tip
For more about complex conditionals, see Key Concepts > Conditionals and Syntax for conditionals
The Conditional Builder also provides a Preview control, so you can check to see that your conditional is behaving as expected for each row in your data table:
The image above shows that the output from the conditional is "up" for Row 1. You can use the navigation buttons to check specific rows.
When the conditional is specified to your satisfaction, click Build to insert it into your script. If you attempt to leave the Conditional Builder without building the condition, you will be asked to confirm that you don't want to save your work.