Mod

Returns the modulus (remainder value) of a division operation.

Syntax

Mod ( numeric_value_expr_1, numeric_value_expr_2 )
ParameterDescription

numeric_value_expr_1

The number for which to find the remainder. Must be a numeric value or an expression that returns a numeric value (see MDX Grammar Rules).

numeric_value_expr_2

The divisor. Must be a numeric value or an expression that returns a numeric value (see MDX Grammar Rules).

Notes

The Essbase implementation of the function Mod returns the following values, which may be different from other vendors' implementations:

Mod(n,k) = - Mod(-n,k) , where n < 0
Mod(n,k) =  Mod(n,-k) , where k < 0

Example

WITH MEMBER [Measures].[Factor] AS 
 'Mod ([Measures].[Margin %],[Measures].[Profit %])'
SELECT
 {
  [Measures].[Margin %],
  [Measures].[Profit %], 
  [Measures].[Factor]
 }
ON COLUMNS, 
 {[Year].[Qtr1].Children}
ON ROWS
FROM sample.basic

returns:

(axis)Margin %Profit %Factor
Jan55.10225.444.217
Feb55.38726.0253.337
Mar55.26725.8683.530