Rules

May 15, 2018 | Author: Suresh Kanneganti | Category: Subroutine, Variable (Computer Science), Control Flow, Software Engineering, Software Development
Share Embed Donate


Short Description

Download Rules...

Description

Hyperion Financial Management: Business Rule Writing Tips and Techniques Chris Barbieri Consolidation Practice Director Oracle ACE Ranzal & Associates *With significant content from “JimTheRulesGuy” Heflin  & Geordan Drummond of Ranzal ☺ 

Topics • Basic Basicss of of HFM HFM rul rules es in in clas classi sicc Vbsc Vbscri ript pt • Adva Advanc nced ed top topic icss in in clas classi sicc mod mode e • Debugging • Questions ?

Topics • Basic Basicss of of HFM HFM rul rules es in in clas classi sicc Vbsc Vbscri ript pt • Adva Advanc nced ed top topic icss in in clas classi sicc mod mode e • Debugging • Questions ?

HFM Rules e as cs

“A good rules file is an empty one.” - nonymous

What are we doing with rules in HFM? •Rules primarily move data within the system • Also provide NoInput, Input, ICT intersections

•It’s always a pull* •Pull to all valid intersections on the left hand side of the equation from the intersections on the right

•Always think in 12 dimensions that comprise the point of view. •* Except in consolidation rules, Sub Allocate, and ImpactStatus… •Don’t focus on the vbscript •Do focus on “where

can we read from and where can we write to?”

HFM Rules 101: There are two main functions

• The HS.Exp function is used to write data to the database = • The HS.GetCell function is used to retrieve data from the database A variable = data from HFM

Tip 1: Know what dimensions ar on each side of the equ On the left hand side:

On the right hand sid

• The current point of view is set, these dimensions cannot be specified: –

Scenario



Year



er o



Entity



Value

• These can be specified –

Account



ICP Cu

1-4 c

be

ified.

•  Any of the 12 dime can be specified.

Example: Invalid H

• Rollforward beginning retained earnings

HS.Exp “A#BegRetainedEarnings.P#January  _

“= A#EndRetEarn.Y#Prior.P#December” & _

“+ A#NetIncome.Y#Prior.P#December.W#YTD

Tip 2: Data is written to the b level elements of a dimens

In the following dimensions you can only write to a base level elements elements: –  – – – –

Account Custom1 Custom2 Custom3

Tip 3: Implicit vs. Explicit Intersections

• Dimensions not explicitly on the right hand side of an equation are implicitly lifted from the left hand side and/or the POV. • Very important to explicitly define what is on the left and right hand side of an equation. Don’t leave rules to guesswork – be explicit!

The left hand drives the equation HS.Exp “A#Account3.C1#Chips = A#Account4” HS.Exp “A#Account3.C1#Olap = A#Account4”

The same formula reversed HS.Exp "A#Account3 = A#Account4.C1#Chips" HS.Exp "A#Account3 = A#Account4.C1#Olap"

Last one in wins!

Tip 4: A statement will run for all  valid intersections of data. • This is often not the desired result • For Example an account “Account1” has 8 valid base members in Custom1 HS.Exp “A#Account1 = 10”

• What will the total value of Account1 be for Custom1?

Results in “10” in every valid intersection

Tip 6: If you can not specify a dimension on left hand side of the equation, then control when the statements are run.

If HS.Period.IsFirst = True Then HS.Exp “A#BegRetainedEarnings” & _ “= A#EndRetEarn.Y#Prior.P#Last” & _ “+ A#NetIncome.Y#Prior.P#Last.W#YTD” End If

Yes - The system knows what comes prior to period 1 If HS.Period.IsFirst = True Then HS.Exp "A#Account1 = A#Account2.P#Prior" & _ "+ A#Account3.P#Prior.W#YTD" End If







Enterprise • … but the system does “know” the sequence of the year dimension • Note: You can get in trouble if you run this rule on the first year in the system!

Tip 7: What will be the result?

HS.Exp "A#Account1 = A#Account2” & _ “ * (A#Account3 / A#Account4 )"

Nothing – but be careful • The HS.Exp function itself seems to take division by zero into consideration and will just yield nothing. • It did not write a zero if there was data in the est nat on ce … t not wr te anyt ng • If you use a GetCell or regular VB code… SomeVariable = HS.GetCell "A#Account2” & _ “ * (Variable1/  AVariableWithValueZero)“  AVariableWithValueZero

• This will fail with a division by 0 error

Tip 8: The [None] • The [None] entity does not have a currency • Rules will assume you want to read data from t same value dimension member you are in • [None] is the only valid value If HS.Entity.Member

= "Child2" Then

HS.Exp "A#Account2 = E#[None].  V#[None].  V#[None].A#Acc End If

Tip 9: Don’t fill the database with 0’s

• Be careful when writing to the database that you are not pushing 0’s into the database • A zero is data – which is not the same as nothin . What do you think will happen when you run a “Consolidate all with Data”? • This has a negative effect on performance • This can very quickly bloat the database size

HS.Exp – Pushing Zeros HS.Exp "A#Account3.C1#Chips = A#Account4.C1#Chips * 1.1" HS.Exp “A#Account3.C1#Computers = A#Account4 “ & _ “.C1#Computers * 1.1”

