GetNextDay

The MDX GetNextDay function for Essbase takes an input date and weekday, and returns the next date after the input date that corresponds to the weekday.

Syntax

GetNextDay ( date, week_day, [0|1] )

Parameters

date

A number representing the input date between January 1, 1970 and Dec 31, 2037. The number is the number of seconds elapsed since midnight, January 1, 1970. To retrieve this number, use any of the following functions: Today(), TodateEx(), GetFirstDate(), GetLastDate(), DateRoll().

Date-Time type attribute properties of a member can also be used to retrieve this number. For example: Product.currentmember.[Intro Date] returns the Introduction or release date for the current product in context. [Cola].[Intro Date] returns the Introduction or release date for the “Cola” product.

week_day

A number between 1 (Sunday) and 7 (Saturday) representing the weekday.

0 or 1

Optional. Indicates whether to include the date itself or not. Default behavior is 1: to include the date itself.

Example

GetNextDay(Today(), 2, 0)

returns the next Monday following today.

GetNextDay(Today(), 2, 1)

returns the next Monday following today, or today if today is Monday.

GetNextDay(Today(), 2) 

returns the next Monday following today, or today if today is Monday.