DateCompare
EAZYBI Returns 1 if the first date is greater than the second date; returns 0 if both dates are equal; returns -1 if the first date is less than the second date.
Syntax
DateCompare(Date_Expression, Date_Expression)
Arguments
Date_Expression | MDX expression that returns a date that will be compared. |
---|
You can also use a string expression, that can be parsed with DateParse, as any date argument.
Examples
DateCompare([Issue].CurrentMember.Get('Due date'), "Today")
The formula will return -1 if due date of the issue is before Today, 0 if an issue is due Today, and 1 if an issue due date is after Today. See example report Issues due and overdue in our demo account. The calculated measure Issues due in time uses the formula above to check if issue is not due yet and a similar comparison with resolution date for resolved issues before due date.