Increase_Decrease

This function increases or decreases a Destination POV by a percentage Factor. The percentage factor may be taken from either a Source POV, a VBScript constant or a VBScript variable.

Return Value

No return value.

Syntax

Increase_Decrease(Destination,Source,Factor,Scale,Inverse)

Table 12-20 Syntax of Increase_Decrease 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. Source is the amount that is to be allocated.

Factor

A valid source POV, constant, or variable.

Scale

Integer value 1 or 100. Factor is divided by scale.

Inverse

True or False. True reverses the sign of the Factor. This can be used to generate a decrease where the Factor is stored as a positive number (or vice-versa). False uses the stored sign of the Factor to determine an increase or decrease.

Detailed Description

This function increases or decreases a Destination POV by a percentage factor. The percentage factor may be taken from a Source POV, a VBScript constant or a VBScript variable.

In general, the Source POV is the same as the Destination POV, however, it can be different.

The Scale parameter is used to scale down the factor, if required. This applies when the factor is taken from a Source POV and the factor is stored in a non-scaled form (for example, 50% is stored as 50 and not 0.50).

The Inverse parameter is used to reverse the sign of the factor. This applies when the factor is taken from a Source POV and the factor is stored as an absolute number. If the Inverse parameter is set to True, the factor is multiplied by -1. If the Inverse parameter is set to False, the factor is not multiplied -1.

Example

In this example, the Telephone account is increased by 10%.

Table 12-21 Example of Increase_Decrease Function

Account Jan2014 Feb2014 Mar2014

A#Telephone

100

300

400

A#Factor/C1[None]

10

10

10

Increase_Decrease("A#Telephone", "A#Telephone", "A#Factor.C1#[None]",100,False)

N/A

N/A

N/A

A#Telephone

110

330

440

The result returned from the INCREASE_DECREASE function is as follows:

HS.EXP "A#Telephone = A#Telephone * (1+ (A#Factor.C1#[None]/100))"

Sample Script

  • A sample statement written in the calling routine.

  • Variables set in the calling routine and passed to the Increase_Decrease function.

  • Variable names in the calling routine set to be the same as the Increase_Decrease function.

    Sub Calculate()
    Dim Destination
    Dim Source
    Dim Factor
    Dim Scale
    Dim Inverse 
    Destination = "A#Telephone"
    Source = "A#Telephone"
    Factor = "A#Factor.C1#[None]"
    Scale = "100"
    Inverse = False
    Call Increase_Decrease(Destination,Source,Factor,Scale,
    Inverse)
    End Sub
    ' Beginning of the Increase_Decrease function 
    Sub Increase_Decrease(Destination,Source,Factor,Scale,Inverse)
    If Inverse = False Then
    HS.EXP Destination & " = " & Source & " * 
    (1 + (" & Factor & " / " & Scale & "))"
    Else
    HS.EXP Destination & " = " & Source & " * 
    (1 + ((" & Factor & " * -1) / " & Scale & ))"
    End If
    End Sub