46
Formula and Business Rule Efficiency in OneStream July 29, 2016 Aaron Bolshoun

Finit formula and business rule efficiency in one stream

Embed Size (px)

Citation preview

Page 1: Finit   formula and business rule efficiency in one stream

Formula and Business Rule Efficiency in OneStream

July 29, 2016

Aaron Bolshoun

Page 2: Finit   formula and business rule efficiency in one stream

Finit Services

Slide 2

Full Cycle Implementations

Upgrades

Dedicated Support

Page 3: Finit   formula and business rule efficiency in one stream

The Finit Family

Slide 3

Fully aligned with our clients, not just bottom line $

No debt or external ownership

Work with Finit employees, no subcontractors

Compensationbased on CLIENT SATISFACTION

PRIVATELY OWNED

CLIENT SATISFACTION

NOSUBCONTRACTORS

DEBT FREE

Page 4: Finit   formula and business rule efficiency in one stream

Finit Values

Slide 4

Our values on which we ask you to provide consultant feedback:

• Approach & Collaboration

• Integrity & Honesty

• Client Betterment

• Self Betterment

• Colleague Betterment

• Finit Betterment

• Work Effectiveness

• Impact & Innovation

• Proactiveness & Passion

Service Solutions Betterment

Page 5: Finit   formula and business rule efficiency in one stream

Finit Customer Success

Slide 5

Our values, culture, and approach to becoming a trusted advisor to our

customers has led to

100% customer success

for every Finit client (250+) and for every Hyperion and OneStream project (800+)

Page 6: Finit   formula and business rule efficiency in one stream

Slide 6

Some Finit Customers

Page 7: Finit   formula and business rule efficiency in one stream

Questions

Slide 7

Page 8: Finit   formula and business rule efficiency in one stream

Upcoming OneStream Webinar

Slide 8

Friday August 19th

Creative Solutions for Cash Flow & FX Analysis through Dashboards

Presented by Jay Hampton & Christine Ong-Estrada

Page 9: Finit   formula and business rule efficiency in one stream

About the Presenter

Slide 9

Aaron Bolshoun([email protected])

Certification/Education

• MBA - Business InformationTechnology, University of Denver

• BA - Northwestern University

• HFM Certified

Experience

• 3 years with OneStream

• 10 years with HFM

• 10 years with FDM

• 10 years of EPM / CPM Implementation experience

Page 10: Finit   formula and business rule efficiency in one stream

Agenda

Slide 10

• Formula Efficiency

• Data Buffers

• New Functionality available in 3.7 Release

Page 11: Finit   formula and business rule efficiency in one stream

OneStream XF Formulas

Page 12: Finit   formula and business rule efficiency in one stream

Elements of OneStream that can be Customized

Slide 12

• Member Formulas• Formula Pass

• Dynamic Calc

• Business Rules• Finance

• Parser

• Connector

• Conditional

• Derivative

• Dashboards: Method Queries, SQL Scripts

• Transformation Rules: Complex Expressions

• Confirmation Rules

• Data Cells

• Dashboard Data Set

• Dashboard Extender

• Dashboard XFBR String

• Extensibility

• Event Handler

• Drill-Down

Page 13: Finit   formula and business rule efficiency in one stream

Efficiency

Slide 13

Page 14: Finit   formula and business rule efficiency in one stream

Types of Formula Efficiency

Slide 14

Different Types of Formula “Costs”:

1. Efficient Processing

2. Efficient Maintenance

3. Efficient Storage

4. Efficient Script Creation

Page 15: Finit   formula and business rule efficiency in one stream

Efficient Processing

Slide 15

Preferred Methodology1. Can I do this without any formulas? Is it possible to produce result

via metadata attributes and hierarchy? (Account type and/or Aggregation Weight)

• No impact to processing

2. Can I build this as a Dynamic Calculation?• No impact to consolidation time, but takes time to calculate

in memory when a report is run.

3. Can I build this as a Member Formula (Formula Pass)?• Stored in database, so increases consolidation time,

but no impact to report generation.

4. Can I build this as a Business Rule?• Stored in database, so increases consolidation time,

but no impact to report generation.

Page 16: Finit   formula and business rule efficiency in one stream

Dynamic vs. Stored Calculations

Slide 16

Dynamic Calculation

Formula Pass

Page 17: Finit   formula and business rule efficiency in one stream

Dynamic Calculation vs. Member Formula

Slide 17

Dynamic Calculation

MemberFormula

No Impact Consolidation Time Much Slower

Much Slower Report Generation No Impact

Unnecessary Consolidation Required

Can use Formula Pass or Dynamic Calc in Source

Use with other formulas

Can use Formula Pass in Source

Data must already be consolidated if source contains a Formula Pass

DependenciesMust assign Formula

Pass 1-16 accordingly

Do not aggregate Aggregation Aggregate naturally

Page 18: Finit   formula and business rule efficiency in one stream

Efficient Processing

Slide 18

• From the XF Design and Reference Guide:

“Consolidation performance is directly impacted by the volume and complexity of Stored Calculations. Careful consideration should be given to each Stored Calculation since …. a large amount of data being written to the Cube would negatively impact Consolidation performance …. The quantity of stored numbers is the most important factor when optimizing Consolidation performance.”

