# [Mondrian] NullDenominatorProducesNull Property

michael.pflug at thomsonreuters.com michael.pflug at thomsonreuters.com
Tue Dec 9 15:00:54 EST 2008

```Hi All,

Can I get some clarification about the purpose of the property
NullDenominatorProducesNull?  On the Mondrian website and in comments
the property is called NullOrZeroDenominatorProducesNull while the
actual name of the property is NullDenominatorProducesNull.  The code
using this property actually checks both the numerator and demoninator
for null, but doesn't check for zero.  I have a case where I want to
catch a divide by zero and return null instead of "infinity" and it
seems like this property should be the way to do it (see example below).
Does anyone know why the property was changed to exclude zero to begin
with and are there objections to adding the check for zero back in?

Thanks,

Mike

Example where this would take effect:

Query:  WITH MEMBER [Measures].[Unit Sales Divide By Zero] AS
'([Measures].[Unit Sales]/0 )', SOLVE_ORDER = 4 SELECT {[Measures].[Unit
Sales Divide By Zero]} ON 0, {[Gender].MEMBERS} ON 1 FROM [Sales];

Current Behavior:

NullDenominatorProducesNull=false || NullDenominatorProducesNull=true

Axis #0:

{}

Axis #1:

{[Measures].[Unit Sales Divide By Zero]}

Axis #2:

{[Gender].[All Gender]}

{[Gender].[All Gender].[F]}

{[Gender].[All Gender].[M]}

Row #0: Infinity

Row #1: Infinity

Row #2: Infinity

Desired:

NullOrZeroDenominatorProducesNull=false

Axis #0:

{}

Axis #1:

{[Measures].[Unit Sales Divide By Zero]}

Axis #2:

{[Gender].[All Gender]}

{[Gender].[All Gender].[F]}

{[Gender].[All Gender].[M]}

Row #0: Infinity

Row #1: Infinity

Row #2: Infinity

NullOrZeroDenominatorProducesNull=true

Axis #0:

{}

Axis #1:

{[Measures].[Unit Sales Divide By Zero]}

Axis #2:

{[Gender].[All Gender]}

{[Gender].[All Gender].[F]}

{[Gender].[All Gender].[M]}

Row #0:

Row #1:

Row #2:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20081209/0bc1e787/attachment.html
```