Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

ENDOF

The ENDOF function returns the last date of a time period in dimension of type DAY, WEEK, MONTH, QUARTER, or YEAR.


Note:

You can only use this function with dimensions of type DAY, WEEK, MONTH, QUARTER, or YEAR.You cannot use this function for time dimensions that are implemented as hierarchical dimensions of type TEXT.

Return Value

DATE

Syntax

ENDOF(dwmqy-dimension)

Arguments

dwmqy-dimension

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.

Notes


How ENDOF Works

ENDOF returns the last date of the time period that is first in the current status list of the dwmqy-dimension.


Phased or Multiple Periods

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.


Format of the Date

When you display the result returned by ENDOF, the date is formatted according to the date template in the DATEFORMAT option. When the day of the week or the name of the month is used in the date template, the day names specified in the DAYNAMES option and the month names specified in the MONTHNAMES option are used. You can use the result returned by ENDOF anywhere that a DATE value is expected.


DATE-to-TEXT Conversion

You can also use the result where a text value is expected. The date is converted automatically to a text value, using the current template in the DATEFORMAT option to format the text value. When you want to override the current DATEFORMAT template, you can convert the date result to text by using the CONVERT function with a date-format argument.


Retrieving the First Date of a Time Period

The STARTOF function, which returns the first date of a time period.

Examples

Example 11-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