How to check if cell is empty in MDX
Recently I was looking at cube from customer, which had hundrends of calculated members. I noticed, that many of them were simple ratios in the form of a/b. However the consultant who developed these calculated members wanted to avoid division by zero so he wrapped the expression inside IIF MDX function (on the side note, this is wide spread practice, but I really wonder whether it is worth it. If divisor is zero, then there will be no error, the cell value simply will be positive or negative infinity represented as 1.#INF - but people don't like this for some reason and prefer to replace it with NULL, which makes the user wonder why there is no data for the ratio). But what made me really surprised was how the checks for division by zero were done. It seemed like, there were no two calculated members which used the same logic.
Tags: mdx