Arithmetic Operators

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

Table 120. Arithmetic Operators

Operator

Name

Description

+

Add

Used at both the server level and the local metatopic level for all sections.

-

Subtract

Used at both the server level and the local metatopic level for all sections.

*

Multiply

Used at both the server level and the local metatopic level for all sections.

/

Divide

Used at both the server level and the local metatopic level for all sections.

(

Begin suboperations

Used at both the server level and the local metatopic level for all sections.

)

End suboperations

Used at both the server level and the local metatopic level for all sections.

++

Increment

Used at both the server level and the local metatopic level for all sections except the Query section.

--

Decrement

Used at both the 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.

Used only at the local metatopic level.

Tip:

If a computed item is displayed on a Request Line, and that item's definition uses subtraction, such as "Mytable.Column1-5", a SQL error can occur. The exact error depends on the database, but the most common error would indicate 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" ensure that correct SQL is generated.