To use IBM Cognos product documentation, you must enable JavaScript in your browser.

Operators

Operators specify what happens to the values on either side of the operator.

Mathematical, Logical, and String Operators

Transformer supports mathematical operators and string concatenate operators. It also supports logical operators and comparison operators, but only in an if-then-else conditional construct.

Operators

Description

Mathematical Operators (+, -, *, /, ^)

Perform mathematical operations.

And Logical Operator

Returns True if the conditions on both sides are true.

Or Logical Operator

Returns True if either of the two conditions on both sides is true.

Not Logical Operator

Returns True if the condition is false.

String Operator (+)

Concatenate two strings together.

Mathematical Operators (+, -, *, /, ^)

Performs mathematical operations. The precedence for processing mathematical operators is as follows:

Mathematical operators that are at the same level of precedence are evaluated from left to right. You can use parentheses to override this order of precedence.

And Logical Operator

Returns True if the conditions on both sides are true.

Example
Salary < 60000 and Dept = 'Sales'

Retrieves the data where salary is less than $60,000 in the Sales department. Precedence is given to logical operators.

Or Logical Operator

Returns True if either of the two conditions on both sides is true.

Example
Name = 'Smith' or Name = 'Wong'

Retrieves the data for the names Smith and Wong.

Not Logical Operator

Returns True if the condition is false.

Example
not ( "STATE" <> 'CA' ) 

Returns True for all states that are not California.

String Operator (+)

Concatenates two strings together.

Syntax
Char1 + Char2
Example
FirstName + LastName

Combines FirstName and LastName without spaces between.

Comparison Operators

Comparison operators compare two values and produce the logical value True or False.

Operators

Description

Comparison Operator Symbols

Compares two values.

Isnull

Determines if a value is undefined in the data.

Comparison Operator Symbols

Compare two values.

Syntax
Value1 [=,<,>,<=,>=] Value2
Example
Qty < 100

If the quantity is less than 100, evaluates to True and retrieves only those rows.

Price > 1000 or Qty <= 3

If the price is greater than 1000 or the quantity is less than or equal to 3, evaluates to True and retrieves only those rows.

Isnull

Determines if a value is undefined in the data.

Syntax
abc isnull
Example
Telephone Number isnull

If there are no telephone numbers, evaluates to True. Retrieves only the rows missing telephone numbers.