Increase_Decrease

此函数按百分比因子增加或减少目标 POV。百分比因子可以取自源 POV、VBScript 常量或 VBScript 变量。

返回值

没有返回值。

语法

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

表 12-20 Increase_Decrease 函数的语法

参数 有效值

Destination

有效的目标 POV,是帐户、ICP 和 Custom 1-4 成员的有效组合。

Source

有效的源 POV,是维成员的有效组合。Source 是要分摊的金额。

Factor

有效的源 POV、常量或变量。

Scale

整数值 1 或 100。因子除以缩放比例。

Inverse

True 或 False。True 反转因子的正负号。当因子存储为正数时,此参数可用于生成减少(反之亦然)。False 使用存储的因子正负号来确定增加还是减少。

详细说明

此函数按百分比因子增加或减少目标 POV。百分比因子可以取自源 POV、VBScript 常量或 VBScript 变量。

一般情况下,源 POV 与目标 POV 相同,但也可以不同。

Scale 参数用于根据需要按比例减小因子。这适用于因子取自源 POV 并且以未缩放形式(例如 50% 存储为 50 而不是 0.50)存储的情况。

Inverse 参数用于反转因子的正负符号。这适用于因子取自源 POV 并且以绝对数值形式存储的情况。如果 Inverse 参数设置 True,则将因子乘以 -1。如果 Inverse 参数设置 False,则不将因子乘以 -1。

示例

在以下示例中,Telephone 帐户增加了 10%。

表 12-21 Increase_Decrease 函数的示例

帐户 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)

不适用

不适用

不适用

A#Telephone

110

330

440

从 INCREASE_DECREASE 函数返回的结果如下:

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

示例脚本

  • 在调用例程中编写的示例语句。

  • 在调用例程中设置变量并将其传递给 Increase_Decrease 函数。

  • 调用例程中的变量名称设置为与 Increase_Decrease 函数中的相同。

    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