DateDiffDays
EAZYBI Returns the number of days from the first date to the second date.
Syntax
DateDiffDays(From_Date_Expression, To_Date_Expression)
Arguments
From_Date_Expression | MDX expression that returns the first date of the calculation. |
---|---|
To_Date_Expression | MDX expression that returns the second date of the calculation. |
Examples
Calculate days between the issue created and resolved dates
The following example shows how many days have passed from the issue creation date until it was resolved. To ensure that the result is displayed as an integer or decimal, use the measure formatting #,### Integer
or #,###.00 Decimal
DateDiffDays( [Issue].CurrentHierarchyMember.Get('Created at'), [Issue].CurrentHierarchyMember.Get('Resolved at') )
Days since the last status update
The following example calculates how many days the issue spent in the status since the last status transition. To ensure that the result is displayed as an integer or decimal, use the measure formatting #,### Integer
or #,###.00 Decimal
DateDiffDays([Measures].[Issue status updated date], Now())
See the example report Issues days in current status overview in our demo account. The formula above is used within any calculation in this report to count days spent in the status. The calculation is used in several scenarios to detect issues with age in status by a particular interval or an average time spent in the status.
Days in current month
Calculate how many days are in the current month, the "Current Month" is a calulcated member in the "Time" dimension. To ensure that the result is displayed as an integer or decimal, use the measure formatting #,### Integer
DateDiffWorkdays( [Time].[Current month].StartDate, [Time].[Current month].NextStartDate )
See also
- The above is an example how to use the DateDiffDays function. Note that more efficient way of calculating issues due in various age intervals would be to use the Age intervals dimension.
- Function DateDiffWorkdays which returns number of working days between two dates.