Beruflich Dokumente
Kultur Dokumente
d e
ca
e A
c l
r a
O ly
l & On
D52786GC10
n a e
Edition 1.0
January 2008
t e r U s
D53156
I n
c l e ®
r a
O
Author Copyright © 2008, Oracle. All rights reserved.
Trademark Notice
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Table of Contents 0
Exercises
c a
Testing the Discounts Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
A
Transferring Data from the Income Statement to the Balance Sheet. . . . . . . . . . . . 7
e
Lesson 4: Creating Dynamic Rules
c l
Exercise 4.1
Exercise 4.2 r a
Creating a Percent of Sales Calculation for the Periodic View . . . . . . . . 9
Creating a Gross Margin Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
O ly
Lesson 5: & On
Creating Custom Procedures
l
Exercise 5.1 a e
Creating a Custom Sub Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
n
Exercise 5.2
Exercise 5.3
t e r U s
Creating a Custom Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Creating a Custom Logging Procedure . . . . . . . . . . . . . . . . . . . . . . . . . 11
Lesson 6: I n
Creating Arrays and Loops
c
Exercise 6.1l e Creating Loops with Member Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
r a
Exercise 6.2 Working with Data Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
O
Table of Contents
r a
Lesson 2: Creating Variables
O ly
Solution 2.1
& On
Creating Constants for the Custom and ICP Dimensions . . . . . . . . . . . 25
l
Solution 2.2
a e
Creating Header Variables for Sub Calculate . . . . . . . . . . . . . . . . . . . . 25
n
Lesson 3: r s
Controlling the Scope of Rules
t e U
Solution 3.1
Solution 3.2 I n
Creating Variables for the Total Members . . . . . . . . . . . . . . . . . . . . . . . 26
Setting the Scope of the Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
l
Solution 3.3
c e Working with Custom Dimensions in Rules . . . . . . . . . . . . . . . . . . . . . . 26
r a
O
iv Hyperion Financial Management 9.3.1: Create Rules
Table of Contents
m
Lesson 8: Working with Dimension Hierarchies
d e
Solution 8.1
Solution 8.2 c a
Calculating Closing Balances. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Managing Calculation Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Solution 8.3 A
Setting Opening Balances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
e
Solution 8.4
l
Creating an Allocation (Optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
c
Lesson 9:
r a
Creating Translation Rules
Solution 9.1 O ly
Creating Translation Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
l & On
Lesson 10: Creating Consolidation Rules
n a e
t e r U s
Solution 10.1 Customizing the Default Consolidation . . . . . . . . . . . . . . . . . . . . . . . . . 38
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules v
Table of Contents
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
vi Hyperion Financial Management 9.3.1: Create Rules
Exercises
Overview
This section contains hands-on exercises that you will be working on
throughout this course. Exercises are grouped by lesson.
Your instructor may choose to demonstrate some exercises. Therefore,
you may not be required to complete all exercises. It is, however, important
that you complete all exercises as requested by the instructor, as many
exercises build upon one another in the course.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Lesson 1 Reviewing Rules Syntax
Exercises
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
2 Hyperion Financial Management 9.3.1: Create Rules
Lesson 2 Creating Variables
Exercises
Start a new rules file named Apex2.rle. Create constants for the following combinations
of members:
• All custom dimensions and the ICP dimension set to the None member. You
do not need to include Custom4 because it is not used in the application.
• All custom dimensions and the ICP dimension set to the top member. You do
not need to include Custom4.
m y
• Custom 2, Custom 3, and the ICP dimension set to None, Custom 1 omitted
d e
c a
• Custom 1, Custom 2, and the ICP dimension set to None, Custom 3 omitted
A
• Custom 2, Custom 3, and the ICP dimension set to the top member, Custom
e
1 omitted
c l
r a
• Custom 1, Custom 3, and the ICP dimension set to the top member, Custom
2 omitted
O ly
3 omitted
l & On
• Custom 1, Custom 2, and the ICP dimension set to the top member, Custom
n a e
t e
syntax for Solution 2.1. r
Save the file as c:\cf\Apex\apex2.rle. When you are finished, compare your syntax to the
U s
I n
l e
Exercise 2.2
c
Creating Header Variables for Sub Calculate
r a
In this exercise you create variables that you can use throughout the Sub Calculate
procedure.
O
Hyperion Financial Management 9.3.1: Create Rules 3
Lesson 2 Creating Variables
Exercises
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
4 Hyperion Financial Management 9.3.1: Create Rules
Lesson 3 Controlling the Scope of Rules
Exercises
m
After you have created the variables, compare your syntax to the syntax in Solution 3.1.
y
d e
Exercise 3.2 Setting the Scope of the Rule
c a
A
In this exercise you create a section in the Sub Calculate procedure for rules that should
e
c l
be executed only if the current entity is a base-level entity and the current Value
dimension member is the Entity Currency member.
r a
Create an If...Then statement in which to place rules to be executed only for the Entity
O ly
Currency member. Within this statement, create another If...Then statement in which to
& On
place rules to be executed only for base-level entities.
l
a e
When you are finished, compare your syntax to the syntax in Solution 3.2.
n
Exercise 3.3 t e r U s
Working with Custom Dimensions in Rules
I n
In this exercise you create rules to calculate the Discounts account and to transfer
l e
balances from the profit and loss statement to the balance sheet. Be sure to analyze the
c
custom dimensions settings for each account to determine the correct custom dimension
r a
members for each side of the HS.Exp expression.
O
Hyperion Financial Management 9.3.1: Create Rules 5
Lesson 3 Controlling the Scope of Rules
Exercises
The following rules are for base-level entities only and should be executed only for the
Entity Currency member.
A fixed discount rate is used for each type of customer. These are the discount rates for
each customer type:
C_Trade: 5%
C_ Wholesale:15%
C_Retail: 6%
C_Other: 5%
m
Create the necessary rules for the Discounts account to calculate the total discount for
y
each customer type. Keep these considerations in mind:
d e
c a
• Because Apex makes adjustments to the budget by using journals during the course
of the year, you should base your calculation on the adjusted GrossSales account.
e A
• For the Actual scenario, Apex loads data for Discounts, so the Actual scenario should
be excluded from the calculation.
c l
r a
• Although gross sales are budgeted by customer and product, discounts are
budgeted by customer only. For this reason the Custom2 and Custom3 dimensions
O ly
are valid for the GrossSales account, but only the Custom3 dimension is valid for the
Discounts account.
l & On
a e
Before you write the rule, open Apex.xml in the Metadata Manager and review the
n
t e r
custom dimension settings for the Discounts and GrossSales accounts.
U s
n
Testing the Discounts Rules
I
l e
To test the rules, use the Net Sales grid. Set the point of view to West Sales, 2006,
February and run the rules. The C_Trade and C_Wholesale members have journal
c
r a
adjustments to GrossSales for February. Verify that the discount calculation uses the
adjusted totals for GrossSales.
O
6 Hyperion Financial Management 9.3.1: Create Rules
Lesson 3 Controlling the Scope of Rules
Exercises
m y
d e
c a
e A
c l
r a
The Custom 1 dimension of the Apex application contains hierarchies for balance sheet
movement. Transfers from the income statement are stored in the P_L member of
O ly
Custom 1, which is set to SwitchSignForFlow to accommodate periodic values. You
& On
need to create the following calculations:
l
a e
• Transfer the total from the RetainedProfit account to the RetainedIncome account.
n
t e r U s
• Transfer the total from the DivisRecd_PL account to the DivisRecd_BS account.
• Transfer the total from the DivisPaid_PL account to the DivisPaid_BS account.
I n
These rules should be executed for all scenarios.
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 7
Lesson 3 Controlling the Scope of Rules
Exercises
Before you create the rules, review the custom dimensions settings for the following
accounts:
• RetainedProfit
• RetainedIncome
• DivisRecd_PL
• DivisRecd_BS
• DivisPaid_PL
• DivisPaid_BS
To test the rules, open the P&L Transfer data grid. Verify that Custom1 is set to P_L in
the point of view. Use Force Calculate to calculate the grid. Note the balance sheet
account numbers for February. Change the view for Custom1 to the top member and
verify that the income statement balances match the balances transferred to the balance
sheet accounts.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
8 Hyperion Financial Management 9.3.1: Create Rules
Lesson 4 Creating Dynamic Rules
Exercises
c a
Create a rule for the GMPercent account that divides the GrossMargin account by the
e
as a percentage. This rule should be executed for all views. A
NetSales account. Be sure to multiple the product by 100 so that the result is expressed
c l
To test your rule, use the Analysis data grid with the point of view set to West Sales,
February.
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 9
Lesson 5 Creating Custom Procedures
Exercises
e
to it as a parameter.
c l
you create a custom function that returns an annualized balance for any account passed
r a
Create a new function named Annualize with variables to receive an account name and
O ly
the current period from the calling procedure.
l & On
The Annualize function should perform the following calculation for the account passed
to it from the calling procedure:
n a e
(Year-to-data balance / Current period number) * 12
t e r U s
In the Sub Calculate procedure, use the Annualize function to calculate annualized
I n
values for the NetSales account and the COS accounts, storing the annualized balances
for NetSales in the NetSales_A account and for COS in the COS_A account.
c l e
Use the Annualize data grid for WestSales, Budget, 2006 to test the function.
r a
O
10 Hyperion Financial Management 9.3.1: Create Rules
Lesson 5 Creating Custom Procedures
Exercises
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 11
Lesson 6 Creating Arrays and Loops
Exercises
c
variable in place of literal text to specify the member name.
a
the UD2 property for the Concrete member of custom2. You can use a
e A
c l
• Use calls to the WriteToFile procedure to 1) log each product processed in the
r a
For...Next loop and 2) log each product for which the tax credit was calculated.
O ly
• In the Sub Calculate procedure, add calls to the TaxRate procedure.
Massachusetts.
l & On
- You should call the procedure only for entities that are descendants of California or
n a e
t e r
- The tax rate for the state should be passed as a parameter. The tax credit is 1
s
percent of gross sales for California and .8 percent for Massachusetts.
U
TIP
I n
You can use the IsDescendant function to test whether a member is a
c l e
descendant of a parent. For example, HS.Entity.IsDescendant(“France“, “”)
O
12 Hyperion Financial Management 9.3.1: Create Rules
Lesson 6 Creating Arrays and Loops
Exercises
Include a call to the WriteToFile procedure to log the name of the entity for which the
TaxRate procedure is run.
Use the TaxCredit data grid to test the rule. Run the rule for the WestSales entity and the
1200 entity for January, Budget, 2006. The products with the “recyc” attribute are Steel,
Plasterboard, and Plastic. Review the log file.
A
• To calculate the tax credit, multiply the data variable defined in the GetItem function
e
by the Rate.
c l
r a
• Modify the Sub Calculate procedure to call TaxCreditData instead of TaxCredit.
O ly
Use the TaxCredit data grid to test the rule. Run the rule for the WestSales entity and the
1200 entity for January, Budget, 2006. Compare the log for the TaxCreditData procedure
l & On
to the log for the TaxCredit procedure. The TaxCreditData procedure should have
a e
processed less items than the TaxCredit procedure.
n
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 13
Lesson 7 Working with Financial Management Data
Exercises
n a e
Calculate January. The results should match the following:
• Travel: 5000
t e r U s
• Phone: 2500
I
• Stationery: 1250 n
c l e
Change the entity to Plant1 and calculate January. Because there is no real or derived
a
Employee data for Plant1, the rules should not execute and the cells should be blank.
r
O
14 Hyperion Financial Management 9.3.1: Create Rules
Lesson 7 Working with Financial Management Data
Exercises
m y
Exercise 7.3 Creating a NoInput Procedure
d e
In this exercise you set accounts to no input.
c a
Create a NoInput Sub procedure and write rules to set the following accounts to no input:
e
• The Discounts account in the Budget scenario A
c l
• The Travel, Phone and Stationery members of the Custom2 dimension for the
Overheads account.
r a
O ly
• All accounts in the Rounded scenario
& On
Use the NetSales, Input Overhead, and Rounding data grids to test the rule.
l
n a e
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 15
Lesson 8 Working with Dimension Hierarchies
Exercises
m y
d
status of the first period of the following year should be impacted. Create a sube
If it is the last period in the year and the Sub Calculate procedure is run, the calculation
c a
procedure named ImpactOpenings that use the ImpactStatus function to accomplish this.
Remember that if the Next keyword is used to cross to an invalid year an error is
A
returned. You should call the procedure from the Sub Calculate procedure.
e
l
Use the OpeningBalances data grid to test the closing balance and impact status rules:
c
a
• Enter test data in the Opening and Cash members for December 2006 and calculate.
r
O ly
• Verify the Closing Balance calculation.
it was impacted.
l & On
• Change the point of view to January 2007. Check the calculation status to verify that
n a e
• Calculate December of 2014 to verify that the ImpactOpenings procedure does not
e r s
attempt to impact invalid years.
t U
I n
Exercise 8.3
r a
For balance sheet accounts, Apex takes the closing balance of the prior period as the
opening balance for the current period.
O
16 Hyperion Financial Management 9.3.1: Create Rules
Lesson 8 Working with Dimension Hierarchies
Exercises
In this exercise you create rules to set opening balances for balance sheet accounts.
Create a custom procedure named Opening with the necessary rules. Follow these
guidelines:
• For the Custom1 dimension, use an HS.Exp expression to set the Opening member
of the current period equal to the Closing member of the prior period.
• Because its data is copied from the Actual scenario, the Rounded scenario should be
excluded.
• The rule should not be executed for the first period of the first year.
TIP
Because the Opening and Closing members of the Custom1 dimension are valid
only for balance sheet accounts, you do not need to include the Account
dimension in the HS.Exp expression.
m y
from invalid years.
d e
• Calculate January of 2005 to verify that the rule does not attempt to retrieve data
c a
Exercise 8.4 Creating an Allocation (Optional)
e A
c l
Apex has decided to modify its procedure for calculation overhead. Overhead expenses
for all divisions in each state will be input as a lump sum to the administrative entity for
r a
that state. The overhead expenses will then be allocated to the divisions based on head
count. In this exericse you replace the rules for overhead you created previously with an
allocation procedure. O ly
l & On
Apex will use members in the Custom1 dimension to manage the allocation. The
a e
following graphic shows a sample structure:
n
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 17
Lesson 8 Working with Dimension Hierarchies
Exercises
The lump sum is input to the Unallocated member of the administrative entity. The
allocation of this lump sum to each entity is calculated by a rule and stored in the
Allocated member. Aggregation is turned off for the Unallocated member to avoid double
counting into TotalAllocated.
The following attributes are used in the UD2 field to identify which entities to include in
the allocation for each state: “CA_ALLOC” for California entities, “CT_ALLOC” for
Connecticut entities, and “MA_ALLOC” for Massachusetts entities.
Head count for each entity is stored in the Employee account.
In the Sub Calculate procedure, place apostrophes in front of the previous overhead
allocation rules to turn them into comments. Add a comment line stating that the
overhead calculations are being replaced by an allocation procedure.
Create a Sub Allocate procedure to allocate the overhead expenses for entities in the
United States. Follow these guidelines:
• The allocation should be executed for base-level entities in the United States only.
• Use the Base system member list with the Overheads parent in Custom2 to create
an array variable for the overhead members.
• Loop through the overhead members:
m y
d e
- For each entity, determine the allocation percentage by dividing the entity head
count by the head count of its parent. Use the UD2 attribute to determine the
a
parent and use the GetCell function to retrieve the head count for the parent.
c
e A
- Use the allocation percentage to allocate the value in the Unallocated member of
the administrative entity for the state to the Allocated member of the current entity.
c l
• Modify the Sub Input procedure as follows:
r a
- Remove the NoInput statement for Travel, Phone, and Stationery.
O ly
- Add a NoInput statement for the Allocated member of Custom1.
l & On
Use these guidelines to test the rule:
n a e
• Using the Headcount data grid, enter head count data for the children of California for
t e r U s
January, then consolidate California.
I n
• Using the Overhead data grid for January, 2006, Budget, enter test data in the
UnAllocated member of entity 1000 for the Overhead members.
l e
• Submit and calculate the data.
c
r a
• Select 1000, Plant1, and WestSales, then select Actions > Allocate to allocate the
data. Verify the allocation calculation.
O
18 Hyperion Financial Management 9.3.1: Create Rules
Lesson 8 Working with Dimension Hierarchies
Exercises
• Consolidate California. Both the unallocated and allocated amounts are stored in the
Custom members to enable reporting on any difference. But only the Allocated
member is aggregated to the Income statement.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 19
Lesson 9 Creating Translation Rules
Exercises
c a
• The FX member of Custom1 stores the aggregation of the Rate and Move members.
e A
The CTA account in the Shareholders hierarchy stores the total currency translation
adjustment.
c l
Calculating Exchange Differences r a
O ly
Create translation rules using the Trans function for the following calculations:
l & On
• Calculate the Rate member of Custom1 as the difference between the Opening
a e
member translated at the end rate and at the opening rate.
n
e r s
• Calculate the Move member of Custom1 as the difference between the PL member
t U
translated at the end rate and at the average rate.
TIP I n
c l e
You do not need to specify source or destination accounts. As with the
HS.Exp function, if you omit the Account dimension from the Trans or
r a Transperiod function, the scope of the function includes all accounts for which
m y
11. Verify the exchange rate difference in the Move account is 200. This is the difference
AveRate.
d e
between the 800 EUR calculated using EopRate and the 600 EUR calculated using
c a
Calculating the Currency Translation Adjustment
e A
The CapitalEmployed and Shareholder accounts are the top-level accounts in the
c l
balance sheet. The FX member of Custom1 aggregates the exchange differences in the
r a
Rate and Move members. Create a rule to calculate the CTA account as the sum of the
exchange differences for the CapitalEmployed and Shareholders accounts.
O ly
• You want the rule to run after data has been translated, so you should place the rule
& On
in the Sub Calculate procedure. The Sub Calculate procedure is executed both
l
a e
before and after translation.
n
t e r s
• Use an If...Then statement to ensure that the rule is executed only for translated
currencies. The rule should not be executed for Entity Currency.
U
I n
• The rule should be executed for all entities, not just base-level entities
l e
Use the CTA data grid to test the rule. Verify that EUR is selected for the Value
c
dimension. Use Force Translate to run the rule for EmeaServices, Budget, 2006. This
r a
runs both the Sub Translate and Sub Calculate procedures. The amount in the Other
member of Custom1 for the CTA account should equal the sum of the Rate and Move
Oaccounts from the Translation grid.
e A
• If the UD2 attribute is not “discon”, use the default consolidation.
c l
To test the rule, use the CustomConsol data grid. Consolidated the
r a
UnitedStates.California entity for January, Budget, 2006. The Concrete and Plasterboard
products have the “discon” attribute, so data for these products should be consolidated
O ly
from Plant1 and WestSales to the Discontinued member of California. The Concrete and
& On
Plasterboard members for California should have no data.
l
n a e
t e r U s
I n
c l e
r a
O
22 Hyperion Financial Management 9.3.1: Create Rules
Exercise Solutions
Overview
This section contains step-by-step solutions to successfully complete all
exercises. Solutions are grouped by lesson.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Lesson 1 Reviewing Rules Syntax
Solutions
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
24 Hyperion Financial Management 9.3.1: Create Rules
2 Creating Variables
Solutions
' ********************************************************************
' This section establishes constants for [None] and top-level
' dimension members. C4 is not used in this application so it is
omitted.
' *********************************************************************
const ALL_NONE = ".I#[ICP None].C1#[None].C2#[None].C3#[None]"
const ALL_TOPS = ".I#[ICP Top].C1#TopC1.C2#TopC2.C3#TopC3"
const NONES_NOC1 = ".I#[ICP None].C2#[None].C3#[None]"
const NONES_NOC3 = ".I#[ICP None].C1#[None].C2#[None]"
const TOPS_NOC1 = ".I#[ICP Top].C2#TopC2.C3#TopC3"
const TOPS_NOC2 = ".I#[ICP Top].C1#TopC1.C3#TopC3"
const TOPS_NOC3 = ".I#[ICP Top].C1#TopC1.C2#TopC2"
m y
Solution 2.2 Creating Header Variables for Sub Calculate
d e
c a
' *********************************************************************
A
' The following subroutine runs when you calculate or consolidate
e
l
' *********************************************************************
c
Sub Calculate()
r a
pov_entity = HS.Entity.Member
O ly
pov_scenario = HS.Scenario.Member
pov_value = HS.Value.Member
l & On
pov_year = HS.Year.Member
n a e
pov_period = HS.Period.Number 'This is the number not the name
t e r
vIsTrans = HS.Value.IsTransCur
U s
vIsBase = HS.Entity.IsBase("","")
'This yields a True or False
'This yields a True or False
End Sub
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 25
Lesson 3 Controlling the Scope of Rules
Solutions
Solution 3.2
'
Setting the Scope of the Rule
********************************************************************'
m y
' The following section is for Entity Currency of base-level
d e
'
'
members only:
c a
*********************************************************************
If pov_value = "<Entity Currency>" Then
If vIsBase Then
e A
'Rules for base entities go here
End If
c l
End If
r a
O ly
Solution 3.3
& On
Working with Custom Dimensions in Rules
l
a e
'***********************************************************************
n
t e r s
'The following section is for Entity Currency of Base Level members only:
'***********************************************************************
U
'
I n
These rules calculate discounts for each type of customer as a
'
'
c l e
pre-defined percentage of Gross Sales
Because the C2 dimension is not valid for Discounts we retrieve
'
O If vIsBase Then
' Transfer balances from the Income Statement to the Balance Sheet.
' The P_L member in Custom1 stores transfers from the Income Statement
HS.Exp "A#RetainedIncome.C1#P_L" &NONES_NOC1& _
"= A#RetainedProfit" &ALL_TOPS
HS.Exp "A#DivisRecd_BS.C1#P_L"&NONES_NOC1& _
"=A#DivisRecd_PL" &ALL_TOPS
HS.Exp "A#DivisPaid_BS.C1#P_L"&NONES_NOC1& _
"=A#DivisPaid_PL" &ALL_TOPS
End If
End If
End Sub
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 27
Lesson 4 Creating Dynamic Rules
Solutions
End Sub
m y
' The following sub routine contains rules for dynamic accounts
d e
' ********************************************************************'
Sub Dynamic()
c a
' *********************************************************************
A
' Calculates gross margin percentage by product (products are in
e
c l
' Custom2)Gross Margin is tracked by Product so Custom 2 is ommitted.
' Other customs are invalid for Gross Margin so are set to None.
r a
HS.Dynamic "A#GMPercent=A#GrossMargin" &TOPS_NOC2& _
O ly
"/ A#NetSales" &TOPS_NOC2&" * 100"
End Sub
l & On
n a e
t e r U s
I n
c l e
r a
O
28 Hyperion Financial Management 9.3.1: Create Rules
5 Creating Custom Procedures
Solutions
Sub DiscountsCalc(vTrade,vWSale,vRetail,vOther,vRight_value)
HS.Exp "A#Discounts.C3#C_Trade = A#GrossSales.C2#TopC2"& _
vRight_value& "*" &vTrade
HS.Exp "A#Discounts.C3#C_Wholesale = A#GrossSales.C2#TopC2"& _
vRight_value& "*" &vWSale
HS.Exp "A#Discounts.C3#C_Retail = A#GrossSales.C2#TopC2"& _
vRight_value& "*" &vRetail
HS.Exp "A#Discounts.C3#C_Other = A#GrossSales.C2#TopC2"& _
vRight_value& "*" &vOther
End Sub
m y
d e
Solution 5.2 Creating a Custom Function
c a
Sub Calculate
'Use the Annualize function for NetSales and COS
e A
c l
HS.EXP "A#NetSales_A = " &Annualize("NetSales",pov_period)
HS.EXP "A#COS_A = " &Annualize("COS",pov_period)
End Sub
r a
O ly
Function Annualize(vAcct,vCurrentPeriod)
l & On
' This function takes the YTD value for an account and
' divides it by the current period number to get an average,
a e
' and then multiplies by 12 to get the annualized amount.
n
End Function
t e r
Annualize="A#" &vAcct& ALL_TOPS &".W#YTD /" &vCurrentPeriod& " * 12"
U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 29
Lesson 5 Creating Custom Procedures
Solutions
End Sub
Sub Calculate
m y
'Make sure to place this call after the POV variables section
d e
Call WritetoFile("Calculate sub procedure started for " &pov_entity& _
...
" " &pov_scenario)
c a
...
e A
...
c l
Call WritetoFile("Calculate sub procedure ended for " &pov_entity& _
" " &pov_scenario)
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
30 Hyperion Financial Management 9.3.1: Create Rules
6 Creating Arrays and Loops
Solutions
e A
c l
If HS.Entity.IsDescendant("California",pov_entity) Then
call TaxCredit(.01)
r a
call WritetoFile("Calculating tax credit for " &pov_entity)
O ly
ElseIf HS.Entity.IsDescendant("Massachusetts",pov_entity) Then
call TaxCredit(.008)
l & On
call WritetoFile("Calculating tax credit for " &pov_entity)
End IF
n a e
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 31
Lesson 6 Creating Arrays and Loops
Solutions
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
32 Hyperion Financial Management 9.3.1: Create Rules
7 Managing Financial Management Data
Solutions
c l
For i = LBound(Round_List) To UBound(Round_List)
r a
HS.Exp "A#" &Round_List(i)& " = A#" &Round_List(i)& ".S#Actual"
Next
'Disable rounding
O ly
HS.NoRound
End Sub
l & On
n a e
Sub Calculate
e r s
'Place this at the end of Sub calculate because you want
t U
'other rules to be run before the values are copied.
I n
If pov_scenario = "Rounded" Then
call Rounding()
End If
c l e
r a
End Sub
O
Hyperion Financial Management 9.3.1: Create Rules 33
Lesson 7 Managing Financial Management Data
Solutions
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
34 Hyperion Financial Management 9.3.1: Create Rules
8 Working with Dimension Hierarchies
Solutions
m y
Solution 8.3 Setting Opening Balances d e
Sub Calculate c a
'Call the Opening procedure to set opening balances
e A
End Sub
c l
call Opening("C1#Opening", "C1#Closing", pov_scenario)
r a
Sub Opening(sPOVDest, sPOVSource, vScenario)
O ly
If Not ( HS.Year.IsFirst And HS.Period.IsFirst) Then
l & On
If vScenario <> "Rounded" Then
HS.Exp sPOVDest &" = "& sPOVSource & ".P#Prior"
End If
n a e
End If
End Sub
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 35
Lesson 8 Working with Dimension Hierarchies
Solutions
Solution 8.4 Creating an Allocation (Optional)
Sub Allocate
pov_entity=HS.Entity.Member
vIsBase=HS.Entity.IsBase("","")
vAlloc=HS.Entity.UD2(pov_entity)
Call WritetoFile("Allocation sub procedure stated for " &pov_entity)
If vISBase Then
'Store the list of overhead members in an array
aOvers=HS.Custom2.List("Overheads","[Base]")
'Loop through the array of products
For Each Item In aOvers
'Write the product being processed to the log file
Call WritetoFile("Processing " &Item)
'Determine the parent
Select Case vAlloc
Case "CA_ALLOC"
'Divide parent headcount by child headcount
'to get the allocation percentage
vPct=HS.GetCell("A#Employee"
&ALL_NONES)/HS.GetCell("E#California.A#Employee" &ALL_NONES)
'Multiply the unallocated amount by the allocation percentage
HS.Exp "A#Overheads.C1#Allocated.C2#" &Item& _
"=E#1000.A#Overheads.C1#UnAlloc *" &vPct
m y
call WritetoFile("Allocated "&vPct& "for: " &Item)
Case "CT_ALLOC"
d e
vPct=HS.GetCell("A#Employee"
&ALL_NONES)/HS.GetCell("E#Connecticut.A#Employee" &ALL_NONES)c a
HS.Exp "A#Overheads.C1#Allocated.C2#" &Item& _
e A
c l
"=E#1100.A#Overheads.C1#UnAlloc *" &vPct
call WritetoFile("Allocated "&vPct& "for: " &Item)
Case "MA_ALLOC"
r a
vPct=HS.GetCell("A#Employee"
O ly
&ALL_NONES)/HS.GetCell("E#Massachusetts.A#Employee" &ALL_NONES)
l & On
HS.Exp "A#Overheads.C1#Allocated.C2#" &Item& _
"=E#1200.A#Overheads.C1#UnAlloc *" &vPct
End Select
n a e
call WritetoFile("Allocated "&vPct& "for: " &Item)
Next
End If
t e r U s
I n
Call WritetoFile("Allocation sub procedure ended for " &pov_entity)
End Sub
c l e
Sub NoInput
r a
HS.NoInput "S#Rounded"
HS.NoInput "A#Discounts.S#Budget"
OHS.NoInput "A#Overheads.C1#Allocated”
End Sub
Sub Calculate
' ********* Currency translation adjustment
'If the current member is a translated currency,
'then update the CTA account with the currency adjustment total
If vIsTrans Then
HS.Exp "A#CTA.C1#Other=A#CapitalEmployed.C1#FX +” & _
“A#Shareholders.C1#FX"
End IF
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Hyperion Financial Management 9.3.1: Create Rules 37
Lesson 10 Creating Consolidation Rules
Solutions
e A
vPlug = HS.Account.PlugAcct(vAcc)
c l
'Call the elimination test function
r a
If CanEliminate(vPlug,vParent,vICP) Then
'Reverse the sign and write data to the Elimination member
O ly
HS.Con "V#[Elimination]", -vPcon, ""
l & On
'Write the data to the plug account
HS.Con "A#" &vPlug& ".V#[Elimination]", vPcon, ""
End If
End If
n a e
Next
End Sub
t e r U s
I n
c l e
r a
O
38 Hyperion Financial Management 9.3.1: Create Rules