Arithmetic Operators

Arithmetic operators take numerical values (either logical or variables) as their operands and return a single numerical value.

Table 27. Arithmetic Operators

Operator

Name

Used at the:

+

Add

Server level and the local metatopic level for all sections

-

Subtract

Server level and the local metatopic level for all sections

*

Multiply

Server level and the local metatopic level for all sections

/

Divide

Server level and the local metatopic level for all sections

(

Begin suboperations

Server level and the local metatopic level for all sections

)

End suboperations

Server level and the local metatopic level for all sections

++

Increment

Server level and the local metatopic level for all sections except the Query section

--

Decrement

Server level and the local metatopic level for all sections except the Query section

Mod (%)

Modulus

The modulus operator returns the remainder of dividing var1 by var2.

For example, 5% 4 returns 1.

Local metatopic level only

Tip:

If a computed item is displayed on a Request pane, and the definition of item uses subtraction, such as "Mytable.Column1-5", a SQL error can occur. The exact error depends on the database, but the most common error indicates an undefined name was used. Because databases allow hyphenated names, Interactive Reporting attempts to deal with such names intuitively. Thus, an item definition like "Mytable.Column1-5" is interpreted as a name. In order to ensure it is treated as subtraction, include a space on either side of the hyphen/subtraction operator. For example, entering the computed item definition as Mytable.Column1 - 5" ensures that the correct SQL is generated.