Specify if-then conditions

Updated 28 Aug 2023

When you define constraints in the Edit Algorithmic Values window, you can set up dependencies between two algorithmic values using an IFTHEN function. If-then conditions are not available for all courses.

The function syntax is:

IFTHEN (A, B, C)

This statement means that if condition A is true, then the algorithmic value equals B; otherwise, it equals C.

For example, suppose you have defined algorithmic values ~a and ~b. You now want to define an algorithmic value, ~X, that is conditional on the value of ~a. To do so:

  1. Select the equal sign (=) as your relational operator.
  2. In the Constraint Value area, click inside the row, right-click, and then select Editing Options > Simple > IFTHEN(A,B,C) from the menu. You also can enter IFTHEN(A,B,C) directly in the row.
  3. In the Constraint Value area, replace the variables A, B, and C as follows:

    IFTHEN(~a=3, 24, ~b)

    In this case, if the value of ~a is 3, then the value of ~X is 24. Otherwise, the value of ~X is equal to the value of ~b.

You can include IFTHEN statements in algorithmic values of any type. If you use IFTHEN statements in a Text or symbol type, you must put quotation marks around any text output values.