Welcome to Catalog Tips

Search more than 200 articles to learn more about creating and automating your product catalogs

Tip: Start typing in the input box for immediate search results.

< All Topics
Print

IF – Test if any arguments are true

Overview

Evaluate a condition, returning TRUE/FALSE or optional values

Syntax

IF(Operand1, ‘Operator’, Operand2, ‘TrueValue’, ‘FalseValue’)

IF(FIELDSTR(Price), ‘>’, 10, ‘Greater than 10′, ‘Less than or equal to 10’)

IF(FIELDSTR(Price), ‘>’, 10)

Element Description
Operand1 The first field or value to compare.
Operator

The operator to use in the comparison – valid operands are:

< Less than

> Greater than

= Equal to

<= Less than or equal to

= Greater than or equal to

<> Not equal to

Operand2 The second field or value to compare.
TrueValue The value to output if the comparsion evaluates to true (optional).
FalseValue The value to output if the comparsion evaluates to false (optional).

Example

IF(FIELDSTR(Price), ‘>’, 10, ‘Greater than 10’, ‘Less than or equal to 10′)

In this example, for all values that are greater than 10, ‘Greater than 10’ is displayed. For all values that equal to or less than 10, ‘Less than or equal to 10’ is displayed.

See also

 

Table of Contents