1. The document discusses various Calc code techniques including rolling forecasts, transposing data, block creation, forecasting with S-curves, cross-cube calculations with @XREF, date calculations, and data export.
2. Specific functions and techniques covered include @AVGRANGE, @CURRMBRRANGE, @XREF, @CREATEBLOCK, and DATAEXPORT for exporting data to files or databases.
3. Examples are provided to illustrate how to implement rolling averages, transpose data between dimensions, create blocks for sparse members, forecast with S-curves, reference data in other cubes, and export results.
2. AGENDA
> Introduction
> Rolling forecasts
> Transposing data from one dimension to another
> Block creation
> Forecasting with S curves
> Cross-cube calculations with XREF
> DataExport
> Useful date calcs
> Design tips
3. ABOUT THE SPEAKER
Ron Moore
> Principal Architect at Alithya
> Over 20 years Essbase consulting and training experience
> Certified in Essbase, Planning and R programming
> Many webcasts and KScope sessions
> 19 Oracle University Quality Awards
Ron.Moore@Alithya.com
4. COMPANY HISTORY
4
2001
Hyperion
Planning
introduced
to the
market (1st
Essbase
embedded
app)
2007
Enhanced
Consolidation
practice with
world class
capabilities
2009
HPCM
introduced
to the
market –
Ranzal
design
review
2010
Established
Strategic
Finance
practice to
complement
our Planning
expertise
2012
Exalytics &
Performance
Testing Lab
Establish
multi
product
focus &
advisory
Proven business analytics leader with a
history of successful implementations
and continuous growth
1996
Ranzal &
Associates
Founded
2004
Acquired by
Edgewater
2016
Deepened
geographic
footprint
and EPM
Cloud
expertise
2015
Developed
Discovery &
Modern
Data
Architecture
Approach
2014
Introduced
Hosting,
Support &
Managed
Services
Offerings
2018
Ranzal &
Alithya join
forces to
form an EPM/
ERP Cloud
Powerhouse
5. ALITHYA OVERVIEW – EPM & ANALYTICS
5
Comprehensive Business Solutions
Our solutions drive improved business performance
through better decision making, strong customer
engagement, and optimized operations
Deep Partnership Drives Customer Value Adaptable Deployment Models
Diverse Client Portfolio & Industry Expertise
RetailEnergy/
Utilities
Team Highlights
Multiple Oracle
ACEs
Seasoned
delivery team
with avg 8 years
serving clients
Experienced
management team
with avg 15 years in
the company
Certified Cloud
Resources
Enterprise Performance
Management (EPM)
Analytics
Financial Services
Technology CPG and
Manufacturing
Healthcare
Outstanding
Achievement
in Big Data
100 Most Promising
Big Data Solutions
Providers
1,000+ Clients 2,000+ Projects20+ Years
Advisory
Services
Implementation
Services
Technical
Services
Hosting &
Support
Training
Services
Intellectual
Property
6. WHAT’S INCLUDED AND WHY
> Frequently used
> Solves an unusual problems (not frequently used?)
> Simplifies otherwise complicated code
> Just plain cool
6
7. BEST PRACTICES
> It works
> It works fast enough
> It keeps working (low maintenance, parameterized)
> Simple is beautiful
> Reuse, recycle
7
9. ROLLING CALCULATIONS
Requires a dynamic range of time periods
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Prev Year 3 4 6 8 9 10 5 5 7 13 9 4
Curr Year 7 3 1 1 6 5 5 - - - - -
One dimensional
Multi-dimensional
requires data crossing 2 or
more dimensions
Marketing Technologies Group | www.mtgny.com
10. A SIMPLE ROLLING CALC
> Syntax
@AVGRANGE ( SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH,
mbrName [, XrangeList]
)
> Example
MAve6 ->Jun = @AVGRANGE(SKIPNONE, “Sales”,Jan: Jun)
This is a hard-coded fixed range of time periods
Marketing Technologies Group | www.mtgny.com
14. MULTI-DIM RANGES: @XRANGE()
Syntax
@MOVAVG (mbrName [, n [, XrangeList]])
@XRANGE (mbrName1, mbrName2)
Example
MAvg6 =@MOVAVG("Sales", 6 );
becomes
MAvg6 =@MOVAVG("Sales",6,
@XRANGE ("2018"->"Jan", "2021"->"Dec"));
Note: The pairs of members in the range must be from the same
dimensions in the same order and you must get the order of the
dimensions right. The last dimension changes fastest.
Marketing Technologies Group | www.mtgny.com
15. @MOVAVG V. @CURRMBRRANGE
@MOVAVG @AVGRANGE with
@CURRMBRRANGE
Offset Trailing only User defined using
startoffset and
endoffset (+ or -)
Missing and zero values Skips #MI values Skip parameters (0,
#MI, None , Both)
Unavailable values (off
end of dimension)
Copy of source data Skips unavailable values
Marketing Technologies Group | www.mtgny.com
19. TRANSPOSE USE CASES
> The alternative is usually to parse out and match member name
text. However, that is cumbersome to code an maintain. And it
requires that you have a sufficient member naming convention.
Application Type Description
Waterfall Allocation Costs were allocated out of one set of BU x Cost Center combinations to
another set. No logical rule. Only a mapping table.
Net Operating Loss Tax
Carryover Forecast
NOL from each loss year is potentially applied over many gain years
Allocations requiring a
from/to structure
Required from/to for visibility and tracking
19
20. CREATE A TRANSPOSE MAP
20
> Create a From/To map that associates the source and
target members
21. CROSSTAB VIEW OF TRANSPOSE MAP
> Here is what the
Transpose map
looks like in
crosstab view
21
22. USE A TRANSPOSE MULTIPLIER MEMBER
22
> Multiply the input
by the multiplier
23. SUM THE RESULTS
> Sum across the from
dimension to gather
results into the “no Fm
BU” member
23
24. ADANTAGES
> Easy to code
> Fast
> Users can easily maintain the mapping
> Does not require coding in the member names
> Extra dimension provides visibility
24
26. THE BLOCK CREATION PROBLEM
> Dense formulas that refer to sparse
members do not create new blocks
> Possible Solutions
> Lock & Send
> DATACOPY
> Make Scenario dense
> Pivot calc to sparse dimension
> SET CREATEBLOCKONEQ
> SET CREATENONMISSINGBLK
> @CREATEBLOCK
Note: Sparse Scenario dimension
Marketing Technologies Group | www.mtgny.com
27. CREATENONMISSINGBLK
SET CREATENONMISSINGBLK ON;
•Evaluates all potential blocks
and stores only those that
contain non-missing results
•Can be VERY slow
•Use FIX to isolate a small
number of potential blocks
Marketing Technologies Group | www.mtgny.com
28. CREATEBLOCKONEQ
SET CREATEBLOCKONEQ ON;
•Controls creation of blocks when
a sparse formula assigns a non-
constant value
•Overrides the Create Blocks on
Equations database setting
Before Calculation After Calculation
Marketing Technologies Group | www.mtgny.com
29. SPARSE MEMBER ON THE LEFT
Instead of…
Fix(“Forecast”)
“Sales” = ….
EndFix
29
Use…
Fix(“Sales”)
“Forecast” = ….
EndFix
• Assumes Accounts is dense and Scenario is sparse
• Fix on level 0 of another small set of blocks
30. @CREATEBLOCK: SPARSE MEMBER
> Sparse member
creates all the
blocks in the scope
of the fix statement
Component Comment
Fix Statement/s Fixes control the blocks that are created
Calc Member Block Use a sparse member to create all the blocks in the scope of the FIX
@CreateBlock parameters Any BU or Dept dim member created all the blocks in the Fix scope. If you use
an upper level member some upper level blocks are created. But that doesn’t
seem useful or necessary.
30
31. @CREATEBLOCK EXAMPLE
31
> Year is usually
sparse
> Calc Member Block is
usually on a dense
member
> @CreateBlock on L0
years creates blocks
for intersections with
(in our example)
actuals
32. BLOCK CREATION METHODS COMPARED
Method Comment
Lock and Send Impractical. Must predict where to send data. Very manual
DataCopy Fast and easy. But it assumes the target is like the source and you might replicate data
where it doesn’t belong.
Use Block Creator member method
Make target dimension dense
e.g. Years
Interferes with proper sparse/dense configuration and optimization
Pivot Calc to a sparse dimension Fast if confined to level 0 calcs.
Can be difficult to use in IF statements with calc member blocks associate with dense
dimensions
SET CREATEBLOCKONEQ Very limited effectiveness
SET CREATENONMISSINGBLK Usually VERY slow.
Ok sometimes in very small FIXES
Remember to turn it off
@CREATEBLOCK Useful in scripts/BRs with dense Calc Member Blocks (very common)
Still assumes target blocks are like the source blocks.
32
34. FORECASTING WITH S CURVES
34
> Forecast growth or market penetration
> Characteristics include a saturation point, a “high growth” and
“takeover” (saddle) points.
35. PENETRATION CURVES
> Simplified S-curve approach
▪ by Juan Carlos Méndez-García http://8020world.com/jcmendez/2007/04/business/modeling-market-adoption-in-excel-with-a-simplified-s-curve/
> Sat - maximum expected penetration
> HG - Year the penetration will be 10% of saturation
> TO - Years after HG the product will reach 90% of saturation
> Penetration =saturation/(1+81^((hypergrowth+takeover/2-year)/takeover))
0.00
200.00
400.00
600.00
800.00
1,000.00
1,200.00
200420042004200420042004200420042004200420042004200520052005200520052005200520052005200520052005200620062006200620062006200620062006200620062006200720072007200720072007200720072007200720072007200820082008200820082008200820082008200820082008200920092009200920092009200920092009200920092009201020102010201020102010201020102010201020102010
Var Sat =1000; /* Upper limit */
Var HG = 20; /* Acceleration saddle point period */
Var TOvr= 30; /* Deceleration saddle point period */
"sales" =sat
/(1+@power(81, (((HG+TOvr/2)-"Period")
/TOvr)));
36. SIMPLE S CURVE EXAMPLE
36
> Declare variables
> Use UDA to identify target
(in our example) Depts
> Forecast sales using S
curve logic
> Simplifications
> Hard coded S Curve
parameters
> Loaded period numbers
38. XREF USE CASES
Use Case Description
Planning cross plan type
references
Built in references between plan types e.g. Revenue and Workforce or Balance Sheet
cubes
HR rates Main cube pulls salary rates and tax rates from lookup cubes
Data validation Dynamically pulls validation targets to compare to local cube values
Overrides Customers missing from discount list receive price from Gen1
38
39. @XREF
> Calculations in target
cube reference data in a
source cube
> Batch or dynamic
> Outline or script
> Resolves differences in
outlines
> Requires Location Aliases
@XREF (locationAlias [, mbrList])
40. CREATE LOCATION ALIAS
> Create on Target DB
> Edit|Location aliases
> Enter Server, App, DB, User,
Password (use “permanent” PW)
> Test and Set
41. SIMPLE @XREF CALCULATION
> If it’s an identical outline (matching member names)
> With no member list
> @XREF returns the matching Point of View
42. USING A MEMBER LIST
> The optional member list can point to a different
Point of View, overriding the implicit member
name match.
Marketing Technologies Group | www.mtgny.com
43. PRECEDENCE IN RESOLVING REFERENCES
1. The member specified in the member list
2. The current target database point of view
3. The generation one member name, that is, the
dimension name
@XREF returns:
Marketing Technologies Group | www.mtgny.com
44. HOW XREF RESOLVES REFERENCES
Marketing Technologies Group | www.mtgny.com
Source DB Passed to Target
dimension & member match
target
matched member names
dimension matches, member is
missing
gen 1 member name
some members of the POV
match, some are missing
matching POV member
names are passed to all
members of target
dimension is missing mbrList member names
45. MISSING DIMENSION
> Target contains an extra dimension
> @XREF returns same data to all members of
missing dimension
Marketing->New York->Budget->Cola
is passed to
Marketing->New York->Budget->Cola for every time period
Marketing Technologies Group | www.mtgny.com
46. MEMBER MISSING
> Target contains an extra member
> @XREF returns Gen1 value
Marketing Technologies Group | www.mtgny.com
47. MAXL FOR @XREF
> Syntax
create location alias aliasname from
sourceapp.sourcedb to targetapp.targetdb at server as
user identified by password
> e.g.
Create location alias xRates from Sample.Rates to
Sample.Basic at ServerName as Admin identified by
password;
Marketing Technologies Group | www.mtgny.com
48. MAXL FOR @XREF
> Syntax
drop location alias app.db.alias;
> E.g.
drop location alias Sample.Basic.xRates;
Marketing Technologies Group | www.mtgny.com
49. OTHER ISSUES
> Create blocks ramifications
> Performance ramifications
> Changes to source data
Marketing Technologies Group | www.mtgny.com
51. CALC MANAGER DATE FUNCTIONS
51
Documentation in CM Designer's Guide
http://docs.oracle.com/cd/E57185_01/CAL
DH/working_with_custom_defined_functio
ns.htm#CALDH-cmgr_mvf_613
Essbase Sample Code site
http://www.oracle.com/technetwork/indexe
s/samplecode/essbase-sample-
522117.html
52. DATE CALCS EXAMPLE USE CASE
Application Use Case Description
Revenue forecasting Revenue forecasting application with about a half dozen
“methods” applied using a UDA. The example is the
“Revenue Per Day” method
52
> Planning dates “internally” formatted as YYYYMMDD and that’s
what an Essbase connection displays
> Substitution variables are YYYYMMDD
> Web Forms and Smart View ad hoc display formatted date based
on Planning Preferences setting.
53. PARTIAL CODE FROM RPD FORECAST
53
NOTE:
VAR RPD; declared at top
of script
55. DATAEXPORT
> Execute export from a calc script/business rule
> Text file, binary file or ODBC to RDBMS
> Can work within a FIX block
> Can work with conditionals
> Useful for exporting a subset of the data
57. DATAEXPORT RELATED COMMANDS
> Other Related Commands
> DATAEXPORT
> DATAEXPORTCOND
> DATAIMPORTBIN
> SET DATAIMPORTIGNORETIMESTAMP
SET DATAEXPORTOPTIONS {
DataExportLevel ALL | LEVEL0 | INPUT;
DataExportDynamicCalc ON | OFF;
DataExportNonExistingBlocks ON | OFF;
DataExportDecimal n;
DataExportPrecision n;
DataExportColFormat ON | OFF;
DataExportColHeader dimensionName;
DataExportDimHeader ON | OFF;
DataExportRelationalFile ON | OFF;
DataExportOverwriteFile ON | OFF;
DataExportDryRun ON | OFF; }
61. CALC MANAGER MODULES
61
> Graphical Designer makes it easy to
visualize the business rule process
> Reusable script components reduce rework
and maintain consistency
> Makes it easier for multiple developers to
work on one business rule
62. SCRIPT/BR V. OUTLINE FORMULA
> Outline formulas are easier to write and generally faster
> Scripts provide more control over the order of operation
> Scripts allow you to FIX on subsets of the database
> Scripts allow more control over optimization
> Business rules have richer prompting and integration with forms
62
63. ANALYTIC (VIEW)DIMENSIONS
63
• A large number would require
many additions and maintenance
for every new addition
• A small number of YTD values
could be added to the accounts
dimension.
• An analytics (view) dimension
automatically provides an
intersection for every account
• A single formula (probably
dynamic) calculates all the YTDs
64. DRIVER BASED OUTLINE DESIGN
> Similar to an analytics
dimension (or use the
analytics dimension)
> A single formula (or
single formula per
method) calculates all
accounts
> Zero maintenance when
new accounts are added
64
65. DRIVER BASED SAMPLE CODE
> Assumes dense analytics
(View) dimension
> Calc member block is on a
dense member for
performance
> Forecasting formulas on
sparse member Forecast
creates blocks while
performing well if limited to
Level 0 blocks
65
66. TIPS
> Test code is very small steps
> Then test again the way it will actually be used
> To debug, simplify as much as possible, then add back complexity one
step at a time.
> Test at level 0 first, then test aggregated data
> To test for block creation, enter a dummy value. Then run the calc.
> Comment liberally( what, why , when)
66
67. Q&A
67
infosolutions@alithya.com
You can email us questions:
Read our blog for insight and
find answers to your questions:
ranzal.blog
Visit our website to find the right
solution and learn how we can
help you:
alithya.com/oracle
68. 16 SPEAKER SESSIONS
68
Visit us at Booth # 113
Monday, 6/24:
• 11:00am – 11:30am (202): Become a RESTful Iron Man with ARC (the Application, Not the Reactor)
• 11:00am - 11:30am (204): Supplemental Data in the Cloud
• 2:15pm - 3:15pm (205): Best Practices for Designing and Building Integrations
• 3:45pm - 4:45pm (611): My Favorite Calc Code
Tuesday, 6/25:
• 8:50am - 9:50am (204): Keys to the Kingdom: Key Concepts to ARCS Application Design
• 10:00am - 11:00am (211): Client Success Story - Oracle FDMEE is the Cloud Data Hub at Legg Mason
• 11:45am - 12:45pm (611): I Can do WHAT with PCMCS? Features and Functions, Business Benefits, and Use Cases
• 2:15pm - 3:15pm (211): EPM Cloud Integration at CareFirst
• 2:15pm - 3:15pm (611): Empowering Users with Analytical MDX
Wednesday, 6/26:
• 10:15am - 11:15am (201): EPRCS: The reporting Swiss Army Knife
• 10:15am - 11:15am (602): Connected Planning Using EPM Cloud at Opus Group
• 11:45am - 12:45pm (211): Case Study: Using EDMCS to Solve Master Data Challenges
• 11:45am - 12:45pm (201): EPM Data Integration Panel
• 11:45am - 12:45pm (6A): Trend-Based Connected Planning at Vitamix
• 3:30pm - 4:30pm (204): A 2020 Vision for EPM Project Management
Thursday, 6/27:
• 9:30am – 11:00am (609): Deep Dive: Financial Close: The Best of Both Worlds - Welcome to the Hybrid Close
69. CONTACT INFORMATION
69
Alithya
1025 Westchester Avenue, Suite 108
White Plains, NY 10604
Tel (914) 253-6600
infosolutions@alithya.com
20 West Kinzie Street
Suite 13046
Chicago, IL 60610
200 Harvard Mill Square
Suite 320
Wakefield, MA 01880
Contact
Title
Mobile
E-mail