You are on page 1of 23

http://learnhyperion.wordpress.

com

Hyperion 11.1.1.3 Rules


Student Guide

Provided By: BISP Created By: Rupam Majumdar


http://bispsolutions.wordpress.com SME - Hyperion
bisp.consulting@gmail.com Reviewed By: Amit Sharma
http://learnhyperion.wordpress.com BISP Team

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 1
http://learnhyperion.wordpress.com

Rules Introduction

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

We use Financial Management rules to perform calculations that cannot be


defined through the parent-child relationships of 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.

Business rules are script that used in Hyperion Financial Management.


Set of instructions are written using Visual basics syntax and we use a Object
Model.

There are eight types of rules in Financial Management:


 Calculate
 Dynamic
 Allocation
 Input
 No Input
 Translate
 Consolidate
 Transactions

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 2
http://learnhyperion.wordpress.com

 Describing Objects and Functions


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.
When you write rules, you use dot notation (dot) to separate objects
from other objects and functions.

Objects represent elements of a Financial Management application, such as


dimensions.
 Functions represent actions that a rule can perform, such as retrieving a
value.
 You write rules statement by applying functions to objects.
 Not all functions are valid for all objects.

HS.Entity.DefCurrency : This statement uses the DefCurrency function to


retrieve the default currency of an entity.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 3
http://learnhyperion.wordpress.com

WHERE AS IN CONTRAST

HS.Scenario.DefCurrency The DefCurrency function is invalid here because


scenarios do not have currencies.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 4
http://learnhyperion.wordpress.com

The following table lists the functions by object for Financial Management rules:

HS

AppSettings

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 5
http://learnhyperion.wordpress.com

Account

Currency

Data Unit

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 6
http://learnhyperion.wordpress.com

Custom 1 to 4

Entity

ICP

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 7
http://learnhyperion.wordpress.com

NODE

Parent

Period

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 8
http://learnhyperion.wordpress.com

Scenario

Value

View

Year

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 9
http://learnhyperion.wordpress.com

Creating Rules Expressions


You create rules expressions by using Financial Management objects and
functions to perform these types of tasks:

• Calculating data
• Consolidating data
• Setting accounts to read-only

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.

Use this syntax:


HS.Exp “DestinationValue = SourceValue”
The following example sets the GrossMargin account to 50,000 on calculate()

Account Expressions
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:

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 10
http://learnhyperion.wordpress.com

Dimension Keywords
The following table lists the dimension keywords that you can use to specify
dimension members:

Keyword Dimension

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

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.

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.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 11
http://learnhyperion.wordpress.com

Adding Operators and Functions

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 2010 by the rate in the StateRate account for 2010:

HS.Exp "A#StateTax = A#Sales.Y#2005 * A#StateRate.Y#2005"

Period and Year Keywords


To create dynamic rules, you can use the following keywords, instead of
member names, to represent members of the destination Year or Period
dimension:
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"

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 12
http://learnhyperion.wordpress.com

Notice that the Regional string is not enclosed in quotation marks.

Keyword Description
Cur :Current period or year
First :First period or year that is valid for the application
Last :Last period or year that is valid for the application
Next :Period or year that follows the current period or year
Prior :Period or year that precedes the current period or year

Placing Other Functions Within Exp


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:

HS.Exp "A#SalesAlloc = A#Sales/HS.Entity.NumBase(Regional)"

Identifying Rule Types


Rules fall into eight types:
• Calculate rules are executed when you perform calculations and
consolidations. You use calculate rules for these tasks:
- Set and clear values from accounts

SET :HS.Exp "A#MiscPast = A#Misc.P#Cur-2"


CLEAR :HS.Clear "A#ALL"

- Perform ad hoc calculations


- Conform to statutory requirements

• 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.
• Translate rules execute when you perform translations. These rules can
override default translation calculations.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 13
http://learnhyperion.wordpress.com

• Allocation rules execute when you allocate data from a single source to
multiple destinations.
• Input rules enable input at the parent entity level.
• No input rules prevent input at the base entity, account, and custom level.
• Consolidate rules perform nonstandard consolidations. These rules are most
commonly found in statutory applications.
• Transactions rules enable posting to accounts and scenarios from the
Intercompany Transactions module.

Identifying Sub Procedures


Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 14
http://learnhyperion.wordpress.com

A Sub procedure is a series of VBScript statements (enclosed by Sub and End


Sub statements) that performs actions but does not return a value.

A Sub procedure can take arguments (constants, variables, or expressions


passed by a calling procedure). If a Sub procedure has no arguments, its Sub
statement must include an empty set of parentheses ().
Rules of each type are grouped into Sub procedures in the rules file. Rules
statements are grouped into the following procedures:

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 Translate( )
<All translate rules are displayed here.>
End Sub

