Calc

The Calc option specifies a calculation and the measure(s) to which it applies.

The syntax is as follows:

Calc keywords objects

where calc is a mixture of objects and keywords.

objects consist of the object name, optionally followed by the at sign (@) and the object identifier, such as "Revenue@259". If object identifiers are suppressed, objects are identified by their object names only.

The measure calculation keywords supported by Cognos® Transformer are as follows:

Calculation keyword

Type

Description

ISNULL N/A

zero

IF N/A

conditional IF expression

THEN N/A

conditional THEN expression

ELSE N/A

conditional ELSE expression

AND N/A

both

OR N/A

either

NULL N/A

does not exist

!= N/A

not equal to

= N/A

equal to

< N/A

less than

<= N/A

less than or equal to

> N/A

greater than

>= N/A

greater than or equal to

/ Number

divided by

- Date or Number

minus

* Number

multiplied by

+ Character, Date, or Number

plus

^ Number

Returns a number raised to the power of a second number.

Absolute Number

Converts numbers to their unsigned value.

Average Number

Creates an arithmetic mean.

- Date or Number

minus

* Number

multiplied by

+ Character, Date, or Number

plus

Max

Number

maximum instance

Min

Number

minimum instance

Percent

Number

Computes the percentage.

Example

The following example represents an if-then-else calculation definition for "Revenue":

Measure 173 "Revenue" calc IF (ISNULL("Cost@177"+"Quantity@181")) 
THEN ("Cost@177") ELSE (("Quantity@181")