Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-02 |
|
|
View PDF |
The FCEXEC command executes a forecast based on the parameters options specified by the FCSET command for the forecast. The FCEXEC command implicitly loops over all the dimensions of the expression other than the time dimension.
You must use the FCEXEC command in combination with other OLAP DML statements as outlined in "Forecasting Programs".
Syntax
FCEXEC handle-expression [choice] time-series-expression
where choice is one or more of the following:
Arguments
An INTEGER
expression that specifies the handle to a forecasting context previously opened using the FCOPEN function.
The name of the time dimension. You do not have to specify this parameter when one dimension of the time-series-expression is of type DAY, WEEK, MONTH, QUARTER, or YEAR.
An INTEGER
expression that specifies the number of business days in the unit of time of the time data type (that is, DAY, WEEK, MONTH, or YEAR) of the time-series-expression. By default the value is the total number of days in the unit of time.
The name of the Oracle OLAP variable in which the forecasting engine stores the forecast data. This variable must be dimensioned by the time dimension and any other dimensions of the time-series-expression that have more than one value in status. (This variable can have additional dimensions. However, in this case, when Oracle OLAP executes the forecast, it limits each of these additional dimensions to the first value in the dimension's status list.).
Important:
When you do not specify INTO and the time-series-expression names an Oracle OLAP variable, the forecasting engine populates the input variable with the output data of the forecast, thus overwriting the original data.The name of the variable that the forecasting engine populates with the data that represents seasonal factors.The forecasting engine produces only one cycle of factors and stores these values into this variable beginning with the first time period in status. This variable must be dimensioned by the time dimension and any other dimensions of the time-series-expression that have more than one value in status. (This variable can have additional dimensions. However, in this case, when the forecasting engine executes the forecast, Oracle OLAP limits each of these additional dimensions to the first value in the dimension's status list.)
The name of the variable that the forecasting engine populates with the data that represents smoothed seasonal factors. The forecasting engine produces only one cycle of factors and stores these values into this variable beginning with the first time period in status; all other values are set to NA
. This variable must be dimensioned by the time dimension and any other dimensions of the time-series-expression that have more than one value in status. (This variable can have additional dimensions. However, in this case, when the forecasting engine executes the forecast, Oracle OLAP limits each of these additional dimensions to the first value in the dimension's status list.)
The BACKCAST keyword specifies that the forecasting engine returns fitted historical data. Typically this data is available only for a subset of the historical periods (sometimes called the "fit window"). The forecasting engine sets the value of the data that corresponds to the historical time periods that are outside of the fit window to NA
.
Important:
When you specify a value for BACKCAST and do not specify a value for INTO variable, the forecasting engine populates the source variable with the backcasted data, thus overwriting the original data.An expression that specifies the data from which FCEXEC calculates values. The time-series-expression must be a numeric expression that is dimensioned by time-dimension. The time-series-expression may also be dimensioned by other dimensions. In this case, FCEXEC implicitly loops over all the dimensions of the expression other than the time dimension. The maximum status length of the time-series-expression is 5000.
Notes
Forecasting a Single Value
The FCEXEC command implicitly loops over all the dimensions of the time-series expression other than the time dimension. When you want to forecast only one value of a multidimensional time-series expression, then you must limit the status of all non-time dimensions to a single value before you execute the FCEXEC command.
Examples
Example 14-9 A Forecasting Program
Suppose you define a program named autofcst
to perform a forecast from the data that is in an input variable named fcin1
. The fcin1
variable is dimensioned by a time dimension named timedim
. Assume that you have defined a program named autofcst
with the following definition and specification.
DEFINE autofcst PROGRAM PROGRAM " Using the Automatic forecasting method " Suppose you want to create a forecast from the data in " an input variable named fcin1 that is dimensionsed by " a time dimension named timedim. " " Open a forecasting context hndl = FCOPEN('MyForecast') " Initialize the target variables fcout1 = NA fcseas1 = NA fcsmseas1 = NA " Specify that the forecast be of the AUTOMATIC type fcset hndl method 'automatic' " Execute the forecast FCEXEC hndl time timedim INTO fcout1 - seasonal fcseas1 smseasonal fcsmseas1 backcast fcin1 " Create a report showing the input and output of the forecast REPORT DOWN timedim fcin1 fcout1 fcseas1 fcsmseas1 " Run a program named queryall to retrieve the characteristics " of the forecasting trials QUERYALL " Close the forecasting context FCCLOSE hndl END
The autofcst
program opens a forecasting context, sets the option of the forecast to AUTOMATIC, reports on the forecasted data, and queries and reports the characteristics of the various trials that Oracle OLAP performed to determine the method to use, and closes the forecasting context.
The autofcst
program contains the following report command that displays a report of the input to and the output from the forecast.
REPORT DOWN timedim fcin1 fcout1 fcseas1 fcsmseas1
The sample report created by this statement follows.
TIMEDIM FCIN1 FCOUT1 FCSEAS1 FCSMSEAS1 -------------- ---------- ---------- ---------- ---------- Jan97 NA NA 1.06725482 1.02926773 Feb97 NA NA .978607917 .945762221 Mar97 NA NA 1.12699278 .860505188 Apr97 NA NA .576219022 .905284834 May97 NA NA .920601317 .907019312 Jun97 NA NA 0.91118344 1.0580697 Jul97 NA NA 1.07886483 1.05597234 Aug97 NA NA 1.08101034 1.054612 Sep97 NA NA 1.08077427 1.05361672 Oct97 2,914 NA 1.08351799 1.05380407 Nov97 2,500 NA 1.01126778 1.04504316 Dec97 2,504 NA 1.08370549 1.03104272 Jan98 3,333 NA NA NA Feb98 2,512 NA NA NA Mar98 2,888 NA NA NA ... ... ... ... ... Jan01 NA 3,371.7631 NA NA Feb01 NA 2,736.4811 NA NA Mar01 NA 3,408.3656 NA NA Apr01 NA 714.277175 NA NA May01 NA 2,502.9315 NA NA Jun01 NA 3,195.3626 NA NA Jul01 NA 3,911.6058 NA NA Aug01 NA 4,000.651 NA NA Sep01 NA 4,220.2658 NA NA Oct01 NA 3,416.0208 NA NA Nov01 NA 2,827.3943 NA NA Dec01 NA 2,990.8629 NA NA
The queryall
program and a sample report created from its output is shown in "Querying a Forecast".