IsDateEnd(Level:DimCalendarLevel): Boolean;
IsDateEnd[Level: Prognoz.Platform.Interop.Dimensions.DimCalendarLevel]: boolean;
Level. Calendar level.
The IsDateEnd property determines whether the period start date should be replaced with period end date for selected dictionary level.
Available values of IsDateEnd:
True. Period start date is the period end date. Offset is performed from the period end.
False. Period start date does not change. Offset is performed from the period start.
Offset is available for the following levels:
Years. Level = DimCalendarLevel.Year.
Quarters. Level = DimCalendarLevel.Quarter.
Months. Level = DimCalendarLevel.Month.
Weeks. Level = DimCalendarLevel.Week.
Use the ITsCalendarSettings.OffsetDate property to specify the number of days to which the data offset of period data start.
This example displays the custom vector calculation method. Add links to the Dimensions, Ms, Transform system assemblies to execute the example.
Function OffsetDate(Input: ITimeSeries): ITimeSeries;
Var
pContext: ITsCalculationContext;
i: Integer;
pSeries: ITimeSeries;
CalendSett: ITsCalendarSettings;
Begin
pContext := TsCalculation.Current;
pSeries := pContext.CreateTimeSeries;
CalendSett := Input.CalendarSettings;
If (CalendSett.IsDateEnd(DimCalendarLevel.Year)) And (CalendSett.OffsetDate(DimCalendarLevel.Year) = 1) Then
For i := Input.StartIndex To Input.EndIndex Do
pSeries.Item(i) := 1 + Input.Item(i);
End For;
Else
pContext.RaiseWarning("Used calendar parameters don't fit for method calculation");
End If;
Return pSeries;
End Function OffsetDate;
This method increases values of input series if an offset of the calendar level shifted to the year from the end of the calendar level is used.
Custom vector calculation method is given in this example.
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Transform;
Function OffsetDate(Input: ITimeSeries): ITimeSeries;
Var
TsCalc: TsCalculation;
pContext: ITsCalculationContext;
i: Integer;
pSeries: ITimeSeries;
CalendSett: ITsCalendarSettings;
Begin
TsCalc := New TsCalculation.Create();
pContext := TsCalc.Current[Null];
pSeries := pContext.CreateTimeSeries(-1 As DimCalendarLevel, Null) As ITimeSeries;
CalendSett := Input.CalendarSettings;
If (CalendSett.IsDateEnd[DimCalendarLevel.dclYear]) And (CalendSett.OffsetDate[DimCalendarLevel.dclYear] = 1) Then
For i := Input.StartIndex To Input.EndIndex Do
pSeries.Item[i] := 1 + (Input.Item[i] As double);
End For;
Else
pContext.RaiseWarning("Used calendar parameters don't fit for method calculation");
End If;
Return pSeries;
End Function OffsetDate;
This method increases values of input series if an offset of the calendar level shifted to the year from the end of the calendar level is used.
See also: