Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-01 |
|
|
View PDF |
The GROWRATE function calculates the growth rate of a time-series expression, based on the first and last values of the series.
GROWRATE bases its calculation on the values of expression that correspond to the first and last values in the status of time-dimension. The intervening values of expression are ignored. GROWRATE uses the following calculation.
GROWRATE = ((last/first)**(1/(n-1))-1
In the exponent, n is the number of values in the status of the time dimension.
Return Value
DECIMAL
The result returned by GROWRATE is dimensioned by all the dimensions of expression except the dimension specified by time-dimension.
Syntax
GROWRATE(expression [time-dimension])
Arguments
A numeric expression for which you want to calculate the growth rate. The expression must be dimensioned by a time dimension.The following rules apply to the first and last values of expression:
The first value of expression cannot be zero. (This is to avoid a division by zero in the GROWRATE calculation.)
The first and last values of expression must both be positive or both negative. (Or the last value of expression can be zero, regardless of whether the first value is positive or negative.)
Neither the first value nor the last value of expression can be NA
.
The name of the time dimension by which expression is dimensioned. When the time dimension has a type of DAY, WEEK, MONTH, QUARTER, or YEAR, the time-dimension argument is optional, unless loans has more than one time dimension.
Examples
Example 14-6 Determining Growth Rate
The following statements limit the dimensions of the actual
variable and produce a report.
LIMIT month TO 'Dec95' TO 'Mar96' LIMIT line TO 'net.income' REPORT DOWN division ACROSS month: actual
These statements produce the following report.
LINE: NET.INCOME ------------------ACTUAL------------------- -------------------MONTH------------------- DIVISION Dec95 Jan96 Feb96 Mar96 -------------- ---------- ---------- ---------- ---------- Camping 4,378.09 19,915.13 22,510.38 34,731.63 Sporting 6,297.02 13,180.29 17,429.17 18,819.14 Clothing 87,471.74 107,257.85 133,566.01 127,132.55
The statement REPORT W 20 GROWRATE(actual)
produces a report that shows the growth rate of the actual net income in the demo
workspace between December 1995 and March 1996.
--GROWRATE(ACTUAL)-- --------LINE-------- DIVISION NET.INCOME -------------- -------------------- Camping 0.99 Sporting 0.44 Clothing 0.13