You are here: Command Parameters > If

If

If is a scope parameter that causes a command to be executed on records that satisfy a specified test. If filters out all records that fail the test. If is not dependent on the current record position.

After execution of a command containing an If parameter, the record position is set at the record immediately following the number of records specified in the command. If the end of the file was reached during execution, the record position will be reset to record 1.

The If parameter can also be used in conjunction with the While, Next or First parameters. After execution of a command in which both If and While are specified, the record position is determined by the While parameter.

Note: When a global filter has been applied, the local If condition is applied in addition to, not instead of, the global filter.

For information on the If command, see If.

Command Mode Syntax

IF condition

In the following example, records having a value of less than 50 in the Quantity on Hand field are counted:

COUNT IF QtyOH < 50

Command Dialog Box

The If condition is available in the Main dialog for the Extract command. For all other commands the If condition can be found by clicking the [More] button to expand the command dialog.

Enter the IF condition directly in the “Only Include Records if” text box or click [Expression] to display the Expression Builder. For more information, see Expression Builder.