Mod

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

Syntax

Mod ( numeric_value_expr_1, numeric_value_expr_2 )

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.
numeric_value_expr_2 The divisor. Must be a numeric value or an expression that returns a numeric value.

Notes

The Analytic Services 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:

Margin % Profit % Factor
Jan 55.102 25.44 4.217
Feb 55.387 26.025 3.337
Mar 55.267 25.868 3.530

©2004 Hyperion Solutions Corporation. All Rights Reserved.
http://www.hyperion.com