Page 19: Finit   formula and business rule efficiency in one stream

Member Formula vs. Business Rule

Slide 19

• Member Formulas will always perform better than Business Rules: Member formulas are multi-threaded (parallel) while Business Rules run sequentially (serial)

• Some logic, like custom Consolidation or Member Lists, must occur within a Business Rule—API vs. BRAPI

Page 20: Finit   formula and business rule efficiency in one stream

Efficient Maintenance

Slide 20

• We need to build all logic with the understanding that we will eventually hand it over to someone else to maintain

• We need to make troubleshooting easier

• Formulas should be as dynamic as possible

• Use Comments!!!!

• HFM vs. OneStream: With great flexibility comes great complexity! Where exactly does that logic reside?• HFM: It’s in the rules file.

• OneStream: • Member Formulas (on Account, Entity, Flow, UD’s, etc.)

• Business Rules

Page 21: Finit   formula and business rule efficiency in one stream

Lists of Formulas by Formula Pass

Slide 21

Grid View

Formula List Dashboard

Page 22: Finit   formula and business rule efficiency in one stream

Formula for Calculation Drill-Down

Slide 22

• Entering a formula in the Formula for Calculation Drill Down property allows drilling on calculated Scenario, Account, Flow and UD members

Page 23: Finit   formula and business rule efficiency in one stream

Efficient Storage

Slide 23

• Storage isn’t free—it has costs associated

• Every Stored Member creates a record which takes up storage space in the database when data is consolidated

• Be Specific: much more efficient to write to one specific member instead of all of them

Page 24: Finit   formula and business rule efficiency in one stream

Efficient Storage: Data Explosion

Slide 24

• OneStream warns upon consolidation about a formula that will cause data explosion:

API.Data.Calculate

• Tips to Avoid Data Explosion• Use same level of detail on target (left side of =) as on the source

(right side of =)

• Do not use #All in Stored Member formulas

Formula Result

“A#Profit = A#Sales” No Data Explosion

“A#Profit:U2#Cust1 = A#Sales * 1.05” No Data Explosion

“A#Profit = A#Sales:U2#Cust1” Some Data Explosion

“A#Profit = 2.0” Large scale data explosion

Page 25: Finit   formula and business rule efficiency in one stream

Efficient Script Creation – Script Editor

Slide 25

• Color Coding:

• VB is blue

• API is black

• Strings are red

• Comments are green

• IntelliSense

• Integrated Script Library with filter:

• No need to “re-invent the wheel” – use existing code as starting point (GolfStream as a reference)

• OneStream Script Editor provides many tools to simplify the process:

Page 26: Finit   formula and business rule efficiency in one stream

Efficient Script Creation – Rule Snippets

Slide 26

• Sample code for common calculations that integrates with Script Editor is available in the XF MarketPlace• Common Account formulas (e.g. Current Ratio)

• Formula for Calc Drill Down

• Writing to Error Log

• Confirmation Rules

• Member Lists

• Eval

• Many more & list

continues to grow!

Page 27: Finit   formula and business rule efficiency in one stream

TroubleShooting & Optimization: Logging

• api.LogMessage(message, detail) and api.LogError(errorLevel, description)

• Consolidate with Logging provides visibility into all calculations that run and how long each one takes

• Entries are logged in Task Activity Log

Slide 27

Page 28: Finit   formula and business rule efficiency in one stream

Consolidate with Logging

Slide 28

Page 29: Finit   formula and business rule efficiency in one stream

Balancing priorities:

Slide 29

1. Efficient Processing

2. Efficient Maintenance

3. Efficient Storage

4. Efficient Script Creation

Page 30: Finit   formula and business rule efficiency in one stream

Data Buffers and Eval Buffers

Slide 30

Page 31: Finit   formula and business rule efficiency in one stream

Data Cell vs. Data Unit vs. Data Buffer

Slide 31

• Data Cell• One number uniquely represented by

a Cube and 18 dimension members

• Data Unit• All data for a single:

Cube, Entity, Parent, Cons, Scenario, Time

• E.g., Calculate one Entity/Period 1 Data Unit

• Data Buffer• A subset of data in a Data Unit

• E.g., A#Salary contains numbers for all Cost Centers

Data UnitDimensions

Account-type Dimensions

Page 32: Finit   formula and business rule efficiency in one stream

Data Unit Concepts

Slide 32

Stored Formulas run for an entire Data Unit

Cube and 5 Data Unit dims are known Valid: If api.Pov.Entity.Name.XFEqualsIgnoreCase(“CO”) Then

Account-type dims can be anything Not Valid: If api.Pov.Account.Name … or If api.Pov.UD1.Name …

Conditional logic requires Eval

Avoid using api.Data.Calculate in a loop (performance)

APIs api.Data.Calculate (easiest to use)

Eval (most flexibility)

api.Data.GetDataBuffer (legacy cell-level processing)

Page 33: Finit   formula and business rule efficiency in one stream

Eval Buffer Example

Slide 33

