Hfm Rule Training Ppt Version 1.1
Embed Size (px)
344 x 292
429 x 357
514 x 422
599 x 487
DESCRIPTION
hfm
Citation preview
Blue Asterisk templateRecap HFM Dimensional Concepts
Overview of HFM Rules
Basics of VB Scripting
Important rules like Calculation, Translation and
Consolidation
Examples of HFM rule writing ( Business Cases)
*Prerequisites : Basic Knowledge of HFM
HFM
Powerful Customized calculations ( Ratios, variances, etc) - Rules
Needed
Translations ( Currency Conversion)
Complex conversions ( Exchange rate differences, historical rates)
– Rules needed
Allocations
Data Entry
Data Entry Restriction at a Base Entity Level – Rules needed
Data Entry in a Parent Entity – Rules Needed
Custom Consolidations – Rules Needed
Rules are the heart of the applications
P
x
P
x
P
P
P
P
HFM
Used to derive ratios or opening balances
Also used for
Perform ad hoc calculations
Translation Rules
Translation rules are used to perform calculations used in complex
translations
Translations requiring historical rates
Specific rates to calculate translation difference related to Net
Revenue
Consolidation
Input
Allocation
Translation
Calculation
Transactions
Single Source to multiple destinations
Example Parent Entity X has SGA ( Selling, General &
Administrative Expenses) of 100$
Child entities A, B and C
Allocation rule distributes the 100$ as per the business
requirements amongst A, B and C
SGA of A 50$
SGA of B 30$
SGA of C 20$
Standard and Non Standard Consolidations
Standard Consolidations – Consolidation by natural aggregation of
hierarchy
Default consolidation process
Non Standard Consolidation
Consolidation rules are only active when the application setting
for ‘ConsolidationRules’ is enabled. It is thought that custom
consolidation rules will be required
Consolidation
Input
Allocation
Translation
Calculation
Transactions
Input Rules
Input rules enables the data to be entered at the Parent Entity
level
By default Data cannot be entered at Parent Entity
Only the <Entity Currency> value dimension is supported for
the Input Rules
For the Adjustments Value Dimension, only the journal data can be
entered.
The rest of the value dimension members are rolled up.
Consolidation
Input
Allocation
Translation
Calculation
Transactions
© 2008 IBM Corporation
No Input Rules
No Input rules prevent the data to be entered at the Base Entity
Level.
By default the data can be entered at lowest level intersection for
the Base Entity
No Input rules are needed
Statutory requirements
Consolidation
Input
Allocation
Translation
Calculation
Transactions
Dynamic Calculations are used to create/define formulas which are
“dynamically” executed
Dynamic Values are not stored members
Dynamic Calculations can be performed only on the base accounts.
The dynamic calculations cannot be used on the parent
accounts
Consolidation
Input
Allocation
Translation
Calculation
Transactions
Transaction Rules are valid for the ICT module in HFM
Can be executed on accounts and scenarios which supports the
Intercompany transactions
Consolidation
Input
Allocation
Translation
Calculation
Transactions
Consolidation
Input
Allocation
Translation
Calculation
Transactions
Calculation Rule is executed when Calculation or Consolidation is
run
Translation Rule is executed when Translate or Consolidation is
run
Allocation Rule is executed when the User clicks Allocation
Consolidation Rule is executed when the data is consolidated
Input Rules are executed when the application is opened
Dynamic Calculations are executed when Calculation or Consolidation
is run. All statements in the Sub Dynamic section are executed
sequentially.
Transactions Rules are applicable for the Intercompany transaction
module
No Input Rules are executed when the application is opened
HFM
© 2008 IBM Corporation
The eight types of rules are placed in separate Sub
Procedures
Sub Procedure
Series of VB Script Statements enclosed by Sub and End Sub
statements
Sub procedure performs an action but does not return a value
Example
End Sub
Rules files can have constants defined at the beginning of the rule
file
How is the Rule File Organized?
Sub Calculate()
End Sub
Sub Dynamic()
End Sub
Sub Translate()
End Sub
Sub Allocate()
End Sub
Sub NoInput()
End Sub
Sub Consolidate()
End Sub
Sub Input
End Sub
Sub Transactions()
End Sub
HFM
Constants are defined at the beginning of the rule file
Constants are assigned values which cannot be changed.
They can be used throughout the rule file in all the sub
procedures
If constants are declared within a procedure, they are available
only for that procedure
E.g. const PRIOR_YEAR_RATE=75
Example – Use of Constants
Case : Transferring the Retained Profit/Net Income from P&L
into Balance Sheet
Metadata
NetIncome ACustom 2 (base member)
PT950 P&L Account (Source Account)
C1, C2 , C3 & ICP (Source) Top Level
C1, C2 , C3 & ICP (Destination) [None]
Requirement :
Transfer the amount in PT950 with Customs and ICP at Top Level to
account A140000_C at the intersection of Custom2.NetIncome and
Custom1,3 & 4 and ICP at None level.
* Reference: Astellas Rule file
Example – Use of Constants (contd)
Expression - Without use of Constants
HS.Exp "A#A140000_C.C2#NetIncome. C1#[None].C3#[None].I#[ICP None].
W#YTD=
A#PT950.C1#AllCustom1.C2#AllCustom2.C3#AllCustom3.C4#AllCustom4.I#[ICP
Top]. W#YTD”
Expression - With use of Constants
Define Constants at the beginning of the Rule File
Const cAllNonesXC2XC4 = "C1#[None].C3#[None].I#[ICP None]”
Const cAllTopsXC4 =
"C1#AllCustom1.C2#AllCustom2.C3#AllCustom3.I#[ICP Top]”
Simplified Expression
HS.Exp "A#A140000_C.C2#NetIncome." & cAllNonesXC2XC4 &
".W#YTD = A#PT950." & cAllTopsXC4 & ".W#YTD“
* Reference: Astellas Rule file
Variables are temporary placeholders used in VB Scripts
Increases performance and makes the code less complex
Variables can be used only in the Sub procedure in which they are
created.
Can be declared on the fly
Declared explicitly using Dim Statements
Must begin with alphabetic character
Cannot exceed 255 characters
e.g. Dim vAcc1
Use of the syntax “Option Explicit” enforces the use of explicit
declaration of the variable
HFM
Dim vPOVScenario, vPOVEntity, vPOVValue, vPOVYear, vPOVPeriod,
vPOVPeriodNumber, vPOVView, vPOVDefCurrency, vPOVFreq
Current Point of View
Hs.<Dimension>.Member Holds the member of the corresponding
dimension in the Current POV
Variables can be used to hold the members in the current POV
vPOVScenario = HS.Scenario.Member()
vPOVEntity = HS.Entity.Member()
vPOVValue = HS.Value.Member()
vPOVYear = HS.Year.Member()
vPOVPeriod = HS.Period.Member()
vPOVPeriodNumber = HS.Period.Number()
vPOVView = HS.Scenario.DefaultView("")
vPOVDefCurrency = HS.Entity.DefCurrency("")
vPOVFreq = HS.Scenario.DefaultFreq("")
The attributes of the dimensions are stored in the variable
The current POV members are stored in the variables
HFM
Rules are written by applying functions to the Objects.
HS is the top level object in HFM.
Functions are actions performed for that objects. Objects can have
their own set of functions
e.g. Hs.Account.IsICP
The above syntax retrieves the value True or False depending on the
fact that the Account is marked ICP or not
Dots are used to separate the objects from other objects or
functions
Top Level Object
© 2008 IBM Corporation
Functions of HS
*P.S. This slide does not represent the complete set of
Functions
ABSExp
Executes a calculation expression and stores the result as an
absolute value
Alloc
CalcStatus
Clear
Con
Multiplies the data with a factor and put the data into
[Elimination] or [Proportion]
Exp
Executes a expression and puts data into destination POV from
Source POV
Dynamic
GetCell
GetCellNoData
Gets the data from the cell and indicates if there is no data
GetCellRealData
Gets the data from the cell and indicates if there is real
data
Input
NoInput
ContainsCellText
OpenDataUnit
SetData
Trans
TransPeriodic
HFM
© 2008 IBM Corporation
HFM Dimensional Functions
*P.S. This slide does not represent the complete set of
Functions
Account
AccountType
C1...4 Top
IsBase
IsCalculated
IsChild
Determines if the current member is a child of another member
IsConsolidated
IsDescendant
Determines if the current member is a descendant of another
member
IsICP
List
NumBase
NumChild
PlugAccount
UD1...3
Gets the user defined attribute(UD1 or UD2 or UD3) of the
Account
ValidationAccount
HFM Dimensional Functions (Contd)
*P.S. This slide does not represent the complete set of
Functions
Entity
AllowAdjs
Determines if journal postings are allowed for the entity
member
AllowAdjsFromChildren
Determines if the journal postings are allowed from children for
the member
DefCurrency
Holding
IsBase
IsChild
Determines if the member is a child of another entity member
IsDescendant
Determines if the entity is a descendant of another entity
member
IsICP
SecurityAsPartner
SecurityClass
UD1...3
HFM
HFM Dimensional Functions (Contd)
*P.S. This slide does not represent the complete set of
Functions
Scenario
Period
Custom1..4
ConsolidateYTD
Determines if the Scenario member is consolidated Year to
Date
DefaultFreq
DefaultView
IsFirst
IsLast
Number
SwitchSign
Determines if the debit/credit sign are reversed for a specified
custom member
SwitchType
Determines if the account types are switched for a specified custom
member
HFM
Common Functions across Dimensions
*P.S. This slide does not represent the complete set of
Functions
IsBase IsChild IsDescendant NumChild NumDescendant
Common Across
List SecurityClass
Common Across
Hs.OpenDataUnit Function
Data Units are all the intersections which have data for a given
POV
Function HS.OpenDataUnit is used to open the set of intersections
which have data
The HS.OpenDataUnit functions can call the data set for Account,
Customs and ICP dimension
The dimensions omitted in the syntax would be included in the data
set for all the base members
e.g. HS.OpenDataUnit (“A#Sales”)
This would open the data set for all the intersections for which
the Account “Sales” has data. The omitted dimensions of Custom and
ICP would be included for all base members in the above
example.
HFM
Set Command is used to open the data unit
Set MyDataUnit = HS.OpenDataUnit("S#Actual.A#Returns.Y#Prior")
//OpenDataUnit function is used to get all the data for “Returns”
Account member for prior year for the “Actual” Scenario
LNumItems = MyDataUnit.GetNumItems //GetNumItems function is used
to fetch the number of records (count) in the variable
LNumItems
For i=0 to LNumItems – 1 // Start of ‘For loop’
Call MyDataUnit.GetItem(i, vAcc, vICP, vC1, vC2, vC3,vC4,vData)
//Intersection is retrieved and i is used as an index. The
dimensions members and the data are stored in the variables
(vAcc,vICP,…….)
IF HS.Custom1.UD1(vC1) = “123” Then // For the given intersection,
checks the UD1 of custom1 member
HS.Exp “A#Returns.C2#” &vC2& “.C3#” &vC3& “=“
&vData& ”*1.10” //Calculation
End If //End of ‘If Statement’
Next // End of ‘For loop’
HFM
Rule Expression
EXP function is used to insert data from one account into another
account
EXP’s argument contains the account to be set and the account from
which the value is retrieved
Hs.Exp “Destination = Source”
The destination account in the LHS is assigned the value of the
source in RHS
Example of Hs.Exp
EXP Function
LHS and RHS Combinations
Behavior of Hs.Exp when Account Dimension, ICP Dimension and Custom
Dimensions
Case 1 Omitted from both sides of the equal sign
Case 2 Specified on the left side of the equal sign only
Case 3 Specified on the right of the equal sign only
*LHS Left Hand Side
*RHS Right Hand Side
HS.Exp “A#GrossSales = A#GrossSales.P#Prior * 1.1”
(Customs & ICP is omitted from both sides)
*LHS Left Hand Side
*RHS Right Hand Side
Specifying in the LHS
(C2 is specified in the destination, but not in source)
*LHS Left Hand Side
*RHS Right Hand Side
Specifying in RHS
(C2 is specified in the source, but not in destination)
*LHS Left Hand Side
*RHS Right Hand Side
HFM
First First period or year valid for the application
Last First period or year valid for the application
Next Period or Year that follows the current year
PriorPeriod or Year that precedes the current year
HFM
Adding Comments
Helps in the documentation of the rules which helps in the
understanding the purpose and interpretation of the rules
Text preceded with an apostrophe (‘) is interpreted as a
comment
E.g. 'Opening Balance Differences
If Then Else Statement
Most used conditional statement
Code in the “THEN” statement is executed only when the “IF ”
condition is met, else the code in the “ELSE” is executed
If HS.Scenario.Member = "Budget" Then
End If
ElseIf HS.Scenario.Member = "Actual" Then
Else
End If
Execution of Rule3
Nested If Then Else Statement
The THEN part and the ELSE part, if required, can contain one or
more IF-THEN-ELSE Statements.
HFM
© 2008 IBM Corporation
Select Case Statement
A Select Case structure works with a single test expression that is
evaluated once, at the top of the structure.
The result of the expression is then compared with the values for
each Case in the structure.
Select case Hs.Period.Member //Test Expression
Case “February” // Comparison of Test Expression with the Case
Defined
Hs.Exp “A#MonthTotal = A#Dailytotal*28” // Execution if case
matches
Case “April”, “June”, “September”, “ November” // Comparison of
Test Expression with the Case Defined
Hs.Exp “A#MonthTotal = A#Dailytotal*30” //Execution
Case Else // Comparison of Test Expression with the Case
Defined
Hs.Exp “A#MonthTotal = A#Dailytotal*31” // Execution
End Select // End of Select Statement
HFM
Reduces the complexity of rule file
Helps in troubleshooting
Sub Calculate
Call PerUnit_Exp_Calc("A#Manuf_Cost_Per_Unit",WholeSaleVolume)
//Calling Sub procedure PerUnit_exp_Calc
End Sub //End of Calculation Routine
Sub PerUnit_Exp_Calc(PerUnitCost,WSVolume) //Sub Procedure
PerUnit_Exp_Calc
HS.Exp PerUnitCost &"= A#TotalManufacturingCost /"&WSVolume
//Calculation of Per Unit Cost
End Sub //End of Sub Procedure
Values can be passed from Calling Procedure to the Sub
Procudure
Values passed as literal text strings should be enclosed in the
quotation marks, whereas numeric values or variables do not require
quotation marks
Variables can be passed by reference or by value
By Reference:- If the called procedure changes the value of the
variable, the value of the variable gets changed in the calling
procedure as well. By default, variables are passed by
reference
By Value:- If the called procedure changes the value of the
variable, the value of the variable is not changed in the calling
procedure. The variables must be enclosed in the parenthesis.
e.g. Sub Proc_Calc((Acct), Rate)
© 2008 IBM Corporation
Use of Functions
Sub Procedures may or may not return values to the calling
procedure. Procedures can return multiple values.
Functions can return only one value as result, of the operation
(mathematical or logical) it performs, to the calling
procedure.
Sub Calculate() // Calculate routine
End Sub // End of Calculate routine
Function PerUnit_Calc(WSVolume) // Function PerUnit_Calc
HFM
© 2008 IBM Corporation
For Next Loop
Looping enables execution of a block of statements a specific
number of times
A counter is used , whose value is incremented or decremented with
each repetition of the loop.
Syntax
…..
….
NetAggrCOS = NetAggrCOS +
HS.GetCell("A#CostOfSales.W#Periodic.P#Cur-"&vPer)
vPer = vPer + 1
Condition is given using the While Syntax.
Syntax
Loop
Example
The statements inside the loop run while the value of myNum is 10
or less.
myNum = 0
Rule Requirement:
Identify the accounts which have closing balances based on UD1
(User Defined Attribute)
Copy the calculated closing balance from “ClosingCalc”(C2
Dimension) to a member called “Closing”(C2 Dimension)
* Reference: Astellas Rule file
© 2008 IBM Corporation
Identify the Accounts having closing balances. (Member List** for
Accounts having closing balances)
For each Account which has Closing Balance
Clear the existing data in the destination intersection
Copy the data from “ClosingCalc” to “Closing” for the
accounts
Go to the next Account in the list
Reference: Astellas Rule file
** Member List is a User Defined list or a system defined list of
some members of a dimension
Looping - Business Cases
HFM
Call Each Account in the List
Clear the data
Copy the data from “ClosingCalc” to the intersection of “Closing”
for each account in the list
Go To Next Account of the List
Last
Account?
End
'*******************************************************************
' () Copy Calculated Closing //Explanation of the Sub routine using
comments
' Uses member list 'Closing Is Calculated' which is built
from
' accounts with a UD1 field of CALC_CLOSING
'*******************************************************************
Dim vAccount, vAccountsList //Declaration of variables
' Uses dynamic member list which reads UD1 attribute and checks for
CALC_CLOSING string
vAccountsList = HS.Account.List("", "Closing Is Calculated“) //Use
of variables
For Each vAccount In vAccountsList // Use of For Loop
HS.Clear "A#" & vAccount & ".C2#Closing“ //Clearing
data
HS.Exp "A#" & vAccount & ".C2#Closing = A#" & vAccount
& ".C2#ClosingCalc“ // Copying from Closing Calc to
closing
Next //Loop End
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Calculate the current opening balances from prior year end
Calculate the opening balance from prior period closing.
* Reference: Astellas Rule file
© 2008 IBM Corporation
Identify the Balance Sheet Accounts of which the opening balances
have to be calculated
For some balance sheet items the opening balance of all periods is
derived from the last period of the previous year**
For calculation of the Opening balance from the prior period
closing
If the current period is the first period of the current month then
the closing balance of the last period of prior year is carried
forward
If the current period is not the first period then the closing
balance of the previous period of the same is carried forward
Reference: Astellas Rule file
HFM
Is year the first year of the application?
Carry forward the closing balances of the last period of the prior
year
Is period the first period of the year?
Carry forward the closing balances of the prior period of the
current year
Carry forward the closing balances of the last period of the prior
year
For Selected BS Items for which the opening Balances are derived
from the last period of prior year
For opening Balances derived from prior period.
Y
Y
' Calculates current opening balances from prior year end
' closing and prior period closing
'*******************************************************************
If HS.Year.IsFirst() = False Then //Start of IF Statement
// Transfer of prior year and prior period closing balances to
current opening balances
HS.Exp "C2#OpeningYr = C2#Closing.Y#Prior.P#Last.V#<Entity Curr
Total>.S#ACT“ //Calculation
HS.Exp "C2#OpeningCommStck = C2#Closing.Y#Prior.P#Last.V#<Entity
Curr Total>.S#ACT“ //Calculation
HS.Exp "C2#OpeningAddPaidCap =
C2#Closing.Y#Prior.P#Last.V#<Entity Curr Total>.S#ACT"
//Calculation
HS.Exp "C2#OpeningRetEarn = C2#Closing.Y#Prior.P#Last.V#<Entity
Curr Total>.S#ACT" //Calculation
HS.Exp "C2#OpeningInvestSub =
C2#Closing.Y#Prior.P#Last.V#<Entity Curr Total>.S#ACT”
//Calculation
If HS.Period.IsFirst() = True Then //Nested If Condition
HS.Exp "C2#OpeningMth = C2#Closing.Y#Prior.P#Last.V#<Entity Curr
Total>.S#ACT"
Else
If HS.Period.IsFirst() = False Then //check for first period
HS.Exp "C2#OpeningMth = C2#Closing.P#Prior“ //calculation for first
period
End If
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
'*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
* Reference: Astellas Rule file
In the given example C2 Dimension is used for the movement of
balances
HFM
Constants and Variables should begin with a identifier
e.g. vEntity, vScenario, ALL_TOPS ( Here v is used to identify the
variables and the Constant ALL_TOPS is declared in capital
letters
All variables must be declared using the Dim Statement
Use of Option Explicit will enforce this requirement
HFM
Sub Routines and Functions
Subroutines and method calls are to be called using the 'Call'
syntax with brackets e.g.
Call TransfertoBalanceSheet() should be used instead of only
TransfertoBalanceSheet()
This adds clarity to the script by showing explicitly that a Sub
procedure is being called.
' Function calls MUST use brackets even when there are no
parameters e.g.'
nParam = FunctionWithNoParams()
© 2008 IBM Corporation
Best Practices….Contd
Line Continuation Tips
Break complex formulas at a point where a line performs an
action.
If you include long dimension names in the code line, break the
line to show one account per line.
Insert the mathematical operators at the beginning of the line so
that you can identify what type of action is being applied to the
account in the formula. When the line break is applied, the
operators and account are split in a logical manner.
HFM
© 2008 IBM Corporation
Best Practices….contd
Performance and Debugging
Because writing to a log file impacts performance, you should use
custom logging only during development and testing of your
application.
All calls to write-to-file procedures should be disabled 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.
HFM
Movement Accounts
Movement Accounts are used to show greater visibility of the
balance sheet accounts
Some of the movement accounts are
Fixed Assets
Movement is captured in the Custom4 Dimension as shown below.
Account is a FA account with which the C4 is attached
HFM
Movement Accounts - Custom Structure
Closing Balance is the final value that goes into the balance
sheet
HFM
Opening Balance is a Calculated member
The prior period’s closing balance is transferred to the Opening
Balance using Rules
Hs.Exp “C4#OpeningBalance = C4#ClosingBalance.Y#Prior.P#Last
Movement Accounts - Custom Structure
© 2008 IBM Corporation
In spite of being attached to Balance Sheet Account, the
highlighted member (“Increases”) behaves as Flow Account as
SwitchTypeForFlow is checked.
Movement Accounts - Custom Structure
© 2008 IBM Corporation
In spite of being attached to Balance Sheet Account, the
highlighted member (“Decreases”) behaves as Flow Account as
SwitchTypeForFlow is checked and negative value is aggregated to
the parent as SwitchSignForFlow is checked.
Movement Accounts - Custom Structure
Rules are used to calculate the Foreign Exchange Adj Values
Movement Accounts - Custom Structure
HS.Trans "C4#ForeignExchange", "C4#ClosingBalance",
"A#ClosingRate", "“
// The foreign exchange and closing balance is translated using the
closing rate
HS.EXP "C4#ForeignExchange = C4#ClosingBalance –
C4#OpeningBalance-C4#Increases-C4#Movement+C4#Decreases”
//Foreign Exchange Calculation = Closing - Opening - Increases
–Movement+ Decreases
ForeignExchange = 192 - 189.2 = 2.8
Movement defined in Customs can be attached with multiple
accounts
Usage of movement in Customs will lead to minimum hard coding in
the rules as these are not account specific
Most of the information is calculated
Easy from a maintenance perspective
HFM
VAR – Value at Rate
PVA – Periodic Value Added
VAR: Translates entire current period balance at the current
exchange rate
PVA: Translates only the current period change in the YTD value at
the current period exchange rate
HFM
The PVA Setting is done in the application settings.
- PVA for Flow Accounts
- PVA for Balance Accounts
If PVA is not used, the VAR is used by default
HFM
DefCurrency attributes of child entity and parent entity is
compared.
- If the Defcurrency is different then the translation is
initiated.
Use of Exchange rate ( Average or Closing Rate ) is decided by the
business requirements
Metadata has to be configured to use these exchange rates for the
translation process
For Flow Accounts ( Revenue and Expense) Average rate is used by
the system for translation if it is defined in the
DefaultRateForFlow property in the Application Settings
For Balance Accounts( Asset and Liability) Closing rate is used by
the system for translation if it is defined in the
DefaultRateForBalance property in the Application Settings
Type of Translation is decided by the PVA setting in the
Application Settings
ECT (<Entity Currency Total>) is translated and the
translated values sit in PC(<Parent Currency>).
HFM
End If
End Sub
Rules in Sub Translate execute during consolidation. They can also
be run from a Data Grid or Data Form using Translate option
Rules in this section of Sub Calculate execute only on translated
values.
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.
HFM
HS.Trans("DestPOV","SourcePOV","Rate1","Rate2")
HS.Trans("DestPOV","SourcePOV","Rate1","Rate2")
* Trans and Transperiodic functions to override the default
translations for an account. The parameters for the two functions
are identical.
HS.TransPeriodic
HFM
DestPOV
The destination point of view. The destination can be any
combination of Account, Custom1...4, or ICP members. For each
unspecified dimension, the system writes to all valid members of
the dimension. For each specified dimension, the system writes to
the specified member only.
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. HS.Trans
"C1#Movement","","A#AvgRate",""
Rate1
The exchange rate. The rate can be a constant, an exchange rate
account, or a specific cell.
Rate2
An exchange rate to use for calculating an exchange variance.
HFM
The Source value dimension member is always <Entity Curr
Total>
The Destination value dimension member is always the parent member,
i.e. <Parent Currency>
Calculate rule runs after the translation rule by default
Calculation results are overriding in nature, whereas the
Translation results are accumulative in nature
i.e. if same destination POV is used in multiple rules with Trans
or Transperiodic , results are accumulated in the destination
Account
However results do not accumulate between trans and transperiodic
functions
Translation functions can be used to calculate the differences due
to exchange rates using “Rate 2” in the parameters
HFM
Calculation of Exchange Rate Differences
Let us assume cash Balance for ABC is 500 for Jan and Feb
Exchange rate differences caused the difference in the translated
values.
Above example shows the exchange rate difference of 50 (800-750) in
the parent currency level
(contd..)
JAN
FEB
Use of Translation Functions to calculate the exchange rate
HS.Trans
"A#Cash.C1#EXCH_DIFF","A#Cash.C1#Opening","A#EOMRate","A#PriorEOMRate“
Source Account is translated using Rate 1 i.e. EOM Rate for
Feb
500*1.6 = 800
Source Account is translated using Rate 2 i.e. Prior EOM Rate for
Jan
500*1.5 = 750
EXCH_DIFF = 50 (800 – 750 )
PCon
Gets the percentage of consolidation for the specified member or
current member
- HS.Node.PCon("S#Scenario.Y#Year.P#Period.E#Entity")
- HS.Node.PCon("") //applies the function to the current
member
Puts value in the Proportion and Elimination. The Con function
multiplies the value of the Parent Total member by a specified
factor and updates either the Proportion member or the Elimination
member of the Value dimension with the result.
This function is valid only in the Sub Consolidate procedure.
- HS.Con "DestinationPOV", Factor, "Nature“
The source is the Parent Total member for the current entity, year,
and scenario.
The destination is either the Proportion or the Elimination
member.
Con
HFM
Consolidation happens only for those accounts whose IsConsolidated
property is checked
PCon is applied to Parent Total member
EC (Parent Entity) = CT(Child)= P(Child) +Elim (Child)+CA(
Child)
For Elimination
Plug should be specified
Elimination happens at the first common parent
We cannot specify the Source functions in the Con function. It is
always the <Parent Total> Member. 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.
HFM
Call MyDataUnit.GetItem(i, strAccount, strICP, strCustom1,
strCustom2, strCustom3, strCustom4, dData)
If dData <> "0" and HS.Account.IsConsolidated(strAccount)
then
HS.Con "", HS.Node.PCon(""), ""
vPlug = HS.Account.PlugAcct(strAcc)
End If
Select Case Method
Consolidation Procedure
Set MyDataUnit = HS.OpenDataUnit("") Opens the data unit for the
current POV and stores in the Variable MyDataUnit
lNumItems = MyDataUnit.GetNumItems Counts the record in the array
MyDataUnit
For i = 0 to lNumItems-1Creates a for loop for till the last record
of the data unit is processed.
Call MyDataUnit.GetItem(i, strAccount, strICP, strCustom1,
strCustom2, strCustom3, strCustom4, dData) Calls the first record
of the data unit. Account is stored strAccount, ICP in strICP,
Customs in StrCustoms and data in dData
If dData <> "0" and HS.Account.IsConsolidated(strAccount)
then…End If Checks whether IsConsolidated property is checked and
data is present for the intersection. If true than the rest of the
procedure is processed
HS.Con "", HS.Node.PCon(""), "“ HS.Node.Pcon(“”) is the
multiplication factor of the HS.Con Function. It Picks the
consolidation percentage of the current Member.Since nothing is
specified in the HS.Con Destination POV, the default destination is
Proportion .
vPlug = HS.Account.PlugAcct(strAcc) Captures the plug Account of
StrAccount and stores it in VPlug
If CanEliminate(vPlug,strICP)= True Then…End If Calls the
CanEliminate Function and checks if the account requires
InterCompany Elimination
If true,
HS.Con "V#[Elimination]", -HS.Node.PCon(""), "“The Con function is
used to write a reversing entry to the Elimination member
The elimination amount is written to the Elimination member of the
plug account.
Use of Select Case Method to perform specific
Consolidation…contd
Steps
HFM
Consolidation Procedure
Specific Consolidation rules can also be written in the Consolidate
Sub routine
Sample of Specific Consolidation Rules
Select Case Method
Set MyDataUnit = HS.OpenDataUnit("A#prftbeforeexcptitems.I#[ICP
Top]") //Open the data units
lNumItems = MyDataUnit.GetNumItems //gets the number of records in
open data Unit
For i = 0 to lNumItems-1 // For loop for all the records in Open
data unit
Call MyDataUnit.GetItem(i, strAccount, strICP, strCustom1,
strCustom2, strCustom3, strCustom4, dData) // Calling each record
of the data unit
Call Hs.Con ("A#MICharge.V#[Elimination].I#[ICP None]", dPMin * -1
, "MI on PnL") // Specific calculation
Call Hs.Con ("A#MIPnLduringtheperiod.V#[Elimination].I#[ICP None]",
dPMin * 1 , "MI on BAL SHEET") // Specific calculation
Call Hs.Con ("A#NoASeg20.V#[Elimination].I#[ICP
None].C3#Unallocated", dPMin * -1 , "MI on PnL") // Specific
calculation
Next
vPar=HS.Parent.Member // stores the parent entity of the current
member
CanEliminate = TRUE // Initial value set to true
If vPlug="" Then
CanEliminate=FALSE // If there is no plug defined, then set to
False
ElseIf strICP="[ICP None]" Then // Checks for Intercompany
partner
CanEliminate=FALSE // if ICP Partner is [ICPNone], then set to
false
ElseIf Not HS.Entity.IsDescendant(vPar, strICP) Then // Checks if
strICP is descendent of the vPar
CanEliminate=FALSE // if not a descendant, then Set to False
End If
End Function
Conclusion
There are changing requirements in the financial and accounting
systems of the business. Hence the system design and processes
should be flexible enough to quickly adapt to these changes.
The system maintenance should be taken care at the metadata level
as much as possible
Easier to make changes in Metadata than rules
HFM
© 2008 IBM Corporation
Sample Rule File
This is a sample Rule File and contains the examples shown in the
training module.
This rule should not be executed for any application.
*Double Click and Open. Opens with HFM Rules Editor or
Notepad
HFM
LOAD MORE