NonZero
EAZYBI Returns blank if the numeric expression has the result 0. All other numeric values will be returned as they are.
Syntax
NonZero(Numeric_Expression)
Arguments
| Numeric_Expression | MDX expression that returns a number. |
|---|
Examples
Example1
The following example will return the difference between created and resolved issues. Zero results will be replaced by blanks because of the Nonzero function
NonZero( [Measures].[Issues created] - [Measures].[Issues resolved] )
Blank rows can be hidden using the "Hide empty" button from the eazyBI toolbar.
Example2
The following example will return the maximum number of days between the issue resolution date and the last date when the status was updated. In case there is another status to complete the issue, both dates won't match, if the dates match, the Datediffdays would return the result 0, but zero results will be replaced by blanks because of the NonZero function.
NonZero(
Max(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
-- for unresolved issues only
NOT IsEmpty([Measures].[Issue resolution date])
AND
-- show on time for issue creation date
DateInPeriod(
[Measures].[Issue created date],
[Time].CurrentHierarchyMember
)
),
-- calculate days in current status for each relevant issue
CASE WHEN
-- check if issue is relevant for the report
[Measures].[Issues resolved] > 0
THEN
-- calculated days in status
DateDiffDays(
[Measures].[Issue resolution date],
[Measures].[Issue status updated date]
)
END
))
See also
- Description of aggregate functions
- Function CASE WHEN
- Function Max and Avg
- Function DatediffDays
- Function IsEmpty and CoaleceEmpty
- Function Descendants
- Function Filter