BackwardLag: Integer;
The BackwardLag property determines the backward lag specifying the number of preceding elements not included in the selection, by which the values will be extracted.
The backward lag is the shifting backwards by the selection relative to the first selected element. The value of the BackwardLag property specifies, for which preceding elements not included in the selection, the value will be extracted.
The value of the lag must be specified if the formula contains the LAGVAL function, which gets the value of the element shifted relative to the specified element. If the element, which coordinate was calculated by the LAGVAL function is missing in the selection, the function will get the empty value because the value by this element is not extracted from the data source. Specifying the BackwardLag and ForwardLag properties enables the user to set the necessity of extraction values by the elements missing in the selection.
Executing the example requires that the repository contains a calculated cube with the Calc_Cube identifier. The first data source of the calculated cube in its structure contains a dimension with the Calendar identifier.
Sub UserProc;
Var
MB: IMetabase;
Cube: ICalculatedCube;
Dim: ICalculatedCubeDimension;
Begin
MB := MetabaseClass.Active;
Cube := MB.ItemById("Calc_Cube").Edit As ICalculatedCube;
Dim := Cube.Sources.Item(0).Dimensions.FindById("Calendar");
Dim.BackwardLag := 3;
Dim.ForwardLag := 3;
(Cube As IMetabaseObject).Save;
End Sub UserProc;
On executing the example for the specified dimension of the source cube the lags will be specified determining the number of elements not included by the selection, for which the values will be extracted.
See also: