Mod
The MDX Mod function for Essbase returns the modulus (remainder value) of a division operation.
Syntax
Mod ( numeric_value_expr_1, numeric_value_expr_2 )
Parameters
- 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
The following MDX query:
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 the following output:
Table 4-115 Output Grid from MDX Example
(axis) | Margin % | Profit % | Factor |
---|---|---|---|
Jan | 55.102 | 25.44 | 4.217 |
Feb | 55.387 | 26.025 | 3.337 |
Mar | 55.267 | 25.868 | 3.530 |