Arithmetic Operators (MDX)

Arithmetic operators perform basic math operations on their operands. AtScale supports arithmetic operators in Calculated Measure formulas. Notice the NULL handling behavior in MDX is different than SQL.

OperatorDescriptionExamples
+Addition String Concatenation1 + 2 = 3

1 + NULL = 1

'Name' + 1 = Name1

'Hello' + 'World' = 'Hello World'

[Measures].[sale_amount] + [Measures].[tax]

see also SQLSUM
-Subtraction2 - 1 = 1

2 - NULL = 2

[Measures].[sale_amount] - [Measures].[discount]
*Multiplication2 * 2 = 4

2 * NULL = NULL

[Measures].[sale_amount] * .085
/Division4 / 2 = 2

4 / 0 = undefined

4 / NULL = NULL

NULL / 2 = NULL

[Measures].[bytes] / 1048576
^Power2 ^ 3 = 8

area = 3.14 * r ^ 2

[Measures].[bytes] ^ 2

can return NULL or an error depending on the SQL engine