Pro_Rata_Ratio
This function calculates the ratio between two source POVs (C = A / B).
Return Value
No return value.
Syntax
Pro_Rata_Ratio(Destination,SourceN,SourceD)
Table 12-22 Syntax of Pro_Rata_Ratio Function
Parameter | Valid Values |
---|---|
Destination |
A valid destination POV that is a valid combination of Account, ICP and Custom 1-4 members. |
SourceN |
A valid source POV that is a valid combination of dimension members. SourceN is the numerator of the ratio calculation. |
SourceD |
A valid source POV. SourceD is the denominator of the ratio calculation. |
Detailed Description
This function calculates the ratio between two source POVs (C = A / B).
As a best practice, it is recommended that variables are set in the calling routine and passed to the Pro_Rata_Ratio function, which define the Destination, SourceN and SourceD POVs. It is also recommended that the variable names in the calling routine be set to be the same as the Pro_Rata_Ratio function.
The system does not naturally calculate weighted average ratios for parent members. Parent member values display as an aggregation of child values. This results in a mathematically incorrect value for parent members. As such, it is recommended that aggregation be turned off for Ratio accounts.
Example
The MarginPct account will return the value of GrossMargin/TotalRevenues.
Table 12-23 Example of Pro_Rata_Ratio Function
Account | Jan2014 | Feb2014 | Mar2014 |
---|---|---|---|
A#GrossMargin |
1000 |
100 |
750 |
A#TotalRevenues |
2000 |
400 |
1000 |
|
0.50 |
0.25 |
0.75 |
The result returned from the PRO_RATA_RATIO function is as follows:
HS.EXP "A#MarginPct = A#GrossMargin / A# TotalRevenues"
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 Pro_Rata_Ratio function.
-
Variable names in the calling routine set to be the same as the Pro_Rata_Ratio function.
Sub Calculate()
Dim Destination 'Destination POV Dim SourceN 'Source Numerator POV Dim SourceD 'Source Denominator POV
Destination = "A#MarginPct" SourceN = "A#GrossMargin" SourceD = "A#TotalRevenues "
Call Pro_Rata_Ratio(Destination,SourceN,SourceD)
End Sub
' Beginning of the Pro_Rata_Ratio function
Sub Pro_Rata_Ratio(Destination,SourceN,SourceD)
HS.EXP Destination & " = " & SourceN & " / " & SourceD
End Sub