Before

After

HS.Exp - Pushing Zeros part 2 SomeVariable = HS.GetCell("A#Account4.C1#Computers") * 1.1 HS.Exp "A#Account3.C1#Computers = " & SomeVariable

Before

After

HS.Exp – Pushing Zeros Part 3

SomeVariable = HS.GetCell("A#Account4.C1#Computers") * 1.1

If SomeVariable 0 Then HS.Exp "A#Account3.C1#Computers = " & SomeVariable End If

HS.Exp – Pushing Zeros Part 4 You can use the GetCellNoData function. This function is like the GetCell function but as an added bonus it populates a Boolean variable to let you know if function is returning data SomeVariable = HS.GetCellNoData(“A#Account4.C1#Chips”, IsEmpty) * 1.1 If IsEmpty = False Then HS.Exp "A#Account3.C1#Chips = " & SomeVariable End If

HFM Rules vance

op cs an

e ugg ng

The thrills and excitement of working in the Value dimension !

AKA: If you’re not afraid….. you will be

The Value Dimension is the key • The Value dimension is the key to Rules • The Value dimension is the key to HFM • It enables:  – Currency Translation  – Intercompany Transactions  – Percentage Consolidation  – Journal Entries at multiple levels

A simple representation of the elements in the value dimension [Contribution Total] [Contribution]

[Contribution Adjs]

[Proportion]

[Elimination]

[Parent]

[Parent Adjs]









Tip 1: The calculate sub procedure may be run several times per entity.

[Contribution Total] [Contribution] [Proportion]

[Contribution Adjs] [Elimination]

[Parent Total] [Parent]

[Parent Adjs]









• Unless restricted, Sub Calculate can run up to eight times per entity • ay acc enta y en up with double or triple the desired value • Even if it’s correct, it simply takes unnecessary time

Specify the Value Dime

If HS.Value.Member = "" Then Some code statements… Else Some code statements… End If

Tip 2: Reading Across the Dim



• • • •

3

1

2



Rules are not run and you can’t write to = "2002" Then variable1 = HS.Entity.List("","CC_Alloc_Ent") Dim i For i = LBound(variable1) To UBound(variable1) If HS.Entity.Member = variable1(i) Then Variable2 = HS.Getcell("A#account123.I#[ICPNone].C1#MfgFixGen.C2#[None].C3#[None].C4# " + . etce " #account123. # one . 1# g ar en. 2# one . 3# one one]")+HS.Getcell("A#account123.I#[ICPNone].C1#ShippgWHGen.C2#[None].C3# ].C4#[None]")+HS.Getcell("A#account123.I#[ICPNone].C1#SellingGen.C2#[None]. one].C4#[None]")+HS.Getcell("A#account123.I#[ICPNone].C1#EnginGen.C2#[Non [None].C4#[None]")+HS.Getcell("A#account123.I#[ICPNone].C1#AdminGen.C2#[N C3#[None].C4#[None]") If Variable2 > 0 Then Call Subprocedure1

Tip 4: Formatting C

Formatting 1: Document • Use comments to say what the code is doing

 – Add any concerns you may have about the code and possible w to break or need for maintenance  – Add your initials and dates to everything you change

• If you don’t document code, it is very difficult for anyon you • Undocumented code is difficult to maintain (modify lat • Your future audience may be you!

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

Formatting 4: Line Continuations A formula may be complex but at least try to be reasonable as to where the line breaks occur.

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

Impact Status for Synchronizing Actual Data with Forecast • Used to notify the Forecast that Actual has been updated  – First, when you’re in the Actual scenario, change the calc status in the Forecast Scenario  – Second, when you’re in the Forecast scenario, set all accounts equal to their respective values from Actual

• Also used for currency restatement scenarios • Performance-wise, this is “expensive” so use wisely and sparingly

Tip 8: Break the Rule file into multiple sub-procedures Advantages: • Each sub procedure will deal with one “set” or rules. – Cash Flow – Allocations – Statistics

• • • • •

You can turn types of rules on and off  Cuts down on repetitive code Helps with debugging Overall code is more readable Calc Manager is designed for this approach

Calling all Sub Routines

Tip 9: Debugging Code • The real mystery is: what are the values of variables while the system is running? • What is the POV when the rule is running? • Did I meet an If..Then condition? • Does my variable contain what I think it should? • You can’t use a VB message box function • Write information to a text file that you can look at after the rules have run.

Writing to a t

Using the WriteToFile Ro



Call WriteToFile(“Text to write out”)



Call WriteToFile(“VariableName = ” & variable conten

Output of the File

• File File outpu outputt is from from the the HFM HFM app app server server’s ’s perspe perspecti ctive ve and and owne owned d by the DCOM user  – Crea Create te a fil file e sha share re for for this this

• This This is a snap snapsh shot ot of the the tex textt outp output ut • I was was just just tryin trying g to see what what data data was was in each each of the the valu value e dimensions at a particular time • The Time Time / Date Date Stamp Stamp is code coded d into into the the output output,, and and is automatic

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

You're Reading a Preview Unlock full access with a free trial.

Download With Free Trial

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF