Express a Condition with an If-Statement

Top  Previous  Next

How To... > Work with Formulas > Work with the Formula Editor > Express a Condition with an If-Statement

Many times you would like the value of an attribute or filter to depend on whether something is or is not true. That’s when you use an if-statement. Such a statement has three parts: the condition, the value when the condition is true, and the value when the condition is false.

 

_img434

 

To create an if-statement,

Type if( Fathom fills in the other parenthesis, the brace, and a question mark for each of the values to be filled in;

 

_img435

Or …

Open the Function list to the Conditional category and double-click if.

Enter the condition then use Tab to move to the next field (the “if true” result on top, “if false” on the bottom).

_img436

 

You can create nested if-statements by using if-statements as values for if-statements. Usually, this is more efficiently done using the switch function (see Recode with a Switch Statement).