The GT (greater than) function determines whether a value is greater than another value. If the first value specified is greater than the second value specified, a true (1) result is returned. Otherwise, a false (0) result is returned. The GT function operates in the opposite manner as the LT function. The greater symbol (>) can also be used to perform this function and is the recommended method.
Category
Boolean
Syntax
GT(value1, value2) or value1>value2
Parameters and Descriptions
Parameter | Description |
---|---|
value1 | This parameter specifies the first value to be used in the greater than or equal to comparison. This value may be a field/column of a datastore, a literal value (i.e. ABC) or the result of another Function. |
value2 | This parameter specifies the second value to be used in the greater than or equal to comparison. The source value may be a field/column of a datastore, a literal value (i.e. ABC) or the result of another Function. |
1 | 0 | Indicates whether a TRUE (1) or FALSE (0) was returned from the GT function. |
Example
Compare each employee’s hours worked in a week (HRS_WORKED) against 40 to determine if an employee is due overtime pay. If the condition is true, set variable OT_REQ to the constant Y. Otherwise, set the variable OT_REQ to the constant N.
IF HRS_WORKED > '40'
OT_REQ = 'Y'
ELSE
OT_REQ = 'N'
OR
IF GT(HRS_WORKED, '40')
OT_REQ = 'Y'
ELSE
OT_REQ = 'N'