Sub Allocate( )
<All allocation rules are displayed here.>
End Sub

Sub NoInput( )

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 15
http://learnhyperion.wordpress.com

<All no input rules are displayed here.>


End Sub

Sub Consolidate( )
<All consolidation rules are displayed here.>
End Sub

Sub Input
<All input rules are displayed here.>
End Sub

Sub Dynamic( )
<All dynamic rules are displayed here.>
End Sub

Sub Transactions( )
<All translation rules are displayed here.>
End Sub
Inserting Line Continuations
Line Continuation:
 Uses an ampersand (&) for concatenation
 Uses an underscore (_) for line continuation
Note: You must have a space between the ampersand and the underscore.

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.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 16
http://learnhyperion.wordpress.com

Adding Comments to Rules

Documentation in Financial Management rules files is considered almost as


important as the code itself. Without documentation, administrators have a
difficult time interpreting and troubleshooting another administrator’s
procedures. Even if you are the only one maintaining the rules files, without
proper documentation you can easily forget the intent of the procedure.

Text preceded with an single quote(‘) is interpreted as a comment. Although


you can start comments anywhere within a line, it is recommended that you
place a comment on its own line. This ensures that the line is properly
validated.

This is an example of inserting comments in your rules files:

Creating Conditional Statements


You can control the flow of your script with conditional statements. You can
write VBScript that makes decisions and repeats actions.
The following condition statements are used in rules files:

 If…Then…Else
 Select Case…Else

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 17
http://learnhyperion.wordpress.com

Applying the If…Then…Else Statement


The most common form of the If...Then...Else statement is the block form
which allows for several lines of code to be executed or several comparisons
to be made, within the one statement.
Like Following example will run if and only if the Scenario is Budget
• This example verifies whether the scenario member is equal to Budget. If
equal (true), a calculation multiplies Units Sold by Price, and the result is
applied to the Sales account. If the condition evaluates to false, no calculation
is performed.

Uses ElseIf to test for more than one condition

The example applies the ElseIf statement if the scenario member is equal to
Actual instead of Budget. If equal (true), a calculation divides Sales by
UnitsSold and applies the result to Price. If the scenario is any member other
than actual or budget, the calculation following the Else statement is
performed.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 18
http://learnhyperion.wordpress.com

Applying If...Then...Else Statements

The If...Then...Else statement allows several lines of code to be executed or


several comparisons to be made within the one statement.
You use the If...Then...Else statement to evaluate whether a condition is true or
false and, depending on the result, to specify one or more statements to run.
The condition is typically an expression that uses a comparison operator to
compare one value or variable with another. You can nest If...Then...Else
statements to as many levels as needed.

• Use and ElseIf...Then statement to add conditions.


• 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.
• If you include an Else statement, the lines of script after the Else statement
execute if none of the condition are met.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 19
http://learnhyperion.wordpress.com

Making Decisions with Select Case Statements


The Select Case structure provides an alternative to If...Then...ElseIf for
selectively executing one block of statements from among multiple blocks of
statements. A Select Case statement provides capability similar to the
If...Then...Else statement, but makes code more efficient and readable when
there are a large number of conditions to evaluate. The first Case statement
that evaluates to true is executed. Any Case statements that follow are not
evaluated or executed.

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.
If there is a match, the block of statements associated with that Case is
executed, as in the following example.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 20
http://learnhyperion.wordpress.com

Comparing Strings in Financial Management


String comparisons are important in Financial Management for these reasons:
1. To avoid simple errors in uppercase or lowercase strings when conditional
statements are used.
For example, the string 'Budget' is used as the dimension member, but you
enter 'budget' for the comparison (one uses an upper case ‘B’ and the second
one uses a lower case ‘b’). With string comparison, if you always type
lowercase and then convert variables and function results to lowercase you
will not have mismatches.
2. You can use string comparisons to check for one or more characters that
use a prefix or suffix in member names. This is useful for chart of accounts or
entity structures that use coding in labels.
For example, You use a product dimension and all hardware product member
labels start with H100. You can create a string comparison to check the first 4
characters of the member label and if it equals H100 then do the calculation.

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.

Syntax
LCase(String)

Example
If LCase(HS.Scenario.Member)=”actual” Then

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 21
http://learnhyperion.wordpress.com

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:
• Use String to return the requested values.
• Use Length (numeric value) to determine the number of characters to
return.

Syntax
Left(String,Length)

Example

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.

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 22
http://learnhyperion.wordpress.com

Syntax
Right(String,Length)

Example

Hyperion Rules Student Guide || BISP || Amit Sharma || Created by : Rupam Majumdar Page 23

You might also like