• api.Data.Calculate("A#Bonus = A#Salary * Eval(A#BonusLevel)", AddressOf OnEvalDataBuffer) • Bonus by Cost Center using BonusLevel and Eval

• Order of Operations• A#Salary – Data Buffer is retrieved from storage

• A#BonusLevel – Data Buffer is retrieved from storage

• Eval evaluates and modifies the BonusLevel Data Buffer

• Data Buffer Math creates a new Data Buffer

• A#Bonus - The new Data Buffer is stored

Page 34: Finit   formula and business rule efficiency in one stream

Eval Buffer Example - Formula

Slide 34

Page 35: Finit   formula and business rule efficiency in one stream

Eval Filtering – Method 1

Slide 35

• Filter using api.Data.Calculate:

• Syntax: api.Data.Calculate(formula, accountFilter, flowFilter, originFilter, icFilter, ud1Filter, ud2Filter, ud3Filter, ud4Filter, ud5Filter, ud6Filter, ud7Filter, ud8Filter, onEvalDataBuffer, userState)

• For example:

api.Data.Calculate("A#Bonus = A#Salary * 0.05", "", "", "", "", "U1#Selling.Base, U1#Eng")

Page 36: Finit   formula and business rule efficiency in one stream

Eval Filtering – Method 2

Slide 36

• Eval Filters the new Data Buffer:

• For example:

api.Data.Calculate("A#Bonus = Eval(A#Salary * 0.05)”, AddressOf OnEvalDataBufferFilter)

• Generates the same result as Method 1

Page 37: Finit   formula and business rule efficiency in one stream

Eval Filtering – Method 2 Formula

Slide 37

Page 38: Finit   formula and business rule efficiency in one stream

New Functionalityin Version 3.7

Slide 38

Page 39: Finit   formula and business rule efficiency in one stream

Convert Unbalanced

Slide 39

• AddUnbalanced, SubtractUnbalanced, MultiplyUnbalanced, and DivideUnbalanced

• Used to avoid data explosion when varying level of Account-Type dimensions are required in a formula

• Valid:

api.Data.Calculate("A#6050 = A#5000 * A#3000")

• Bad Idea:api.Data.Calculate("A#6050 = A#5000 * A#3000:O#Top")

api.Data.Calculate("A#6050:O#All = A#5000:O#All * A#3000:O#Top")

Page 40: Finit   formula and business rule efficiency in one stream

Convert Unbalanced

Slide 40

• Instead, use new Convert Unbalanced functions:

api.Data.Calculate("A#6050 = MultiplyUnbalanced(A#5000, A#3000:O#Top,

O#Top)")

• First two parameters are Data Buffers to be multiplied (or added or subtracted or divided)

• Third parameter is the Account Type dimension member that will always be used with first parameter, without causing data explosion.

Page 41: Finit   formula and business rule efficiency in one stream

Get Data Buffer Using Formula

Slide 41

• Allows use of an entire math function to calculate a final data buffer:

• Syntax: Dim objDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula(formula, scriptMethodType, changeIdsToCommonIfNotUsingAll, expressionDestinationInfo, onEvalDataBuffer, userState)

• For example:

Dim myDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula("A#Sales – A#Costs")

Page 42: Finit   formula and business rule efficiency in one stream

Get Data Buffer Using Formula Variables

Slide 42

• After creating a data buffer variable, it can be named as a Formula Variable and then reference inside api.Data.Calculateor inside other calls to api.Data.GetDataBufferUsingFormula.

• This provides a lot of flexibility and it can even improve performance because you can calculate a data buffer once and re-use the variable multiple times instead of recreating it.

• For example:

Dim myDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula("A#Sales – A#Costs")

api.Data.FormulaVariables.SetDataBufferVariable("myDataBuffer", myDataBuffer, False)

api.Data.Calculate("A#Profit = A#5000 + $myDataBuffer")

Page 43: Finit   formula and business rule efficiency in one stream

Get Member Names from ID’s

Slide 43

• Allows identification of Member Names when looping:

• For example:

For Each sourceCell As DataBufferCell In myDataBuffer.DataBufferCells.Values

Dim accountName As String = sourceCell.DataBufferCellPk.GetAccountName(api)

Dim ud1Name As String = sourceCell.DataBufferCellPk.GetUD1Name(api)

Next

Page 44: Finit   formula and business rule efficiency in one stream

Log Contents of Data Buffer

Slide 44

• Allows logging of Data Buffer contents for Debugging

• Third parameter indicates number of records to be logged.

• For example:myDataBuffer.LogDataBuffer(api, "MyDataBuffer Output", 1000)

Page 45: Finit   formula and business rule efficiency in one stream

Slide 45

Questions?

Page 46: Finit   formula and business rule efficiency in one stream

Thank You for Attending!

Slide 46

Today’s Presenter:

Aaron Bolshoun

[email protected]

General Questions:

Greg Barrett

[email protected]

Copy of the slides or Recording:

Email us for a copy of the slides or a link to the recording

[email protected]

Past webinars:

www.finit.com/webinars

Follow us on Twitter for updates:

@Finit_Solutions