Report Portal

Division by null and zero in MDX

This is a task that I do frequently, check for null or zero in the denominator in calculations, to avoid the famous  1.#INF messages in the cells. Mosha has written a good blog post here about the subject. What I have done is to make an example from that blog post and the comments there to quickly understand when this problem occur and what to do about it.

Two of the calculated members, NullValuePerUnit and ZeroValuePerUnit, are only used for provoking the division by zero or null problem. The calculated member CheckDivByZero is the way Mosha recommends as a general solution that will work with bort null and zero in the denominator. You will also be able to see why the IsEmpty function will not work with zero in the denominator. The last two calculated members will show that dividing zero or null by a value(Internet Sales Amount) will not cause any problem and only return null.

Read more...

Tags: mdx

 

2007-2015 VidasSoft Systems Inc.