Spread
This function allocates a single time period value (for example,. P#[Year]) of a Source Account to all periods of a Destination Account based on a profile defined in a Profile Account (for example, Revenue profile, 4-4-5, etc.).
Return Value
No return value.
Syntax
Spread(Destination,Source,Factor,FactorN,FactorD,Temp,Per)
Table 12-24 Syntax of Spread Function
Parameter | Valid Values |
---|---|
Destination |
A valid destination POV that is a valid combination of Account, ICP and Custom 1-4 members. |
Source |
A valid source POV that is a valid combination of dimension members. The Source POV must include a single time period, for example, P#[Year]. The single time period amount is the amount to be spread. |
Factor |
A valid source POV. Factor is the account used to store the allocation factor. |
FactorN |
A valid source POV. FactorN is the numerator factor used as the basis for spread allocation. |
FactorD |
A valid source POV. FactorD is the denominator factor used as the basis for spread allocation. |
Temp |
A valid destination Account. Temp is the account that temporarily stores the Source value. |
Per |
A period string that defines the name of the first period in the timeframe, for example, "January". The Temp value is stored in the first period and the parameter is required to refer to this in the calculation. |
Detailed Description
This function allocates a single time period value (for example, P#[Year]) of a Source POV to all periods of a Destination POV based on a profile defined in a Profile POV (for example, Revenue profile, 4-4-5, and so on).
Time-based allocations are particularly suited to budgeting applications where amounts are first entered for the total year, and then later allocated across time periods based on a suitable profile.
The Source POV must contain a single time period. The time period will generally be P#[Year], but could be any single period, such as P#January.
The value in the Source POV is stored by the calculation in a temporary account. This is required because the source and destination accounts are typically the same account. Where this is the case, the value in P#[Year] changes as the calculation proceeds from 1 period to the next. Therefore, you must store the value first to be able to refer to it for all time periods.
It is recommended that variables are set in the calling routine and passed to the Spread function, which define the Destination, Source, Profile, Temp, and Period1 parameters. It is also recommended that the variable names in the calling routine be set to be the same as the Spread function.
Example
The Year value in the Telephone account are allocated across Time Periods using a 4-4-5 quarterly ratio.
The result returned from the SPREAD function is as follows:
HS.EXP "A#TempTelephone.C1#[None] = A#Telephone.C1#[None].P#[Year]" (Where Period.Number = 1)
HS.EXP "A#Telephone.C1#[None] = A#TempTelephone P#January * E.Globals.A#Profile445.C1#[None].P#Cur / E.Globals.A#Profile445.C1#[None].P#[Year]
Sample Script
The script contains the following information:
-
A sample statement written in the calling routine.
-
Variables set in the calling routine and passed to the Spread function.
-
Variable names in the calling routine set to be the same as the Spread function.
Sub Calculate()
Dim Destination Dim Source Dim Factor Dim FactorN Dim FactorD Dim Temp Dim Per
Source = "A#Telephone.C1#[None].P#[Year]" Destination = "A#Telephone.C1#[None]" Factor = "A#Factor.C1#[None]" FactorN = "E#Globals.A#Profile445.C1#[None].P#CUR" FactorD = "E#Globals.A#Profile445.C1#[None].P#[Year]" Temp = "A#TempTelephone.C1#[None]" Per = "January"
Call Spread(Destination,Source,Factor, FactorN,FactorD,Temp,Per)
End Sub
' Beginning of the Spread function
Sub Spread(Destination,Source,Factor,FactorN,FactorD,Temp,Per)
If HS.Period.Number = 1 Then
HS.Exp Temp & " = " & Source
End If
HS.Clear Factor HS.EXP Factor & " = " & FactorN & " / " & FactorD
HS.Clear Destination HS.EXP Destination & " = " & Temp & ".P#" & Per & " * " & Factor
End Sub