For expressions dimensioned by a dimension of type DAY, WEEK, MONTH, QUARTER, or YEAR, the ENDOF function returns the last date of a time period that is first in the current status list of the dimension.
ENDOF is particularly useful when the dimension has a phase that differs from the default or when the time periods are formed from multiple weeks or years. For example, when the dimension has four-week time periods, the ENDOF function identifies the final date of a particular four-week period.
DATE-only or text
A dimension of type DAY, WEEK, MONTH, QUARTER, or YEAR. When you have explicitly defined your own relation between dimensions of this type, you can use the name of this time relation here.
The following statements define a year dimension (called
taxyear, for a tax year that begins in July), add dimension values for tax years
2000, and produce a report showing the last date of each tax year.
DEFINE taxyear DIMENSION YEAR BEGINNING july VNF 'TY<ffb>' MAINTAIN taxyear ADD '01july98' '01july00' REPORT W 14 ENDOF(taxyear)
These statements produce the following output.
TAXYEAR ENDOF(TAXYEAR) -------------- -------------- TY98 30JUN99 TY99 30JUN00 TY00 30JUN01