Professional Documents
Culture Documents
Use Only: Hyperion Financial Management 9.3.1 Create Rules
Use Only: Hyperion Financial Management 9.3.1 Create Rules
e
d
a
D52786GC10
Edition 1.0
January 2008
D53155
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
c
A
Author
Mark Mitsock
Disclaimer
Technical Contributors
and Reviewers
Keith Glide
Jennifer Hough
Daniel Tijerina
Editor
Susan Moxley
Graphic Designer
Carisa Cannan
Publisher
Judy Gaitan
e
d
a
y
m
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Table of Contents
Preface
Course Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Course Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
Course Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
Student Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
Activity Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Table of Contents
y
m
e
d
a
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
e
l
c
4-2
4-3
4-4
4-6
a
r
O
iv
Table of Contents
y
m
e
d
a
Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Arrays and Loops in Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
Creating Array Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
Filling Arrays Using Member Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
Creating Loops. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
For...Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
For Each...Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
Do...Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
Assigning Values with Arrays and Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
Attributes in Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Loops and Data Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
Opening Data Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
Creating Loops With Data Units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
Table of Contents
y
m
e
d
a
c
A
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
l
c
a
r
O
vi
Preface
y
m
e
d
a
Course Objectives
c
A
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
a
r
O
e
l
c
Preface
Course Structure
Hyperion Financial Management 9.3.1: Create Rules is a 3-day, instructor-led training
course consisting of lectures, demonstrations, and hands-on exercises. In this course,
the instructor presents a topic conceptually by explaining its purpose, demonstrating how
it works, and then guiding the students through the exercises. Demonstrations and
hands-on exercises reinforce the concepts and skills introduced during lectures.
Course Materials
You use two books in classthe student guide and the student workbook. The instructor
may also give you handouts.
Student Guide
The student guide is designed to be used by students and the instructor during lecture
time. It has four modules:
Module 1 describes the basics of Financial Managment rules.
y
m
Module 2 describes how to create custom Sub and Function procedures. You learn to
create rules using arrays and loops.
e
d
a
Module 3 describes how to work with Financial Management data and hierarchies.
Module 4 describes how to customize the default currency translation and
consolidation calculations.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Each module contains lessons. Each lesson begins with a list of objectives followed by
the presentation of slides and accompanying text. The lesson ends with a summary of
the topics covered in the lesson.
A glossary provides definitions of terms used during the course.
Activity Guide
e
l
c
Exercise Solutions
The exercise solutions present the detailed steps to successfully complete the exercises.
a
r
O
viii
Preface
Conventions
The following text conventions are used in this course book:
Text to be typed, options to be selected, names of files and modules, and menu
selections are displayed in bold type. Examples:
- Select Clear Profile.
- To clear the profile, click Yes.
Keyboard shortcuts are displayed as follows:
Ctrl+Enter
For the example, you would press the Ctrl key and the Enter key at the same time.
Tips and Notes are used to direct your attention to different types of information.
NOTE
A note provides related information, common mistakes, and cautions about the
current topic.
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
ix
Preface
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
x
M O D U L E
Overview
In this module you learn the basics for creating Financial Management
rules.
Lessons in this module include:
Reviewing Rules Syntax
Reducing Maintenance with Variables
Managing the Scope of Rules
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Explain the purpose of rules in Financial Management
Describe objects and functions in expressions
Create rules expressions
Identify Financial Management rule types
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
About Rules
Hyperion Financial Management rules provide powerful, customized
calculations that you can use to perform the following tasks:
Calculate data that cannot be calculated through a hierarchical
aggregation, such as ratios or variance analyses
Perform complex currency conversions and calculate exchange rate
differences or other calculations necessary for consolidation
Prevent data entry for a specific cell
Perform allocations from a parent entity to a list of base entities
Enable data entry to a parent entity
Perform custom consolidations for statutory reporting requirements
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
About Rules
y
m
e
d
a
c
A
You use rules to perform calculations that you cannot define through parent-child
relationships in the dimension hierarchy. For example, you can create a rule to calculate
the value of the Salaries member by multiplying the Headcount member by the
SalaryRate member.
e
l
c
a
r
O
1-2
Function
HS.Entity.DefCurrency
HS.Scenario.DefCurrency
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
A programming language consists of its own vocabulary and grammar. Objects are
equivalent to nouns in programming languages. For example, in Financial Management,
the Entity object represents the Entity dimension, the Account object represents the
Account dimension, and so on. Functions are the verbs that express the actions of a
programming language.
To create rules, you should be familiar with these basic principles about objects:
Objects contain their own sets of functions.
For example, you can use certain functions only with the Period object.
Objects can be children of other objects.
For example, the top-level object in Financial Management is named HS. The HS
object contains some functions and several other objects.
e
l
c
a
r
O
When you write rules, you use dot notation (dot) to separate objects from other
objects and functions.
1-3
Function
HS
ABSExp
Alloc
CalcStatus
Clear
Con
Exp
Dynamic
GetCell
GetCellNoData
GetCellRealData
GetCellType
GetRate
ImpactStatus
Input
NoInput
NoRound
OpenDataUnit
ReviewStatus
Round
SetData
SetDataWithPOV
Trans
TransPeriodic
Account
e
l
c
AccountType
C1...4 Top
IsBase
IsChild
IsConsolidated
IsDescendant
IsICP
List
NumBase
NumChild
NumDescendant
PlugAccount
SecurityClass
UD1...3
ValidationAccount
XBRLTags
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
a
r
O
1-4
Function
AppSettings
Currency
ICPWeight
PVAForBalance
PVAForFlow
RateForBalance
RateForFlow
Currency
Scale
Custom1,
Custom2,
Custom3, and
Custom4
IsBase
IsDescendant
List
NumBase
NumChild
NumDescendant
SecurityClass
SwitchSign
SwitchType
UD1...3
DataUnit
GetItem
GetItemIds2
GetNumItems
Entity
AllowAdjs
AllowAdjsFromChildren
DefCurrency
Holding
IsBase
IsChild
IsDescendant
IsICP
List
Member
NumBase
NumChild
NumDescendant
SecurityAsPartner
SecurityClass
UD1...3
e
l
c
ICP
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
List
a
r
O
1-5
Function
Node
Consol1...3
DOwn
IsBase
IsChild
IsDescendant
List
Method
NumBase
NumChild
NumDescendant
PCon
POwn
Parent
DefCurrency
Holding
IsBase
IsChild
IsDescendant
IsICP
List
Member
NumBase
NumChild
NumDescendant
UD1...3
Period
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
IsFirst
IsLast
List
Member
NumBase
Number
Scenario
e
l
c
y
m
e
d
a
c
A
ConsolidateYTD
DefaultFreq
DefaultView
List
Member
NumPeriods
SecurityClass
UD1...3
a
r
O
1-6
Function
Value
Currency
IsTransCur
IsTransCurAdj
Member
Year
IsFirst
IsLast
Member
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
1-7
You can use account expressions within Exp to specify the source and
destination values.
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You create rules expressions by using Financial Management objects and functions to
perform these types of tasks:
Calculating data
Consolidating data
HS.Exp Function
The most frequent use of a rule expression is assigning values to accounts. Use the
HS.Exp function to assign values to accounts.
e
l
c
a
r
O
1-8
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
1-9
Account Expressions
An account expression uses a dimension keyword to specify a value or
a set of values.
A dimension keyword is separated from its values by a pound sign (#).
A#NetIncome
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Account Expressions
e
d
a
c
A
Account expressions identify cells in the database by specifying one or more dimension
members. The Exp function requires an account expression on the left (destination) side
of the equal sign. The right (source) side of the equal sign can be an account expression,
a constant value, or any function that returns a numeric value.
Dimension Keywords
An account expression uses a dimension keyword to specify a value or a set of values. A
dimension keyword is separated from its values by a pound or hash sign (#), and
dimensions are separated by dots. For example:
e
l
c
A#Cash.P#January.E#USA.C1#OpeningBalance
a
r
O
1-10
Description
S#
Scenario
Y#
Year
P#
Period
V#
Value
E#
Entity
W#
View
A#
Account
I#
Intercompany Partner
C1#
Custom1
C2#
Custom2
C3#
Custom3
C4#
Custom4
y
m
e
d
a
Destination Expressions
The destination for the Exp function is specified by the Account, Custom, and ICP
members specified on the left side of the equal sign. The destination Entity, Period, Year,
Value, members are determined by the current point of view (POV) members or by the
cells selected on the data grid or form. The members for the currently selected cells on
the grid override the current POV members. The destination View member is the current
scenario default view, regardless of the currently select POV members.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Source Expressions
When you use an account expression on the right side of the equal sign with Exp, you
can specify any dimension member. If you do not specify a Entity, Period, Year, or Value
dimension member, the current POV member or the current cells selected on the grid or
data form are used. If you do not specify a View member, the source is the current
scenario default view, regardless of the currently select POV member.
e
l
c
a
r
O
1-11
You can use Period and Year keywords for dynamic time calculations.
HS.Exp "A#MiscPast = A#Misc.Y#Cur-2"
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can add, subtract, multiply, and divide on the right side of the equal sign. You must
use the following standard VBScript characters: + - * /
If you multiply or divide with an account that has a NoData status, the data in the account
on the left side of the equal sign is not changed. Zero is considered data. An account that
contains 0.00 as data does not have a NoData status.
The following example sets the amount in the StateTax account. This example calculates
the StateTax amount by multiplying the amount in the Sales account for 2005 by the rate
in the StateRate account for 2005:
e
l
c
a
r
O
1-12
Description
Cur
First
Last
Next
Prior
You can use plus (+) and minus (-) with the Period and Year keywords. The following
example sets the MiscPast account to the amount in the Misc account two periods before
the current period:
HS.Exp "A#MiscPast = A#Misc.P#Cur-2"
y
m
e
d
a
If an HS function returns a single numeric value, you can nest the function in the Exp
function. However, if you nest a function that contains a string argument, you cannot
enclose the string in quotation marks. In the following example, the NumBase function is
nested in the Exp function to retrieve the number of base entities for the Regional
member:
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
e
l
c
a
r
O
1-13
Calculate
Dynamic
Translate
Allocation
Input
No Input
Consolidate
Transactions
Sub Calculate()
HS.Exp "A#TargAcct=A#SourceAcct
End Sub
Sub NoInput()
HS.NoInput"A#Sales.S#Budget
End Sub
You place the rules for each type in a separate sub procedure in the
rules file.
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Calculate rules are executed when you perform calculations and consolidations. You
use calculate rules for these tasks:
-
Dynamic rules enable you to create ratios that accurately calculate parent values for
the Period, VIew, and custom dimensions. Parent values for percentages for these
dimensions are not accurately calculated by the aggregation of base member values.
e
l
c
a
r
O
Translate rules execute when you perform translations. These rules can override
default translation calculations.
1-14
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
1-15
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Executed
Translate()
e
l
c
Allocate()
a
r
O
Input()
1-16
Executed
NoInput()
Transactions()
Consolidate()
The routines are created in any order. Use the following syntax to define each routine:
Sub Calculate()
<All calculate rules are displayed here.>
End Sub
Sub Dynamic()
<All dynamic rules are displayed here.>
End Sub
Sub Translate()
<All translate rules are displayed here.>
End Sub
Sub Allocate()
<All allocation rules are displayed here.>
End Sub
Sub NoInput()
<All no input rules are displayed here.>
End Sub
Sub Consolidate()
<All consolidate rules are displayed here.>
End Sub
Sub Input
<All input rules are displayed here.>
End Sub
Sub Transactions()
<All transactions rules are displayed here.>
End Sub
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
a
r
O
1-17
y
m
Sub NoInput()
HS.NoInput"A#Sales.S#Budget
End Sub
Copyright 2008, Oracle. All rights reserved.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
e
l
c
a
r
O
1-18
Line
Continuation
Syntax
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can use line continuation so that the entire string can be viewed without having to
scroll to the right of the code window.
If you must break a line into multiple strings, place the line continuation character
between the strings, and then concatenate them using the ampersand (&). It is critical to
preserve all spaces in the string when it is concatenated.
NOTE
You cannot use the line continuation character in comments, you must repeat the
comment character apostrophe () at the beginning of each comment string line.
e
l
c
a
r
O
1-19
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
1-20
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can control the flow of your script with conditional statements. You can write
VBScript that makes decisions and repeats actions.
e
l
c
a
r
O
1-21
Is executed only if
the current member
is Budget
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
For If...Then...Else statements that have multiple conditions, the first statement that
evaluates to true is executed. Any conditions that follow are not evaluated or
executed.
e
l
c
a
r
O
If you include an Else statement, the lines of script after the Else statement execute if
none of the condition are met.
1-22
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
1-23
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
e
l
c
a
r
O
1-24
LCase
If LCase(HS.Scenario.Member)= "budget" Then...
Left Function
Dim Product1, RtnString
Product1 = "Financial Management"
' Define string.
RtnString = Left(Product1, 9)
' Returns "Financial"
Right Function
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
e
l
c
a
r
O
1-25
UCase Function
Returns a string that was converted to uppercase.
Syntax
UCase(String)
Arguments
String: A text string or a function that returns a text string.
Example
If UCase(HS.Scenario.Member)=ACTUAL Then
Only lowercase letters are converted to uppercase; all uppercase letters and nonletter
characters remain unchanged.
LCase Function
Returns a string that was converted to lowercase.
y
m
Syntax
e
d
a
LCase(String)
Example
If LCase(HS.Scenario.Member)=actual Then
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Only uppercase letters are converted to lowercase; all lowercase letters and nonletter
characters remain unchanged.
Left Function
Returns a string containing a specified number of characters from the left side of a string.
A left function contains two required parts:
e
l
c
Left(String,Length)
a
r
O
1-26
Right Function
Returns a string containing a specified number of characters from the right side of a
string.
A Right function contains two required parts:
Use String to return the requested values.
Use Length (numeric value) to determine the number of characters to return.
Syntax
Right(String,Length)
y
m
Example
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
1-27
Summary
In this lesson, you should have learned to:
Explain the purpose of rules in Financial Management
Describe objects and functions in expressions
Create rules expressions
Identify Financial Management rule types
Distinguish between Sub procedures
Add comments and line breaks
Create conditional statements and compare strings
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
1-28
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Create variables and constants
Set up variables header sections for the Point of View
Set up variables header sections for custom dimensions, intercompany
partner (ICP) dimensions, and global accounts
Set up a variables header section for conditional triggers
e
d
a
y
m
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Variables are placeholders that temporarily store values when the rules script is being
executed. You can change the value of variables as many times as needed during
execution.
Variables simplify your script by letting you give short, descriptive names to data used in
your rules. For example, pov_entity instead of HS.Entity.Member
Variables improve performance because you can retrieve application data once and then
reuse the data throughout a procedure. For example, you could retrieve the year total for
the Sales account from your Financial Management application and store it in a variable.
You can then use the variable in a series of calculations in your procedure, instead of
retrieving the value from the application each time.
e
l
c
a
r
O
2-2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can create variables explicitly using one or more Dim statements at the start of a
subroutine. This method, called declaring the variables, enables you to look in a single
place in a procedure when you want to reuse variables and need to remember their
names.
You can also create variables on the fly. However, they are scattered throughout the
procedure. This method makes it difficult to check variable names when you want to
reuse them.
Dim Statement Syntax:
e
l
c
Dim VariableName
For example,
a
r
O
Dim vAcc1
2-3
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
Notice that when the variable is at the end of the HS.Exp statement, it does not require a
closing quotation mark.
e
l
c
a
r
O
2-4
Cbool
CDate
CDbl
CInt
CLng
CSng
CStr
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
In VBScript, you cannot specify in advance that a variable holds only a particular data
type. Instead, you must use a variable known as a variant to store any data type.
When you assign a value to the variable, VBScript automatically assigns the data type.
Sometimes you may need to override the default data type. For example, you may need
to store all values as integers.
You can use conversion functions to explicitly set the data type:
Function
Description
CBool
CDate
ra
e
l
c
CDbl
2-5
Description
CInt
CLng
Converts an expression to a Long value (an integer that can store a value
from -2,147,483,648 to 2,147,483,647).
CSng
CStr
This example converts the result of the calculation to an integer and stores it in the
variable vGM_Pct:
vGM_Pct=CInt(vMargin/vNetSales*100)
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
2-6
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Variables can be used only in the Sub procedure in which they are created. Constants
are similar to variables, but with these differences:
You can use constants in all Sub procedures within the script.
After you define a constant (that is, after it has been assigned a value), you cannot
change it.
You can declare constants anywhere in the script file. If constants are declared at the
beginning of the file, outside of any procedure, they are available to all procedures at all
times. If constants are declared within a procedure, they are available only for that
procedure.
e
l
c
a
r
O
2-7
y
m
A naming convention for constants is to use uppercase for names and underscores as
separators, as in this example:
e
d
a
const PRIOR_YEAR_RATE=75
c
A
You cannot use functions to assign values to constants. This statement returns an error:
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
const CURRENT_ENTITY=HS.Entity.Member
e
l
c
a
r
O
2-8
Top and [None] members for custom and ICP dimensions; global
accounts
ALL_NONE = ".I#[ICP None].C1#[None].C2#[None].C3#[None].C4#[None]"
ALL_TOPS = ".I#[ICP Top].C1#TopC1.C2#TopC2.C3#TopC3.C4#TopC4"
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
e
l
c
a
r
O
2-9
For the variable for the current period, you can use HS.Period.Number instead of
HS.Period.Member. Because the fiscal year can start on different months in
different applications, if you use period numbers rather than member names, it is
easier to reuse your rules in more than one application.
y
m
Custom and ICP dimensions in account expressions often need to be set to the top
member or the [None] member. This can result in a long expression that is difficult both
to type and to read.
e
d
a
Example
c
A
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
To simplify your code, you can store the text string for custom and ICP members in a
variable or constant, as in this example:
const All_TOPS=.I#[ICP Top].C1#TopC1.C2#TopC2.C3#TopC3.C4#TopC4"
You can then use the constant or variable in the account expression in place of the
string:
HS.EXP A#RetainedIncome=A#Profit" &All_TOPS
Because the custom and top member names do not change when the Point of View
changes, you can use constants instead of variables.
e
l
c
a
r
O
2-10
Global Accounts
You frequently need to refer to global accounts in your rules, such as the accounts used
to store exchange rates or head count. You can create variables or constants for these
accounts and then use them throughout your file. For example:
vHead=.A#HeadCount
vEfx=.A#EndingRate
Because the global member names do not change when the Point of View changes, you
can use constants instead of variables.
y
m
vIsBase = HS.Entity.IsBase("","")
e
d
a
You can then use the variable as needed in conditional statements. Because they are
Boolean values, a value of True is assumed as the test.
If vIsBase Then
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
You can use the Not keyword to test for a false condition. This statement executes only if
the entity is not a base member:
If Not vIsBase Then
HS.EXP A#Sales=A#UnitsSold * A#Price
End If
For clarity in your code, you can specify True or False as the condition:
If vIsBase=True Then
HS.EXP A#Sales=A#UnitsSold * A#Price
End If
e
l
c
a
r
O
2-11
Description
IsBase
IsCalculated
IsChild
IsConsolidated
IsDescendant
IsFirst
IsICP
IsLast
IsTransCur
y
m
IsTransCurAdj
e
d
a
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Because the results returned by these functions can change based on the Point of View,
you must use variables rather than constants.
e
l
c
a
r
O
2-12
Summary
In this lesson, you should have learned to:
Create variables and constants
Set up variables header sections for the Point of View
Set up variables header sections for custom dimensions, ICP
dimensions, and global accounts
Set up a variables header section for conditional triggers
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
2-13
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
2-14
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Describe the effect of the subcube structure on Financial Management
rules
Manage the scope of rules with the Account, ICP, and custom
dimensions
Manage the scope of rules with the Value dimension
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Period
Gross Sales
Dis counts
Returns
166
182
143
Products
131
149
120
73
150
145
267
116
211
Diet Cola
Root Beer
Cream Soda
Fruit Soda
Jan
Feb
Mar
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
e
l
c
a
r
O
3-2
Entity Currency
Parent Currency
Proportion
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
e
l
c
a
r
O
3-3
Subcube Dimensions
California, Actual, 2006, Entity Currency
Account
ICP
C1
C2
C3
C4
View
Period
NetSales
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
300
GrossSales
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
350
Discount
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
25
Returns
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
25
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Subcube Dimensions
e
d
a
c
A
Each subcube always includes all members of the Account, custom, ICP, Period, and
View dimensions. These dimensions are referred to as the subcube dimensions. Each
cell in a subcube represents an intersection of the page dimension members for the
subcube with a unique set of subcube dimension members.
Subcube data is retrieved in an all-or-nothing manner. If a data grid, data form, or rule
requests data from a cell in a subcube, Financial Management retrieves the entire
subcube into memory.
For example, a data grid or rule requests the value in the cell for Calfornia -> Budget ->
2006 -> Entity Currency -> Cash -> OpeningBalance -> ICP None -> Periodic -> Feb.
Financial Management loads the entire California -> Budget -> 2006 -> Entity Currency
subcube into memory. It then retrieves the value from the Cash -> OpeningBalance ->
ICP None -> Periodic -> Feb cell from this subcube.
e
l
c
a
r
O
3-4
Feb
Mar
Q1
240
360
310
910
Products
300
400
350
1050
Hardware
100
200
150
450
Software
200
200
200
600
Products
60
60
40
160
Hardware
25
25
20
70
Software
35
35
20
90
Net Sales
Sales
Returns
Aggregations:
Hardware & Software to Products
S ales-Products & Returns-Products to Net Sales
Net Sales Jan, Feb, Mar to Q1
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
The Financial Management subcube structure is designed for highly efficient processing
of data. Processing data in RAM is much more efficient than retrieving it from disk;
therefore performance is improved by reducing the number of times data needs to be
read from the database on disk.
The Financial Management subcube structure is designed to anticipate the data needed
for aggregations and calculations and preload it into RAM. Because many dependencies
typically exist between data for members of the Account and the custom dimensions, a
change to data in one Account/custom dimension combination is likely to require
recalculation of data in other Account/custom dimension member combinations. If all
Account and custom members in the subcube are loaded into RAM, this increases the
likelihood that all data needed for aggregations and calculations will be available.
e
l
c
a
r
O
3-5
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-6
ICP
C1
C2
C3
C4
View
Period
NetSales
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
307.5
GrossSales
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
350
Discount
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
25
Returns
[ICP None]
[None]
Wood
Retail
[None]
Periodic
April
17.5
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
The Financial Management subcube structure affects how rules work in Financial
Management. The effect of the subcube is particularly clear in how you assign values to
accounts using HS.Exp.
The subcube to which a rule writes data is determined by the currently selected page
dimension members in the Point of View. You cannot specify the subcube in the rule
itself. This is why the left-side or destination side value of the HS.Exp function can
contain only Account, custom, ICP, and View dimension members.
e
l
c
You can specify the subcubes for a rule indirectly, however, by using conditional
statements. For the example on the slide, the HS.Exp function is executed only if the
current Point of View includes California and Budget members.
a
r
O
3-7
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-8
Budget
Ac tual
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Data for the current subcube in the Point of View often depends on data in other
subcubes. For example, the current year opening balances could be derived from the
prior year closing balances, and data for different years are stored in separate subcubes.
For this reason, you can specify page dimension members on the right side of the
HS.Exp function, to retrieve values from other subcubes as needed.
For the example on the slide, the HS.Exp function is executed if Variance is the current
scenario in the Point of View. Account values in the Variance scenario are derived from
the values in the Actual and Budget scenarios. Scenario values are stored in separate
subcubes. Therefore, to calculate the values for the Variance scenario, you must also
load the Actual and Budget scenario subcubes into RAM.
e
l
c
If the Account and custom dimensions have a large number of members, you can affect
rule performance if you open additional subcubes. You need to take this into
consideration when writing rules.
a
r
O
3-9
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-10
HS.Exp A#ALL=100
100 100
100
y
m
e
d
a
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
HS.Exp is a powerful function that enables you to assign values to thousands of Account,
custom, and ICP dimension members with a single expression. When you assign values,
using the HS.Exp function, you specify Account, ICP, and custom dimension dimensions
on the left and right sides of the equal sign. How you specify the dimensions on each
side of the equals sign determines the range of members to which values are assigned.
e
l
c
a
r
O
3-11
Omitting Dimensions
HS.Exp A#GrossSales = A#GrossSales.P#Prior * 1.1
A#GrossSales
A#GrossSales.C2#P
roduct 2
=
Custom2
Custom2
Product 1
Product 1
Product 2
Product 2
Product 3
Product 3
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Omitting Dimensions
e
d
a
c
A
If you omit the Account dimension, ICP dimensions, or a custom dimension from both
sides of the equal side of the HS.Exp function, members of the omitted source dimension
are mapped to the corresponding members in the destination dimension. If a custom
member in the source is not valid for the destination account, that custom member is
skipped.
For the example on the slide, because the Custom2 dimension is omitted from both sides
of the equal sign, members of the Custom2 dimension for February, GrossSales
(source), are mapped to the corresponding Custom2 dimension members in March,
GrossSales (destination).
In the following example, the Account dimension is omitted. The source is the
ClosingBalance member of the Custom1 dimension of the prior period, and the
destination is the OpeningBalance member of the Custom1 dimension for the current
period. Because the Account dimension is omitted from both sides of the equal sign, the
accounts for the source are mapped to the corresponding accounts for the destination.
e
l
c
a
r
O
HS.Exp C1#OpeningBalance=C1#ClosingBalance.P#Prior
3-12
A#GrossSales
= A# GrossSales.C2#Product 2
Custom
Custom
Product 1
Product 1
Product 2
Product 2
Product 3
Product 3
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
If you specify a member from the Account, ICP, or custom dimension on the destination
side or left side of HS.Exp, the value of the corresponding member for that dimension in
the source or right side is retrieved. You need not specify the source dimension.
For the example on the slide, the Steel member from the Custom2 dimension is specified
as the destination of HS.Exp. The value for Steel is retrieved from the source, even
though no member for Custom2 is specified as the source.
e
l
c
a
r
O
3-13
A#GrossSa les
= A#GrossSales.P#Prior
Custom
Custom
Product 1
Product 1
Product 2
Product 2
Product 3
Product 3
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
If you specify a member from the Account, ICP, or custom dimension source side (right
side) of HS.Exp expression, the member value is copied to all valid members of that
dimension in the destination.
For the example on the slide, the Steel member from the Custom2 dimension is specified
as the source. The value for Steel is copied to the cells for all Custom2 members of the
destination account.
You should be extremely cautious when specifying only source dimensions. Because the
value for the dimension is copied to all valid members for that dimension in the
destination, you can easily fill the database with incorrect values or with zero values,
causing a data explosion.
e
l
c
For the example on the slide, assume that Custom2 has 1,000 members, Custom3 has
200 members, and both dimensions are valid for the GrossSales account. The value for
Steel would be copied to all valid intersections of Custom2 and Custom3, which would fill
200,000 cells with data.
a
r
O
3-14
A#Profit
A#RetainedInc
C1:Movement
C1: None
C2: Top
C3: Top
C2: [None]
Member
Member
C3: [None]
Member
Member
C4: [None]
Member
Member
C4: None
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
Custom dimension members valid for the source account of an HS.Exp expression
frequently do not match the members valid for the destination account. In this case, you
cannot rely on the HS.Exp function to automatically map source dimension members to
custom dimension members. You must analyze the valid custom dimension members to
determine which destination cells should receive values from the source.
Typically, the source account stores more custom detail than the destination account.
You must copy summarized values from the source to the destination. For the example
on the slide, Profit is an income statement account that tracks profit by product
(Custom2) and market (Custom3). Custom1 and Custom4 are not valid for the Profit
account. RetainedInc is a balance sheet account that stores movement information in the
Custom1 dimension, but for which the other custom dimensions are not valid.
e
l
c
a
r
O
3-15
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-16
A#Packaging
A#Sales
C3: None
C2: Prod1
C2: Prod1
C3: TotalMarkets
C3: None
C2: Prod2
C2: Prod2
C3: TotalMarkets
C3: None
C2: Prod3
C2: Prod3
C3: TotalMarkets
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
This example shows a partial overlap of valid custom dimension members for the source
and destination accounts. Sales are budgeted by product and market. Packaging is
budgeted by product as a percentage of the total sales. The Products hierarchy of
Custom2 and the Markets hierarchy of Custom3 are valid for the Sales account, but only
the Products hierarchy is valid for the Packaging account. Further, Sales is an
intercompany account, but Packaging is not.
For the Sales account (source):
Custom3 is set to the TotalMarkets member, which retrieves the total for all markets
for each product.
e
l
c
The ICP dimension is set to ICP Top, to roll up all ICP transactions.
a
r
O
Custom2 is omitted, so that the Product members for Custom2 for Sales is mapped
to the corresponding members for Packaging.
3-17
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-18
Sub Calculate
Sub Consolidate
[Contribution]
[Contribution Adjs]
[Proportion]
[Elimination]
Sub Calculate
Sub Consolidate
[Parent Adjs]
Sub Calculate
Sub Calculate
Sub Calculate
Sub Calculate
[Parent Total]
[Parent]
<Parent Curr Total>
Sub Calculate
Sub Translate
<Parent Currency>
y
m
<Entity Currency>
Data stored
e
d
a
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
The data input to the Entity Currency member of the Value dimension is potentially
transformed several times before it is ready for consolidation to a parent entity:
If journal entries are entered for the data, the journal adjustments are applied.
If it uses a different currency than its parent, the data is translated to the parents
currency.
If the parent ownership of the entity is less than 100%, the data is adjusted to reflect
percent ownership.
If the data is from an intercompany transaction with another entity, it may need to be
eliminated.
e
l
c
a
r
O
3-19
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-20
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Because Financial Management runs the Sub Calculate procedure for the eight Value
dimension members that store data, Sub Calculate potentially runs eight times for each
Entity-Year-Scenario combination that you calculate or consolidate.
If you do not manage the scope of the Value dimension in your rules, these problems can
arise:
Degraded performanceRules required by only one Value dimension member are
executed for all eight Value dimension members.
Incorrect resultsRules might be executed for Value dimension members for which
they were not designed, leading to incorrect results. For example, a rule that
calculates translation adjustments should not be executed for the Entity Currency
member.
e
l
c
a
r
O
3-21
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-22
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
The Entity Curr Total, Parent Curr Total, and Contribution Total members of the Value
dimension contain the adjusted totals for the Entity Currency, Parent Currency, and
Proportion members, respectively. You often need to use adjusted totals in calculations.
Because rules are not executed at the total members, you must override the default
source (right) Value dimension member side of the equal sign of HS.Exp to retrieve the
values from these members.
For the example on the slide, if no Value dimension member is specified as the source,
the value for Entity Currency, the current POV member when the rule is executed, is
retrieved by default. Because SalesTax must be calculated based on the adjusted total
for Sales, Entity Curr Total is specified for the source Value dimension, overriding the
default.
e
l
c
a
r
O
3-23
y
m
NOTE
e
d
a
When referring to total members in a rule, you should check the order in which the
rules are calculated. In the preceding example, because Acc1 uses the total
calculated for Acc2, any rule that calculates Acc2 must precede the rule for Acc1.
Otherwise, the total for Acc2 might not be valid.
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-24
Summary
In this lesson, you should have learned to:
Describe the effect of the subcube structure on Financial Management
rules
Manage the scope of rules with the Account, ICP, and custom
dimensions
Manage the scope of rules with the Value dimension
Work with total members in the Value dimension
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-25
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
3-26
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Describe dynamic accounts
Describe the Sub Dynamic procedure
Create rules for dynamic accounts
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Dynamic accounts are accounts whose values are dynamically calculated when the data
is requested. Ratios and percentages are the most common type of dynamic
calculations. Only base accounts can be dynamic.
Dynamic accounts ignore the following account attributes:
ISConsolidated
EnableCustom1...4Aggr
ISCalculated
UsesLineItems
e
l
c
a
r
O
The IsCalculated and UseLineItems attributes do not apply because data for dynamic
accounts is calculated, not stored.
4-2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You use Sub Dynamic procedures to create rules for dynamic accounts.
Syntax
Sub ProcedureName()
Type your Dynamic rule here
End Sub
Example
This example uses the account GM_PCT to store the results of the formula for GM
divided by Sales and then multiplied by 100:
e
l
c
Sub Dynamic()
HS.Dynamic "A#GM_PCT = A#GM / A#Sales * 100"
End Sub
a
r
O
4-3
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Dynamic account values are calculated on the fly as data is requested from Sub
Dynamic procedures. You use the HS.Dynamic function within the procedures to create
rules for dynamic accounts.
Syntax
The right side of the equation (source) cannot reference the Scenario, Year, or Entity
dimensions.
e
l
c
Only dynamic accounts and View dimension members are valid on the left side of the
equation (destination).
a
r
O
4-4
Sales
GM
Product
600
140
23.33%
P1
100
10
10%
10 / 100 * 100
P2
200
40
20%
40 / 200 * 100
P3
300
90
30%
90 / 300 * 100
y
m
e
d
a
c
A
You can include the View dimension on the left side of the equal sign as the destination
to limit the calculation to a specific view. In this example, the GMPercent calculation is
executed only if you set the Point of View to periodic.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Sub Dynamic
HS.Dynamic "A#GMPercent.W#Periodic = A#GM / A#Sales * 100"
End Sub
e
l
c
a
r
O
4-5
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Because HS.Dynamic expressions are dynamically calculated for summary time periods,
you can create formulas for different views, such as quarter-to-date or half-year-to-date.
You can use the following functions with HS.Dynamic to create calculations for views.
HS.View.PeriodNumber
Returns the period number within the view for the data being retrieved. It can be used
only in dynamic rules.
Syntax
HS.View.PeriodNumber
e
l
c
a
r
O
4-6
F M Q1
A M J Q2
H1
J A S Q3
Q4
H2
Periodic
1 1
1 1
1 1 1
YTD
2 3
6 2
7 8 9
10
11
12
QTD
2 3
3 1
1 2 3
HYTD
2 3
6 2
1 2 3
HS.Period.NumPerInGen
Returns the number of periods within the generation for the period being processed. This
function is used only in Dynamic rules.
Syntax
HS.Period.NumPerInGen
Example
y
m
If the current period is April, and April is the fourth generation within the calendar file
(monthly generation), the number of periods in the generation is 12. If the current period
is Q2, and Q2 is the third generation within the calendar file (quarterly generation), the
number of periods in the generation is 4.
Monthly generation: (Fourth generation)
Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
The system returns 12 for the number of periods in this generation.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
e
l
c
HS.Period.Number
Returns the current period number.
a
r
O
Syntax
HS.Period.Number
Hyperion Financial Management 9.3.1: Create Rules
4-7
Summary
In this lesson, you should have learned to:
Describe dynamic accounts
Identify Sub Dynamic procedure
Create rules for dynamic accounts
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
4-8
M O D U L E
Overview
In this module you learn how to create custom Sub and Function
procedures. You learn to create rules using arrays and loops.
Lessons in this module include:
Creating Custom Procedures
Creating Arrays and Loops
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Create custom Sub procedures
Create custom Function procedures
Troubleshoot rules script with custom logging procedures
Managing log files
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Module 2
Function ExpenseCalc()
...
...
End Function
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
In addition to using the eight predefined Financial Management Sub procedures, you can
define custom Sub procedures. You can execute, or call, custom procedures from within
the predefined Financial Management procedures or from another custom procedure.
For example, at line 15 in the Sub Calculate procedure, you could call a custom
procedure named Sub OpeningBalances. The Sub Calculate procedure stops executing
and the statements in Sub OpeningBalances are executed. When the statements in Sub
OpeningBalances finish executing, the Sub Calculate procedure resumes execution at
line 16.
Custom Sub procedures ease organization and maintenance of rules files. Instead of
working with a single procedure that may contain hundreds of lines of script for different
tasks, you can create multiple Sub procedures, each of which performs a single task.
e
l
c
a
r
O
When you define a custom Sub procedure, you can specify one or more variables to
receive values passed from the calling procedure.
5-2
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
5-3
Module 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
To call a Sub procedure, you use the call keyword followed by the Sub procedure name
and parentheses, with values to be passed, if any, within the parentheses. Alternatively,
you can omit the call keyword and simply use the Sub procedure name. If you omit the
call keyword, the parentheses are optional. Using the call keyword, however, adds clarity
to your script by showing explicitly that a Sub procedure is being called.
You can pass values from the calling procedure to the custom Sub procedure. You can
pass literal values or variables that exist in the calling procedure. If you are passing a
literal text string, enclose it in quotation marks. If you are passing a numeric value or a
variable, do not use quotation marks. The values passed from the calling procedure must
correspond to variables defined in the Sub statement of the custom Sub procedure.
e
l
c
a
r
O
5-4
y
m
Sub ExpenseCalc((Acct),Rate)
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
5-5
Module 2
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
Function procedures perform an operation and return the result of the operation to the
calling procedure. As with Sub procedures, the calling procedure can pass values to the
Function procedure. For example, the calling procedure might pass two text strings to
the Function procedure. The Function procedure might then concatenate the two text
strings and pass the concatenated string back to the calling procedure as a return value.
When you define a custom Function procedure, you can specify one or more variables to
receive values passed from the calling procedure. Within the function, you use the
function name as a variable to store the return value.
e
l
c
a
r
O
5-6
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
5-7
Module 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
To call a function, place the function name at the location in the script where you want to
insert the return value. When passing values to the variables, use the same syntax as for
Sub procedures.
e
l
c
a
r
O
5-8
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can create custom logging procedures to troubleshoot rules scripts. A logging
procedure writes a text-based log file that records information regarding the execution of
the rules script.
Typical information to include in a log file:
Start time and end time of each executed procedure (Helps determine which
procedures have performance problems.)
Point of View for which the procedure was executed
Values written to the database (Helps verify that calculations are correct.)
e
l
c
a
r
O
5-9
Module 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Several VBScript functions enable you to create text files and write information to them.
You can use these functions with the VBScript File System and File objects.
To write to log files:
e
l
c
2. Declare variables for a File System object and a File object. For the example on the
slide, the variables fso and f are declared.
a
r
O
5-10
The file location for the log file must be a server and directory to which the
Financial Managment DCOM/ADMIN user has full modify access.
y
m
This section describes the syntax for the functions used in the logging procedure.
e
d
a
Close
Closes a file
Syntax
object.Close
Arguments
Object
A File object
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
CreateObject("Scripting.FileSystemObject")
Creates a VBScript File System object
Syntax
e
l
c
Var
a
r
O
5-11
Module 2
y
m
File
The name and path for the text file
e
d
a
IOmode
1 for read-only, 2 to overwrite the existing contents of the file, or 8 to append to the
file
Create
True to create a file or False to not create the file
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Format
1 for unicode, 0 for ASCII, or -2 to use the system default setting. If omitted, the
format is ASCII.
WriteLine Function
Writes a line to a text file
Syntax
object.WriteLine Text
e
l
c
Arguments
a
r
O
object
5-12
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
5-13
Module 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can call a write to file procedure from any location in a rules script. Before calling the
file, you should store the information in variables. You can then pass the variables to the
write-to-file procedure. If you open the text file in append mode, you can call the
procedure repeatedly during script execution. Each line is appended to the end of the
file.
e
l
c
a
r
O
5-14
Because writing to a log file impacts performance, you should use custom
logging only during development and testing of your application. You should
disable all calls to write-to-file procedures before the application goes to
production. An easy way to disable call is to place apostrophes in front them.
This turns them into comment lines.
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
5-15
Module 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Log files can quickly fill with large amounts of data, but you can manage log files with
VBScript functions. These are some of the tasks you can perform:
Check for the existence of a file
Check the file size
The example on the slide shows a routine that checks the size of the log file and deletes
it if it exceeds a specified limit. The GetFile function assigns the log file c:\ruleslog.txt to
the variable f. The Size function retrieves the size of c:\ruleslog.txt. If the size is larger
than the size specified in the MaxSize variable, the FileDelete function deletes the file.
e
l
c
a
r
O
5-16
DeleteFile Function
Deletes a file.
Syntax
object.DeleteFile(filespec[,force])
Arguments
Object
A File System object
filespec
The path and name of a file
force
True if read-only files should be deleted, or False if they should not. If this argument
is omitted, the default is False.
y
m
FileExists Function
e
d
a
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
GetFile Function
e
l
c
object.GetFile(filespec)
a
r
O
5-17
Module 2
MoveFile Function
Moves a file from one location to another
Syntax
object.MoveFile source, destination
Arguments
Object
A File System object
y
m
source
e
d
a
Size Function
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
e
l
c
a
r
O
5-18
Summary
In this lesson, you should have learned to:
Create custom Sub procedures
Create custom Function procedures
Troubleshoot rules scripts with custom logging procedures
Manage log files
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
5-19
Module 2
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
5-20
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Describe arrays and loops
Create arrays
Fill arrays using member lists
Create loops
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Module 2
Arrays
Arrays are variables that hold multiple values.
Each array value has an index number.
You write values, to or read values from, the array by referencing the
index number.
aProducts
Lower bound
Upper bound
Steel
Wood
Brick
Plas tic
Dim aProducts(4)
aProducts(0)=Steel
aProducts(1)=Wood
aProducts(2)=Brick
aProducts(3)=Plastic
Arrays
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
e
l
c
a
r
O
6-2
Loops
Loops are sections of code that repeat execution for a specified number of
times or until a condition is met.
Dim Counter
For I = 1 to 100
Counter=Counter + 1
Next
y
m
Loops
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Loops can reduce the size of your script. For example, instead of creating 20 lines of
script to calculate 20 account values, you can create a loop that repeats a single line of
script 20 times, specifying a different account for each iteration.
e
l
c
a
r
O
6-3
Module 2
Travel
RentRates
Phone
Stationery
Salaries
Pensions
Sundry
For i = 0 to 6
HS.Exp "A#Expenses.C2#"& (aOver(i))& =A#Expenses.P#Prior
Next
Copyright 2008, Oracle. All rights reserved.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
As you learned earlier, the HS.Exp function can write data to either a single member of a
subcube dimension or to all valid members of the dimension:
If you specify a dimension member on the destination (left) side of HS.Exp, it writes
data only to that member of the dimension.
If you omit the dimension from the destination (left) and source (right) sides of
HS.Exp or include it only on the source (right) side, it writes to all valid members of
the dimension.
But frequently you need a rule to act on a subset of dimension members. For example,
you might need a rule that writes values to all accounts that are descendants of the Total
Expenses account, but to no others. If there were 50 descendants of Total Expenses,
you would need 50 HS.Exp statements.
e
l
c
a
r
O
6-4
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
6-5
Module 2
To add items to or retrieve items from the array, specify the index
number for the item in parenthesis.
aAccts(0)=Taxes
aAccts(1)=Discounts
aAccts(2)=Returns
vTarget=aAccts(2)
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
You create array variables the same way that you create standard variables, except you
specify the number of items for the array in parentheses next to the variable name.
Array variables use a zero-based index; that is, the index number for the first item is zero.
As a result, array variables contain one more item than the number specified in
parentheses. For the example on the slide, the aProducts variable would contain items 0
to 5.
You assign data to each element of the array by using an index into the array. Similarly,
the data can be retrieved from any element by using an index into a particular array
element.
e
l
c
This example sets the value of the ninth item in the aEntity array variable to Europe:
aEntity(8)=Europe
a
r
O
This example retrieves the tenth item from aEntity and stores it in the vCurrEntity variable:
vCurrEntity=aEntity(9)
6-6
aAccts=HS.Account.List("","")
All base accounts in the Account dimension:
aAccts=HS.Account.List("", "[Base]")
All children of the entity France:
aEntity=HS.Entity.List("France","[Children]")
All accounts in the user-defined member list Taxable:
aAccts=HS.Account.List("","Taxable")
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
You can use the HS.List function to fill an array variable with the members from a
member list.
Syntax
HS.Dimension.List("Parent","Listname")
Parameter
Dimension
Parent
e
l
c
Listname
Description
A dimension name.
Optional. The name of the top parent member for a system-defined list.
The name of a valid system list or a user-defined member list.
a
r
O
6-7
Module 2
Creating Loops
You can use these statements to create loops:
For...Next: Using a counter to run statements a specified number of
times
For Each...Next: Repeating a group of statements for each object in a
collection
Do...Loop: Looping while or until a condition is true
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Creating Loops
e
d
a
c
A
For...Next
Repeats the execution of a block of statements a specific number of times. For loops use
a counter variable whose value is automatically increased or decreased with each
repetition of the loop. You specify the initial value for the counter variable and the
maximum value the counter can reach for the block of code to be executed.
Syntax
e
l
c
a
r
O
6-8
Description
Counter
StartVal
EndVal
Example
The following loop makes the computer beep 21 times. The For statement specifies the
counter variable name as x. It specifies 0 as the start value for x and 21 as the end value.
The Next statement increments the counter variable by 1 after each iteration.
For x = 0 To 20
Beep
Next
For Each...Next
Repeats a block of statements for each element in an array. All statements execute for
each element in the array until there are no more elements. You specify a variable that
returns the index for the current element in the array.
y
m
e
d
a
Syntax
For Each Item in ArrayVariable
...
...
Next
Parameter
Item
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
In the following script, Item is the counter variable and BeepCount is an array variable.
The computer beeps for as many items as there are in the BeepCount array variable.
e
l
c
a
r
O
6-9
Module 2
Do...Loop
Runs a block of statements an indefinite number of times. The statements are repeated
either while a condition is true or until a condition becomes true.
Repeating Statements While a Condition is True
You use the While keyword with a Do loop to run a block of statements while a condition
is true.
Syntax
Do While Condition
...
...
Loop
Parameters
Condition
An expression that evaluates to true or false
y
m
Example
e
d
a
In the following script, the statements inside the loop run while the value of myNum is 10
or less.
myNum = 0
Do While myNum < 11
myNum = myNum + 1
Loop
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
Do Until Condition
...
...
Loop
e
l
c
Parameters
a
r
O
Condition
6-10
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
6-11
Module 2
aProds = HS.Custom2.List("","[Base]")
For Each ProdItem in aProds
HS.Exp "A#SalesTax.C2#" &ProdItem& "=A#Sales*.06"
Next
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
You can use arrays and loops to assign values to accounts in Financial Management.
To assign values with arrays and loops:
1. Assign a system or user-defined member list to an array variable by using the HS.List
function.
2. Create a loop that executes for each element in the array variable.
3. Use the loop counter variable to specify the index for the array variable.
Because the loop counter variable is incremented by one each
time the loop executes, each iteration of the loop retrieves a
different member from the array variable. You can insert the array
variable in any location in your script where an array member
name is required.
e
l
c
a
r
O
6-12
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
6-13
Module 2
Attributes in Loops
You can use member attributes to select the members of an array for
which a rule is executed.
aProds = HS.Custom2.List("","[Base]")
For Each ProdItem in aProds
IF HS.Custom2.UD1(ProdItem)="Taxable" Then
HS.Exp "A#SalesTax.C2#" &ProdItem& "=A#Sales*.06
End If
Next
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Attributes in Loops
e
d
a
c
A
There may not be a system or user-defined member list that defines the precise subset
of members that you need to include in a loop. You can use member attributes as
additional criteria for selecting members for which rules are executed.
For the example on the slide, the Custom2 dimension contains products. The rule should
execute only for base-level members of Custom2 that have the user-defined attribute
Taxable. To accomplish this:
A system member list is used to fill the array variable aProds with the base-level
members of the Custom2 dimension.
e
l
c
A For...Each loop is used to loop through each of the members in the array variable.
The counter variable for the loop is ProdItem.
a
r
O
At each iteration of the loop, an If...Then statement retrieves the value of the UD1
attribute for the current array item and tests whether it contains the text Taxable.
Notice that ProdItem is used to retrieve the item from the array variable.
6-14
ICP
C1
C2
C3
C4
View
Returns
[ICP None]
[None]
Wood
Retail
[None]
Periodic
NODATA
Returns
[ICP None]
[None]
Brick
Retail
[None]
Periodic
350
Returns
[ICP None]
[None]
Steel
Retail
[None]
Periodic
NODATA
Returns
[ICP None]
[None]
Plastic
Retail
[None]
Periodic
500
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
Member lists return a list of members in a dimension regardless of whether data exists
for those members. But a rule often needs to execute only for intersections of members
that have data. Financial Management provides functions that enable you to limit the
scope of rules to intersections that have data. You do this by creating loops with data
units. A data unit is the set of intersections that contain data for a specified Point of View.
For the example on the slide, the data unit includes all member intersections for the
Returns account that have data for the current Point of View.
e
l
c
a
r
O
6-15
Module 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You use the Set command with the OpenDataUnit function to open a data unit.
Syntax
Set DataUnit=HS.OpenDataUnit("DimensionMembers")
Parameter
DataUnit
e
l
c
a
r
O
6-16
y
m
Parameter
Description
DataUnit
Item
Acct
ICP
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
For the example on the slide, the GetItem function is used to retrieve the fifth item in the
data unit. The Acct, Cust1, and Val variables are used to insert the Account member,
Custom1 member, and the data for the item into the HS.Exp expression.
e
l
c
a
r
O
6-17
Module 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Looping through a data unit is similar to looping through an array created with a member
list. The first index for the first element in the data unit array is always zero. To determine
the total number of items in the array, use the GetNumItems function. Because
numbering of the items starts at zero, the index of the last item in the array will be the
total number of items minus 1.
In the example on the slide, the value for the Returns account for each product with the
code 001 for the Forecast scenario is calculated as a 10% increase over the prior year
actual values. Because there is no need to perform the calculation for products for which
prior year actual data does not exist, the OpenDataUnit function is used to retrieve just
those products that have data. The following is a line by line explanation:
e
l
c
Line 1: An If...Then statement is used to limit the rule to the Forecast scenario.
a
r
O
6-18
y
m
Line 8: The HS.Exp function is used to calculate the value for the Returns account.
Because Custom1 and Custom4 are not valid for the Returns account, they are omitted
from the HS.Exp function. The vData variable stores the prior year Actual value returned
by the GetItem function.
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
6-19
Module 2
Summary
In this lesson, you should have learned to:
Describe arrays and loops
Create arrays
Fill arrays using member lists
Create loops
Assign values with arrays and loops
Work with member attributes in loops
Open data units
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
6-20
M O D U L E
Overview
In this module you learn how to work with Financial Management data and
hierarchies.
Lessons in this module include:
Managing Financial Management Data
Working with Dimension Hierarchies
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Retrieve data with the GetCell function
Write data with the SetDataWithPOV function
Test for no data
Set accounts to no input or input
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
So far, you have used the Exp function to read and write account values. Financial
Management rules provide other functions for reading and writing data to data
intersections.
The Exp function retrieves data from a source account or accounts and writes it to a
destination account or accounts. However, sometimes you need to store data to a
variable instead of an account. For example, you might want to retrieve the value for
TotalHeadcount and store it in a variable, which you then use for a series of calculations.
The GetCell function enables you to retrieve data from a specified data intersection or
cell and store it in a variable.
e
l
c
a
r
O
7-2
y
m
Syntax
e
d
a
HS.SetDataWithPOV(POV,Data,Add)
Parameter
c
A
Parameter
Description
POV
Data
Add
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
a
r
O
7-3
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
If there is no data for the Point of View from which you retrieve data, the GetCell function
returns zero.
If you write the results returned by GetCell to the database, zeros may be written
unnecessarily. The result is an increased database size.
If you use the value returned by GetCell in a calculation, the result may be division by
zero errors.
You should verify that there is data before writing data returned by GetCell to the
database or using it as a divisor in a calculation:
Conditional testYou can add a simple conditional test for zero data before writing
to the database. For the example on the slide, the value retrieved by GetCell is
stored in the vData variable. An If...Then statement verifies that vData does not equal
zero before the value for vData is written to the database.
e
l
c
a
r
O
7-4
y
m
e
d
a
GetCellRealData Function
Gets the data contained in a cell and indicates if the cell contains real data.
Syntax
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
HS.GetCellRealData("POVExpression,Var")
Parameters
POVExpression
c
A
A valid Point of View. You can include any dimension in the POV expression.
Var
A variable that returns True if there is real data and False if there is no data or
derived data.
Example
e
l
c
vCustoms=".C1#[None].C2#Wood.C3#C_Retail.C4#[None].I#[ICP None]"
vData=HS.GetCellRealData(A#GrossSales &vCustoms,IsReal)*1.1
If IsReal Then
HS.Exp "A#GrossSales &vCustoms& "=" &vData
End If
a
r
O
7-5
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
When setting up calculated accounts using the IsCalculated attribute, in effect, you
prevent users from inputting to the accounts. However, you must often enable data input
for only some dimension intersections. You can use the Sub NoInput procedure with the
NoInput function to disable input for specified data intersections. For example, you can
input data for a set of accounts in the Actual scenario and have it calculated in the
Forecast scenario.
Sub NoInput Procedure
When used with the NoInput function, disables input to accounts for specified data
intersections
Syntax
e
l
c
a
r
O
Sub NoInput
HS.NoInput "POVExpression"
End Sub
7-6
y
m
For the example on the slide, input is disabled for cells that intersect the Sales account
and the Budget and Forecast scenarios for the year 2006.
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
7-7
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
If you want to enter data for some entities at the parent level, you can use the Sub Input
procedure with the Input function to enable data input into parent entities at base
accounts. For example, you can enter a Sales budget target for the parent entity
California and allocate the target to its children.
Sub Input Procedure
When used with the Input function, enables data input at the parent entity level
Syntax
Sub Input
HS.Input "POVExpression"
End Sub
e
l
c
a
r
O
7-8
y
m
For the example on the slide, input into parent entities is enabled for the cells that
intersect the Sales account and the Budget scenario.
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
7-9
Rounding
Stored
Scaled
Wood
150,440
150
Bric k
120,320
120
Stored
Rounded
Wood
103.48
103
Brick
104.43
104
Steel
150.35
150
Steel
110,390
110
Total
359.26
359
Total
381,150
381
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
Data is frequently loaded into the system at a greater precision than is required for
reporting purposes. The result is footing problems at the parent level in reports. You can
use the VBScript Round function to resolve this problem.
The VBScript Round function does not use financial rounding. If the number to the left of
the decimal point is even, values of 5 are rounded down, not up. For example, 3.5 rounds
to 4, but 2.5 rounds to 2.
The Round function cannot scale values by rounding whole numbers; for example,
hundreds to thousands.
e
l
c
Round Function
a
r
O
7-10
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
7-11
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
When rounding is enabled with HS.Round, all values written to the database from the
following line of script onward are rounded or scaled.
HS.Round Function
HS.Round(Unit)
e
l
c
a
r
O
7-12
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
7-13
Summary
In this lesson, you should have learned to:
Retrieve data with the GetCell function
Write data with the SetDataWithPOV function
Test for no data
Set accounts to no input or input
Round and scale account values
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
7-14
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Work with the calendar
Manage movement accounts and data views
Avoid circular references in hierarchies
Create allocations
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
When you create an application, the Period, Year, and View dimensions are generated
based on the application profile. The Period, Year, and View dimensions comprise the
Financial Management calendar.
e
l
c
a
r
O
8-2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
e
l
c
a
r
O
8-3
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
8-4
If Hs.Entity.Member="[None]" Then
Select Case UCase(HS.Period.Member)
Case "FEB"
IF HS.Year.Member mod 4=0 Then
HS.Exp "A#DAYS.W#Periodic=29"
Else
HS.Exp "A#DAYS.W#Periodic=28"
End IF
Case "APR", "JUN", "SEP", "NOV"
HS.Exp "A#DAYS.W#Periodic=30"
Case Else
Hs.Exp "A#DAYS.W#Periodic=31"
End Select
End if
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
The Period dimension does not recognize the number of days in each period. For rules
that require the number of days in a period, you create days in period accounts and use
rules to populate the accounts.
Because days in period data is typically global data valid for all entities, set the None
member of the Entity dimension as the destination.
If your rules need to accommodate leap years, include a leap-year test. Use the VB
Script mod operator to divide the number of days of the current year by 4. Mod
returns just the remainder of a division. If the remainder value returned is zero, the
current year is a leap year.
e
l
c
a
r
O
8-5
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
When you update data for a period, calculation statuses of future periods of the current
year are impacted, but calculation statuses of future years are not impacted. For
example, if the calculation status for January, 2006 is OK and values are changed for
December, 2005, the calculation status for January, 2006 remains OK.
Often, calculations defined in rules include dependencies between years. If you want
data updates to impact future years, you specify a year, period, entity, and scenario and
use the ImpactStatus function.
Rules for opening balances are an example of when you need to use the ImpactStatus
function. For balance sheet accounts, opening balances are typically retrieved from the
last period of the prior year using a rule. If data for the last period of the prior year
changes, opening balances for the current year need to be recalculated. You can use the
ImpactStatus function to ensure that, when a rule modifies data for the last period of a
year, the calculation status of the first period of the following year is impacted.
e
l
c
a
r
O
8-6
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
8-7
The parent member incorrectly uses the year-to-date values of movement accounts.
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
To show balance sheet movement, custom dimensions typically contain a mix of balance
and flow members:
The member for the closing balance is a parent.
The members for opening balance and movement are children of the closing balance
member.
The movement members are flow members that show increases and decreases for
the current period.
Because the closing balance member is aggregated from its children, it does not need to
be calculated by a rule.
e
l
c
a
r
O
8-8
y
m
e
d
a
To support display of balance sheet movement in year-to-date view, you can set the
opening balance for all periods equal to the closing balance of the prior year:
HS.Exp "C4#Opening=C4#Closing.Y#Prior.P#Last"
c
A
This provides a correct aggregation for closing balance when year-to-date values for
movement member are displayed.
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
a
r
O
8-9
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
HS.Clear "A#BSDifference"
HS.Exp "A#BSDifference=A#CapitalEmployedA#Shareholders"
c
A
If the source account in an account expression is a parent level account, its value is
aggregated on-the-fly. If the destination is a child of the source account, its value is
included in the aggregated parent value, resulting in a circular reference. Some common
examples where circular references may occur are offset accounts for balance sheet
differences and plug accounts for allocations.
Whenever possible, you should define you hierarchies to avoid circular references. In
situations where you cannot avoid rules with circular references, clear the child account
by placing the HS.Clear function before the rule that includes the circular reference. The
HS.Clear function clears data for a specified point of view.
e
l
c
Syntax
a
r
O
HS.Clear "POVExpression"
POVExpression identifies the members of the Account, ICP, and custom dimensions for
which data should be cleared.
8-10
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
8-11
Heating 60,000
20,000
20,000
y
m
20,000
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
To obtain correct results, you may need to calculate allocations separately from
consolidations and other calculations. For example, you may need to perform this
sequence of calculations:
1. Consolidate data to obtain a total for an expense at the parent level.
2. Run an allocation rule to distribute the expense to child entities.
3. Consolidate again to update the parents of the entities.
Placing allocation rules in the Sub Allocate procedure enables you to run them
separately from consolidation and calculation rules.
e
l
c
a
r
O
8-12
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
You can run a Sub Allocate procedure from the shortcut menu of a data grid or by calling
it from another procedure, such as Sub Calculate. The following considerations apply to
the Sub Allocate procedure:
Sub Allocate runs only for members with a calculation status of OK.
For Sub Allocate rules, Entity Currency is the only valid destination member of the
Value dimension.
When a Sub Allocate procedure runs for and modifies data of a child entity, the
consolidation status of the parent entities is impacted.
e
l
c
a
r
O
8-13
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
8-14
Sub Allocate()
call HS.ALLOC ("E#Admin.A#Rent","A#RentAlloc","US_Entities","& _
"A#Headcount/A#Headcount.E#UnitedStates","E#Admin.A#PLUG")
End Sub
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can use the Alloc function to allocate a value to a list of entities. The Alloc function is
unique in that it can write values to multiple destination entities, rather than writing to only
the current point of view entity.
Syntax
HS.Alloc ("SourcePOV","DestPOV","EntityList","AllocExp","PlugAccount")
e
l
c
a
r
O
8-15
Description
SourcePOV
Source point of view for the data to be allocated. You must specify an
Account member, and you can specify ICP and custom members.
If you do not specify ICP and custom members:
The default ICP member is [ICP Top].
The default custom member is the top member for the account.
If you do not specify an entity, the current point of view entity is used.
DestPOV
Destination point of view for the data to be allocated. You must specify an
Account member, and you can specify ICP and custom members.
Note the following usage rules:
If you do not specify an ICP member, the default is [ICP None].
If you do not specify a custom member, the default is [None].
If you specify an Entity member and the EntityList parameter is [Base],
the member is used as the parent.
EntityList
Member list that identifies the entities to which the data is to be allocated.
You can use the system-defined entity list [Base] or a user-defined list.
If you use the system-defined list [Base], the system uses the entity
specified in the destination point of view as the parent member. If you use a
user-defined list that contains parent members, the parent members are
skipped.
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
8-16
Description
AllocExp
PlugAccount
y
m
e
d
a
Example
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
For the example on the slide, the balance in the Rent account is allocated to the RentAlloc
account for the members in the US_Entities member list. The allocation percentage is
calculated by dividing the headcount of each member by the total headcount of the United
States. A reversing entry for the Rent account is written to the Plug account.
e
l
c
a
r
O
8-17
Summary
In this lesson, you should have learned to:
Work with the calendar
Manage movement accounts and data views
Avoid circular references in hierarchies
Create allocations
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
8-18
M O D U L E
Overview
In this module, you learn to customize the default currency translation and
consolidation calculations.
Lessons in this module include:
Creating Currency Translation Rules
Creating Consolidation and Elimination Rules
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
L E S S O N
Objectives
At the end of this lesson, you should be able to:
Explain Financial Management currency translation
Explain the default translation calculation
Create rules using translation functions
Calculate exchange differences
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
EUR
USD
Europe
EntityA
Entity Currency Total = USD
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
Parent
Currency
= EUR
e
d
a
c
A
Currency translation converts account data from one currency to another. When you
consolidate data, currency translation occurs if the parent entity has a different default
currency than the child entities. Data in the Entity Currency Total member of the child is
translated to the parents currency and the result is stored in the corresponding child
currency member. For example, if EntityA has a default currency of USD and its parent,
Europe, has a default currency of EUR, data in the Entity Currency Total member of
EntityA is translated to EUR and is written to the EUR member of EntityA. The data in the
EUR member of EntityA is then consolidated to the Entity Currency member of Europe.
NOTE
e
l
c
Translated values are never written to the Parent Currency member of the Value
dimension. The Parent Currency member is a read-only member that displays the
translated currency member of the child.
a
r
O
9-2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
The settings for the following properties determine the default translation behavior for the
application.
Property
DefCurrency
DefaultCurrency
e
l
c
Description
a
r
O
9-3
Description
DefaultRateForBalance
DefaultRateForFlow
UsePVAForBalance
UsePVAForFlow
Exchange rates can be entered into the exchange rate accounts either at an individual
entity or at the [None] entity. The system follows this sequence in determining the
exchange rates to use:
y
m
e
d
a
2. If a rate is not found in the current entity, the system looks at the [None] entity for the
rate.
c
A
3. If a rate is not found in the None entity, the system derives the rate by triangulation,
using the application currency in the [None] entity.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Triangulation is performed using the default application currency. For example, suppose
that you are converting EURO to YEN, but the system cannot find an exchange rate to
perform the translation. Assume that exchange rates to translate balances into USD exist
for both the EURO and the YEN. Using triangulation, the system converts the EURO
balance to USD and then converts the USD balance to YEN.
e
l
c
a
r
O
9-4
Translation Methods
The VAR method translates the entire balance at the current period rate.
PVA Method
Jan
Feb
Jan
Feb
Exchange Rate
1:3
1:2
1:3
1:2
50
75
50
75
150
150
150
200
Translated YTD
75 50 = 25
X
2
50
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Translation Methods
y
m
150
e
d
a
200
c
A
Financial Management provides two translation methods. The value at rate (VAR)
method translates the entire current period balance at the current period exchange rate.
The periodic value add (PVA) method translates only the current month change in the
YTD value at the current period exchange rate. It then adds the translation result to the
balance from the previous period, translated at the exchange rate of the previous period.
For the example on the slide, the January YTD balance in local currency is 50 and the
exchange rate is 1:3. The YTD local currency balance for February is 75 and the
exchange rate is 1:2. To determine the February translated value:
The value at exchange rate method translates the entire February local currency
balance (75) at the February exchange rate (1:2), for a translated balance of 150.
e
l
c
The PVA method calculates the change between the January and February local
currency balance (25) and translates the change at the February rate (1:2), for a
translated value of 50. It adds this result to the translated January balance (150), for
a February translated balance of 200.
a
r
O
9-5
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
9-6
EUR
UnitedStates
USD
Europe April
Entity Currency
1
Gross Sales
Cash
240
420
Yes
UsePVAForBalance
EUR
Gross Sales
200
240
Cash
300
No
DefaultRateForFlow
AvgRate
DefaultRateForBalance
EndRate
Entity Currenc y
Total
420
April
AvgRate
1.2
EndRate
1.4
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
y
m
e
d
a
c
A
e
l
c
For Asset and Liability accounts, the rate account specified by the
DefaultRateForBalance property is used. If PVAForBalance is enabled, the PVA
method is selected; otherwise the VAR method is selected.
a
r
O
9-7
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
9-8
Sub Translate()
....
....
End Sub
Sub Calculate()
If HS.Value.IsTransCur Then
...
...
End If
y
m
End Sub
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You use translation rules to perform calculations on nonstandard translations. You place
translation rules in the Sub Translate procedure.
If you add a translation rule for an account to the Sub Translate procedure, the
translation rule overrides the default translation for the account.
All accounts for which rules do not exist in the Sub Translate procedure are
translated using the default translation.
Although you can perform other calculations in the Sub Translate procedure, it is typically
used only for translations. Because the Sub Calculate procedure runs automatically after
the Sub Translate procedure, you can place any calculations on the translated data in
the Sub Calculate procedure.
e
l
c
a
r
O
9-9
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
9-10
Translation Functions
Two translation functions are available,Trans and Transperiodic:
Trans translates using the VAR method
Transperiodic translated using the PVA method
HS.Trans "C1#Movement","","A#AvgRate",""
HS.TransPeriodic "A#SaleForecast","A#Sales","A#ForecastRate",""
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Translation Functions
e
d
a
c
A
You use the Trans and Transperiodic functions to override the default translations for an
account. The parameters for the two functions are identical. The only difference between
the functions is the translation method used.
e
l
c
a
r
O
9-11
Description
DestPOV
SourcePOV
The source point of view. The source can be any combination of dimensions. If
the Account, Custom1...4, and ICP dimensions are unspecified, the system
uses the same member as the Destination member. If the Scenario, Year,
Period, and Entity dimensions are not specified, the system uses the current
members. If the Value dimension is not specified, the system uses the Entity
Curr Total member. If SourcePOV is left blank, the system uses the destination
point of view as the source point of view.
Rate1
The exchange rate. The rate can be a constant, an exchange rate account, or
a specific cell.
Rate2
y
m
e
d
a
Remarks
The source Value dimension member is always Entity Curr Total. The destination
Value dimension member is always the parent member when Sub Translate runs
during consolidation or the current point of view currency member if Sub Translate is
run from a data grid or a data form.
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
If the same destination point of view is used in multiple rules with Trans or
Transperiodic, the results accumulate in the destination account. Results do not
accumulate between the Trans and Transperiodic functions, however. For example, if
a rules that uses the TRANS functions writes to a destination account that was
previously written to by a rule using the Transperiodic function, the previous result is
overwritten.
Examples
For the first example on the slide, the Movement member of the Custom1 dimension is
translated using the rates in the AvgRate account. Because no account member is
specified for the SourcePOV parameter, the rule is executed for all accounts for which
the Movement member is valid.
e
l
c
a
r
O
For the second example on the slide, the source and destination account are different.
The source account, Sales, is translated using the exchange rates in the ForecastRate
account. The translated data is written to the destination account, SalesForecast.
9-12
1.2
1.4
Jan
Feb
500
600
500
700
HS.Trans "A#Cash.C1#FXO","A#Cash.C1#Opening","A#EndRate","A#OpenRate"
1.2
EndRate
1.4
Entity Currency
EUR
FXO
100
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
When currency translation take place, changes in account balances are frequently due
solely to fluctuations in exchange rates. For the example on the slide, the balance of 500
for Cash is unchanged between January and February for the local currency. The
translated values, however, show an increase of 100 for Cash in February. Examining
the exchange rates shows that the increase stems from a difference in the rates for
January and February.
e
l
c
a
r
O
9-13
y
m
You can also take advantage of the cumulative nature of the translation functions to
accumulate adjustments to a single currency translation adjustment account. In the
following example, balance sheet accounts with the user defined attribute HIST are
translated at a historical rate. Exchange differences for these accounts are accumulated
into the CTA account.
e
d
a
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
dHistRate = HS.GetRate("A#HistRate")
dBSRate = HS.GetRate("A#BSRate")
sBSAccts = HS.Account.List("BALANCESHEET","[Base]")
For Each sBSAcct In sBSAccts
If UCase(HS.Account.UD2(sBSAcct)) = "HIST" Then
HS.Trans "A#" & sBSAcct, "", dHistRate, ""
HS.Trans "A#CTA", "A#" & sBSAcct, dHistRate, dBSRate
End If
Next
TIP
e
l
c
Note the use of the GetRate function in the previous example. The GetRate
function retrieves the exchange rate for a specified rate account and point of view.
If no point of view is specifed, the current point of view is used.
a
r
O
9-14
Sub Translate()
If HS.GetCell("A#PaidInCap_USD")<>0 Then
HS.EXP "A#PaidInCap=A#PaidInCap_USD"
Else
HS.EXP "A#PaidInCap = P#Last.Y#Prior"
End If
End Sub
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Some balance sheet accounts have static data that rarely changes, for example, paid-in
capital. For these accounts, it is sometimes more efficient to use already translated
historical data than to translate values each period. This is called a currency override.
When you use currency overrides, you load the translated historical values to the Entity
Currency member of a statistical account. Typically you use an account type of Balance
or Balance Recurring. Data for these account types does not get translated. During
translation, you retrieve the already translated historical values from the statistical
account instead of translating the local currency data. Because you do not need to
translate the data, you can use the HS.Exp function to pull the values.
e
l
c
a
r
O
9-15
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
9-16
Summary
In this lesson, you should have learned to:
Explain Financial Management currency translation
Explain the default translation calculation
Create rules using translation functions
Calculate exchange differences
Work with currency overrides
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
9-17
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
9-18
L E S S O N
1 0
10
Objectives
At the end of this lesson, you should be able to:
Explain the default consolidation calculation
Create consolidation rules
Create elimination rules
y
m
e
d
a
a
r
O
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
IC_Plug
ICP
EntityA
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Yes
y
m
e
d
a
c
A
Consolidation is the process of gathering data from child entities and aggregating the
data to parent entities. When you run a consolidation, each childs contribution to the
parent is derived by using the default application calculations, and the results are written
to the Entity Currency member of the parent.
The following steps describe the procedure that Financial Management uses to calculate
the childs contribution to the parent for each account:
1. Check the IsConsolidated property of the account to verify that it should be
consolidated.
e
l
c
2. Apply the consolidation percentage in the PCON account to the data in the Parent
Total member. The Parent Total member is the sum of the Parent Curr Total and
Parent Curr Adjs members. If there is no data in the PCON account, use 100
percent.
a
r
O
10-2
y
m
e
d
a
9. Write the sum of the Proportion, Elimination, and Contribution Adjs members of the
child to the Entity Currency member of the parent.
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
10-3
!APPLICATION_SETTINGS
DefaultCurrency=USD
UsePVAForBalanceAccounts=N
UsePVAForFlowAccounts=N
ConsolidationRules=Y
OrgByPeriodApplication=N
NodeSecurity=Entity
Sub Consolidate()
...
...
End Sub
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
You can override the default consolidation calculations by creating your own
consolidation rules. To use consolidation rules, you must enable the ConsolidationRules
option in the Application Settings module. When the ConsolidationRules option is
enabled, the default consolidation calculations are disabled. You must create a Sub
Consolidate procedure in the rules file with the necessary rules for consolidation.
Accounts for which you do not include rules in the Sub Consolidate procedure do not get
consolidated.
You create consolidation rules to derive the values for the Proportion and Elimination
members of the value dimension. The aggregation of the Proportion, Elimination, and
Contribution Adjs members to the Entity Currency member of the parent takes place
automatically, even when the ConsolidationRules option is enabled.
e
l
c
a
r
O
10-4
Consolidation Functions
PCon retrieves the consolidation percentage.
Con updates the Proportion and Elimination members.
The source is the Parent Total member for the current entity, year, and
scenario.
The destination is either the Proportion or the Elimination member.
vPCon=HS.Node.PCon("")
HS.Con "", vPCon, ""
Example 2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
Consolidation Functions
e
d
a
c
A
The following sections describe functions that are commonly used in consolidation rules.
PCon
The PCon function retrieves the consolidation percentage from the PCON system
account for a specified parent and child. It is used with the HS.Node object.
Syntax
HS.Node.PCon("S#Scenario.Y#Year.P#Period.E#Parent.Child")
e
l
c
a
r
O
10-5
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
10-6
Description
DestinationPOV
Factor
A factor by which to multiply the data in the Parent Total member. This
factor can be a constant, a function, or an expression using mathematical
operators (+ - * /). The PCon function is typically used to specify the factor.
Nature
A text string used for audit purposes. This string is stored and provides
information about the accounting purpose of the transaction. To allow
users to view consolidation source and destination transaction detail after
running a consolidation, you must include text in this parameter. If you do
not include text, the transaction detail is not stored.
y
m
e
d
a
Remarks
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
You cannot specify a source for the Con function. The source is always the Parent Total
member of the Value dimension for the current scenario, year, period, and entity. The
Con function is used in conjunction with the OpenDataUnit function, and the source
account for Con is always the account for the current item in the data unit.
You can specify a destination account. If the destination account has a different
debit/credit attribute from the source account, the system reverses the sign in the
destination. For example, if the source is a Revenue account and the destination is an
Expense account, the sign is reversed.
Examples
For example 1 on the slide, the Parent Total member is multiplied by the value returned
by the PCon function. If there is no data in the PCON account for the current point of
view, a default of 100 percent is used. Because no destination point of view is specified,
the Proportion member, which is the default destination member, is updated with the
result.
e
l
c
a
r
O
10-7
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
10-8
1
2
3
4
5
6
7
8
Sub Consolidate()
Set ConsUnit = HS.OpenDataUnit("")
NumItems = ConsUnit.GetNumItems
For i = 0 to NumItems -1
Call ConsUnit.GetItem(i, vAcc, vICP, vC1, vC2, vC3, vC4, vData)
If HS.Account.IsConsolidated(vAcc) And vData <> 0 Then
HS.Con "", HS.Node.PCon(""), ""
vPlug = HS.Account.PlugAcct(vAcc)
If CanEliminate(vPlug,vICP)= True Then
HS.Con "V#[Elimination]", -HS.Node.PCon(""), ""
HS.Con "A#" &vPlug& ".V#[Elimination]", HS.Node.PCon(""), ""
End If
End If
Next
End Sub
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
When you create a consolidation procedure, you typically first create rules to perform the
default consolidation calculations. You then modify the default calculations for those
entities or accounts that need special treatment. The example on the slide shows a Sub
Consolidate procedure that includes rules to perform the default consolidation and
elimination calculations. The following steps explain the example procedure:
1. Opens a data unit for the current point of view and stores it in the ConsUnit variable.
ConsUnit contains records for all accounts that have data for the current entity,
scenario, year, and period.
2. Creates a For...Next loop to loop through each item in ConsUnit.
e
l
c
3. Uses the GetItem function to retrieve an item from ConsUnit. The account is stored in
the variable vAcc and the intercompany partner is stored in vICP.
a
r
O
10-9
y
m
The Con function is used to write a reversing entry to the Elimination member. To
create the reversing entry, the Elimination member is specified as the destination,
and the sign for the consolidation percentage is reversed.
e
d
a
The elimination amount is written to the Elimination member of the plug account.
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
10-10
1
2
y
m
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
e
d
a
c
A
Data that require intercompany elimination must meet the following criteria:
The account must be an intercompany account.
A plug account must be specified.
e
l
c
a
r
O
10-11
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
10-12
Summary
In this lesson, you should have learned to:
Explain the default consolidation calculation
Create consolidation rules
Create elimination rules
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
10-13
y
m
e
d
a
e
l
c
e
l
c
a
r
O ly
& On
l
a e
n
r
s
e
t
U
n
I
c
A
a
r
O
10-14