@if(T/F Test Condition, Execute if True, Execute if False)

Definition

Conditional logic statement

Syntax:

@if(test condition, execute if "true", execute if "false")

Executes one of two commands based on a condition. The condition can be a formula, string, list, or date, and must return true or false. You can nest @if statements.

Returns

Results of executed command.

Example 1

For Net Income (v1750), if the common dividend payout percentage is based on the company's net income growth over the previous year, and:

The formula for Common Dividends is:

@if((v1750-v1750(-1Y))/v1750(-1Y)>=25%, v1750*20%,v1750*15%)

Example 2

If the model in example 1 is in quarters, but dividends are paid once a year at the fiscal year beginning, based on the prior year's net income, use a nested @if to calculate payment in the first quarter only:

@if(@qtrnum=1,@if((v1750(-1q)-v1750(-5q))/v1750(-5q)>=25%, v1750(-1q)*20%,v1750(-1q)*15%),0)

Note:

In the analyze trail, Strategic Finance returns 1 if the answer is "true", and a 0 if the answer is "false".

Using strings

Enter strings in quotes, for example: "Underwriting". Strings are case-insensitive, and are used as function arguments only to test formulas—they cannot be used as results.

This is valid:

@if(v1.0.600="Underwriting", v300*v305, @na)

because you can use strings in tests.

This is invalid:

@if(v155=v160, 300, "Revenue")

because you cannot use string as results.

Using lists

Lists behave like strings. Lists can be time series or scalar.

For example, if an account “Processed?” (v150.00.0000) has these possible values: Yes, No, Not Available—this is valid:

@if(v150="Yes", 100, 200)

In enumerated number lists, numbers are handled as strings, and entered in quotes. For example:

@if(v176="8", 300, 400)

Using Dates

To enter dates, use the mm/dd/yyyy format within quotes, for example:

@if(v174="06/30/2003", 100, 300)

Dates are handled as strings.