Post on 11-Apr-2018
This Document is confidential to TopDown Consulting Inc. (“TopDown”), contains privilegedinformation, and is communicated the Recipient in strict confidence. The Recipient not disclose theinformation contained herein to any third party without TopDown’s prior written consent. The Recipientagrees to use this Document for internal purposes only and to disclose the information containedherein only to those employees, contractors or agents having a need to know such information inconnection with the services. The Recipient requires no intellectual property rights in the informationcontained herein.
EXTREME CALC MANAGER
Ludovic De Paz & Ron MooreJune 26, 2017
Presenters
Ludovic De Paz• Senior Manager, TopDown Consulting• Over 15 years experience delivering
EPM solutions• Ex-Oracle SQL and MS SQLServer
developer• Specializing in Essbase and Planning• Many webcasts and KScope
presentations• Blog: thehyperiondoctor.com• Twitter: @ludodepaz
Ron Moore• Solutions Architect, TopDown
Consulting• Over 20 years experience delivering
EPM solutions to numerous Fortune 1000 clients across more than 20 industry verticals
• Specializing in Essbase and Planning • Many webcasts and KScope
presentations
This Session Is About
• How to take advantage of Calc Manager’s advanced features– Re-usability– Variable tricks
• The debugger, error messages and logs• Custom Defined Templates• Custom Defined Functions
This session Is NOT About
• Basics of Calc Manager• Basics of Business Rules and calc scripts
Working With Variables
Variables
Variable Type Forms BusinessRules
MDX CalcScripts
FDMEE DLR OLU Import Data
MaxL
Run time Prompts N/A YES NO NO NO NO NO NO NOVariablesSubstitutions Variables YES YES YES YES YES YES
Temporary Variables NO YES YES NO NO NO NO NO
User Variables YES YESRTSV YES
User Variables on the Cloud
User Variables on the Cloud
• ‘Business Process’ User Variables
User Variables on the Cloud
• ’Custom’ User Variables
QUICK INTO TO TEMPLATES
Quick intro to Templates
• What is a Template?– A Template is a Rule generator– Where you can add parameters to customize the Template
• When to use Templates?– When a calculation is repeatable– With different parameters
DESIGN-TIME PROMPTS
Design-Time Prompts (DTP)
• What is a Design Time Prompt?– You can enter design-time prompts for graphical custom templates
so that when you use the template to design business rules, you are prompted to enter the correct information.
– Super smart variable that allows for customized Templates, adds a lot of flexibility
• Once you master DTPs– You will only use Templates in your Business Rules– You will develop rules much faster– Your Templates will be much more flexible and re-usable
Design Time Prompts (DTP)
• Types of DTP
STRING DTP
String
String
• Very useful to use for Cross-Dim Members– You can also use the
Cross Dim DTP for that
• Preferred method to Cross-Dimension DTP– Faster to enter text than
select members one by one
StringReference the DTP in your calculation
String
• Let the developer enter the Cross dim to where the rate sits– One Template for
currency Conversion for all apps
String
• Generated Script
CONDITIONS ON DTP
Leveraging DTP Conditions
Leveraging DTP Conditions
• Add a condition on DTP
Leveraging DTP conditions
• 2 scripts:– One with EOM
conversion– One without EOM
conversion
Leveraging DTP conditions
You can also add conditions directly in the script object
Leveraging DTP Conditions
• Leave EOM Rate empty
Leveraging DTP Conditions
BOOLEAN DTP
Boolean DTP
• Create a “true” or “false” type DTP • Very useful to use with conditions to execute one type of
calculation or another– Calculate a percentage based on another account, Sales for
example• Calculate Sales = Sales * %• OR calculate Sales = Sales * (1 + %)
– One Template, 2 different calculations based on a boolean• Use a DTP to determine what type of calculation you want and have
1 Template for all your % needs
Boolean DTP
Boolean DTP
Boolean DTP
• Conditions on DTPs– Add a Condition Object– Check ‘Use Design Time Prompt’
Boolean DTP
DTP DEFAULT VALUES
The Importance of ‘Default Value’
• When you need to modify a Template late in a game
• You don’t want to go over every Rule and update the DTP values– Use Default to seed with
one Value– Change Values only where
needed
DTP RECAP
DTP Recap
• String DTP to enter whatever you need– Cross Dim– Range
• Boolean DTP• Conditions on DTP• Default Value
MORE TIPS
How to quickly update Templates in Rules
How to quickly update Templates in Rules
How to quickly update Templates in Rules
How to quickly update Templates in Rules
Don’t forget to deploy
• You can update a Template and then deploy all rules to push your changes– No need to re-open each rule and save it
• This is why we use Default Values.
RTSV
RunTime Substitution Variables
• Control substitution variables directly in a calc script.• Use wherever substitution variables are allowed.• RTSV has highest precedence.
RTSV Syntax• Syntax
SET RUNTIMESUBVARS{
runtime_substitution_variable [= value] [<RTSV_HINT>rtsv_description</RTSV_HINT>];};
• ExampleSET RUNTIMESUBVARS{FCStartYear ="FY16";FCStartPer = "wk01";};
RTSV Sample Code
New Maxl Grammar – with Runtimesubvars
Execute Calculation Sample.Basic.main with runtimesubvars‘FCStartYear = FY16 ; FCStartPer = wk01”;’;
Batch Code to Prompt for RTSV
set /p FirstFCPer="Enter RTSV For First FC Period in the form "m-p": "echo %FirstFCPer%%ESSBASEPATH%\bin\essmsh.exe RunFC.mxl %FirstFCPer% >TestRTSV.logpauseexit
Dynamic Children
Dynamic Children• Allows users to add /delete
members on the fly using “placeholders”
• Introduced in version 11.1.2.3• Use cases:
– Workforce Planning – users wanted to add employees with different rates, start dates and end dates, but didn’t know how many they would need to add.
– Retail Application – users can add new stores
Steps to Implement Dynamic Children
• Configure parent member to add/delete dynamic children• Create a business rule with a RTP pointed to the parent• Create a menu• Add menu to form
Configure parent to add/delete Dynamic Children
Essbase outline in EAS after
refresh
Create a RTP and a Business Rule
Point RTP to
the parent Use the
RTP in the rule
Enable the rule to create dynamic
members
Validate and Deploy
• Validates with existing member,• New dynamic member “not found”• Deploy
Create Menu and Add to Form
Pick up employee from form
Execute this rule
Execute the Menu
Smart View
• Planning connection
• Essbase connection
What If You Exceed the Allotment
A Refresh adds a new
set of placeholders
Dynamic Children Limitations
• Deletion affects all intersecting members• After delete rule data persists till refresh
Dynamic Children Limitations (continued)
• This feature is not supported with rules launched from SmartView
• Must use the Web version to use it
Custom Defined Functions
CDF Overview
• What is a CDF?– Custom defined functions allow you to perform tasks such as
launching encrypted MaxL scripts and files, copying and exporting data, removing and adding single or double quotes to a text string, comparing two strings, converting a date to the YYYYMMDD format, among other tasks.
• Documentation in CM Designer's Guidehttp://docs.oracle.com/cd/E57185_01/CALDH/working_with_custom_defined_functions.htm#CALDH-cmgr_mvf_613 Oracle • Essbase Sample Code site
http://www.oracle.com/technetwork/indexes/samplecode/essbase-sample-522117.html Conditions, script and formula components
Overview: CDF InventoryOn-prem v11.1.2.4
Custom Defined Functions: Date functions
• @CalcMgrDateDiff:– For retail to calculate number of open days based on Open Date
or Close Date
• Day = 10• Month = 10/31 = 0.32• Week = 10/7 = 1.43• Year = 10/365 = 0.03
Custom Defined Functions: Excel functions
• @CalcMgrExcelWEEKDAY– Extremely useful in the retail world to compare the same weekdays
year over year.– Could be done only in SQL before
• Return Type:– Default: Sunday 1– 1: Sunday 1– 2: Monday 1– 3: Monday 0
• Works well with SmartLists
Custom Defined Functions: String functions
• @CalcMgrConcat– Same as
@CONCATENATE(String1, String2)
Custom Defined Functions: String functions@CalcMgrStartsWith, @CalcMgrEndsWith
Custom Defined Functions: String functions
• @CalcMgrPadText– Poor man’s FDMEE
– Returns Kscope17
Custom Defined Functions: String functions
• @CalcMgrPadText– Poor man’s FDMEE– Returns 17Kscope
MaxL CDFs v11.1.2.4
• Essbase• Calc Manager
Preparation
Step Code Create MaxL Script See example : test.mxls Generate keys essmsh.exe -gk >Keys.txt Generate encrypted token essmsh.exe -ep admin 6659,1253464643 >Token.txt Run essmsh essmsh.exe -D Test.mxls 210999539,1253464643
Code Sample 1
MaxL with RUNJAVA
Syntax:RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLFunctions<LOG FILE> OPTIONAL ex., "logfile=c:/Temp/maxlrule.log" The path should
be accessible from the ESSBASE process.<ASYNCH FLAG> OPTIONAL ex., "true" This means calc engine does not wait for
the completion of the MaxL script. The default is " false"
<ALL OTHER PARAMETERS YOU PASS TO ESSMSH
Example RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLFunctions "logfile=c:/Temp/maxlrule.log" "-D" "c:\\Temp\\maxl.msh" "28567271,1186612387" "893848844082678214004255849650" "4647275840619320283077900267208176084380" "{varAppName}";
From the documentation:
RUNJAVA Simple
MaxL Script Script/Rulespool on to 'c:/Utils/Maxl/MaxlCDF1.log';
Login 'DemoAdmin' 'Password' on 'TDC-EPM';
Create Application MaxLCDF1;Create database MaxLCDF1.Db1;
Exit;
RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLFunctions"logfile=C:\\Utils\\Maxl\\CDF01.log""false""C:\\Utils\\MaxL\\CreateDB1.mxl";
RUNJAVA Pass Parameters
MaxL Script Script/Rulespool on to 'c:/Utils/Maxl/MaxlCDF2.log';
Login $1 $2 on $3;
Create Application MaxLCDF2;Create database MaxlCDF2.Db1;
Exit;
RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLFunctions"logfile=C:\\Utils\\Maxl\\CDF02.log""false""C:\\Utils\\MaxL\\CreateDB2.mxl""DemoAdmin“ /* Pass to $1 */"Password“ /* Pass to $2 */"TDC-EPM“ /* Pass to $3 */;
RUNJAVA Pass Encrypted Login
MaxL Script Script/Rulespool on to 'c:/Utils/Maxl/MaxlCDF4.log';
login $key 332797570090054049118227658370900924450091234422204861330470 $key 23477791811365508690633066304108914167404057541791 on 'TDC-EPM';
Create Application MaxlCDF4;Create database MaxlCDF4.DB4;
Exit;
/************************** Encrypted *********************/RUNJAVA com.hyperion.calcmgr.common.cdf.MaxLFunctions"logfile=C:\\Utils\\Maxl\\CDF04.log""false""-D""C:\\Utils\\MaxL\\CreateDB4.mxls""1851876843,2177682319""715259151072013489500217864961""8310776712445406520134244526119315135140";
Encrypted User Name
Encrypted Password
Private key
More Extreme Calc with Paul Hoch
• Planning Expressions in Calc Manager
• The Planning expression is “getStartYear (Month) of a Scenario. Then use it in a FIX statement.
• Calc Manager will pull the scenario off the page of a form and then auto populates the correct opening period of the scenario and Year.
FIX ([[getStartYear({ScenRTP})]], [[getStartMonth({ScenRTP})]] : "Dec")AGG ("Role");
ENDFIX
More Extreme Calc with Paul Hoch
• Planning Expressions in Calc ManagerFIX([[getStartYear({ScenRTP})]])"BegBalance"(IF("Employee Type" == [[sl_EmployeeType.Consultant]] AND "Employee Status" == [[sl_EmployeeStatus.Active]])
IF("Start Date" > 19000101 )"Max Roll-off Date" = @CalcMgrAddMonths("Start Date", 18 );"Tenure" = @CalcMgrMonthsBetween("Start Date",
@CalcMgrGetCurrentDate());ENDIF
ENDIF)ENDFIX
LogsThe best way to understand what is going on
Reading Logs From Calc Manager
• Execute a rule from CalcManager and go to Log Messages
Downloading Logs from Calc ManagerGo to Actions / Export
Downloading Logs From Calc ManagerOpen the CSV file in Excel or your favorite text editor
More Logs
More Logs
More Logs
Analyze Your rule
Analyzing Your Rule
• What is the benefit?– Capture statistical information
• how long a component took to execute• how many times it was run• values of a member intersection before and after the component was
run– Bummer: the Analyze feature is not available for Member Range,
Member Block, Fixed Loop, or Condition components. But after all, it makes sense: how much time takes a FIX statement?
• When to use Analyze a rule?– If a rules takes a long time to run– Helps identify how long each component takes
Analyzing Your Rule
Analyzing Your Script
• What is the benefit?– Helps identify what takes you the longest in a business rule
execution: the line that has the longest execution time is highlighted in red
– The Properties area displays information about the business rule, such as its name, application, plan type, and the length of time (in milliseconds) that it took to analyze the script.
• When to use Analyze a rule?– Whenever you get the results you want, run an Analyze to see if
you can make it faster.
Analyzing your Script
Using the Debugger
• What is the Debugger?– The Debugger runs the business rule and examines its script line
by line to see how the script executes
• When to use the Debugger?– If a rule validates but does not perform what you are expecting it
to do.
Using the Debugger
• Using breakpoints– You can Add a breakpoint to see the values of all members in a
condition
Using the Debugger
• Using breakpoints– After you are done, you
can move to the next break point
– You can also add Conditions to a breakpoint
© Copyright 2017 TopDown Consulting. All Rights Reserved.
Ludovic De Paz Ron Mooreldepaz@topdownconsulting.com rmoore@topdownconsulting.com