I am not sure if that is supported in Mondrian, but in Analysis Services, you could use HAVING
on the row axis like this:
SELECT {Measures.X, Measures.Y}
ON COLUMNS,
A.Members
HAVING Measures.X <> 0 AND Measures.Y <> 0
ON ROWS
FROM MyCube
In contrast to NON EMPTY
which only looks at empty (i. e. NULL
) values, for HAVING
, you can state the condition yourself. And in Analysis Services a numeric comparison treats NULL
the same way as zero, hence teh above condition excludes null and zero.
Another approach - slightly depending on the client tool - would be to stay with the MDX using NON EMPTY
and not to use CoalesceEmpty
, but convert the NULL values to 0 via the FORMAT_STRING
. This requires the client tool to use the format string or formatted value as delivered by the cube, and not to implement its own number formatting.