Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-02 |
|
|
View PDF |
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.
Return Value
DATE or text (see "Automatic Conversion of DATE Values to Text Values")
Syntax
ENDOF(dwmqy-dimension)
Arguments
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.
Examples
Example 13-26 Finding the Fiscal Year End Date
The following statements define a year dimension (called taxyear
, for a tax year that begins in July), add dimension values for tax years 1998
through 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