## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

© 2002 Hyperion Solutions Corporation. All rights reserved. Hyperion, Essbase, Hyperion Analyst, Hyperion Enterprise, Hyperion Pillar and Hyperion Reporting are registered trademarks of Hyperion Solutions Corporation. Hyperion Solutions, the Hyperion “H” logo, what’s going on, Hyperion Activity Based Management, Hyperion Allocations Manager, Hyperion Analyzer, Hyperion Application Link, Hyperion Customer Interaction Center, Hyperion Enterprise Reporting, Hyperion Financial Management, Hyperion Integration Server, Hyperion Objects, Hyperion Performance Scorecard, Hyperion Planning, Hyperion Reports, Hyperion Sessionizer, Hyperion Spreadsheet Add-in, Hyperion Spreadsheet Toolkit and Hyperion Web Site Analysis are trademarks of Hyperion Solutions Corporation. All other trademarks and company names mentioned are the property of their respective owners. Microsoft is a registered trademark and Windows is a trademark of Microsoft Corporation. IBM, DB2, Lotus, and 1-2-3 are registered trademarks of International Business Machines Corporation. All other brand and product names are trademarks or registered trademarks of their respective holders. No portion of this manual may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or information storage and retrieval systems, for any purpose other than the purchaser’s personal use, without the express written permission of Hyperion Solutions Corporation. Notice: The information contained in this document is subject to change without notice. Hyperion Solutions Corporation shall not be liable for errors contained herein or consequential damages in connection with the furnishing, performance, or use of this material. Hyperion Solutions Corporation 1344 Crossman Avenue Sunnyvale, CA 94089 Hyperion Essbase XTD Calc Scripts / 6.5.1 / 10.18.02

Table of Contents

Preface ......................................................................................................... i

Welcome to Hyperion® Essbase® XTD Calc Script Training! ....................................................... i Course Structure.................................................................................................................................... i What is in the Manual .................................................................................................................... i Conventions ..........................................................................................................................................ii

1 Introduction .......................................................................................... 1-1

Learning Essbase ...............................................................................................................................1-2 Syntax ...........................................................................................................................................1-2 Concepts.......................................................................................................................................1-2 Usage ............................................................................................................................................1-2 Techniques ...................................................................................................................................1-2 Optimization ...............................................................................................................................1-2 Creativity .....................................................................................................................................1-3 Class Overview..................................................................................................................................1-3 Reviewing calculation architecture ..........................................................................................1-3 Building calc scripts ...................................................................................................................1-3 Using calc scripts ........................................................................................................................1-3 Exercise 1-1 – Hook, Line and Sinker Company ..........................................................................1-4 Building an OLAP system .........................................................................................................1-4 Unit Summary ...................................................................................................................................1-5

2 Calculation Architecture ..................................................................... 2-1

Types of Calculation .........................................................................................................................2-2 Outline calculations....................................................................................................................2-2 Calc scripts...................................................................................................................................2-2 Outline Calculations .........................................................................................................................2-3 Default Calculation ...........................................................................................................................2-4 Default Calculation Characteristics ................................................................................................2-8 Minimizes Physical Passes Through the Database ................................................................2-8 Allows Users with Access to Specific Calc Scripts to Run the Default Calc ......................2-8 Calc Script Calculations....................................................................................................................2-9 Contents of calc scripts ..............................................................................................................2-9 Reasons for calc scripts ..............................................................................................................2-9 Functions and commands that work only in scripts .............................................................2-9 Calculation Order............................................................................................................................2-10 Data storage ...............................................................................................................................2-10 Dimension types .......................................................................................................................2-10 Dense and Sparse Dimensions ......................................................................................................2-10

T

Table of Contents

Hyperion Essbase Calc Scripts

Dense dimensions.....................................................................................................................2-10 Sparse dimensions ....................................................................................................................2-10 Dimension tags..........................................................................................................................2-10 Block and Index Structure..............................................................................................................2-11 Generations and Levels ..................................................................................................................2-12 Block Types ......................................................................................................................................2-13 Input blocks ...............................................................................................................................2-13 Non-input blocks ......................................................................................................................2-13 Level zero blocks.......................................................................................................................2-13 Upper-level blocks....................................................................................................................2-13 Calculation Order............................................................................................................................2-14 Dense Calculations..........................................................................................................................2-14 Sparse Calculations .........................................................................................................................2-15 Calculation Order: Dense Dimensions.........................................................................................2-16 Calculation Order: Sparse Dimensions ........................................................................................2-17 Calculation Order: Dynamic Calc Versus Batch .........................................................................2-18 Calculation order exceptions .........................................................................................................2-19 Two-Pass Calculation .....................................................................................................................2-21 Calculation passes ....................................................................................................................2-21 Exercise 2-1: Review Class Files ....................................................................................................2-22 Unit Summary .................................................................................................................................2-24

**3 Calculation Script Environment ......................................................... 3-1
**

Introducing Calc Scripts ...................................................................................................................3-2 Components of calc scripts........................................................................................................3-2 Calc Script Editor and online Help ..........................................................................................3-2 Commands and functions .........................................................................................................3-3 Using Calc Script Editor ...................................................................................................................3-4 Calc Script Editor ........................................................................................................................3-5 Associating an Essbase Outline ................................................................................................3-5 Inserting Functions (Using the Function Button) ..................................................................3-6 Checking the Syntax and Saving and Running the Calc Script ...........................................3-7 Using Essbase Documentation ......................................................................................................3-10 Inserting Functions (From on-line Help) ..............................................................................3-11 Exercise 3-1: Explore Calc Script Editor and Online Help ........................................................3-12 Reviewing Essbase Data Using Spreadsheet Add-in.................................................................3-14 Exercise Procedures..................................................................................................................3-14 Exercise 3-2: Running Calc Scripts................................................................................................3-16 Calc Script Basics.............................................................................................................................3-18 Member Calculations ...............................................................................................................3-18

2

Hyperion

Hyperion Essbase Calc Scripts

Table of Contents

T

Arithmetic Operators ...............................................................................................................3-19 Adding In-line Documentation ..............................................................................................3-20 Introduction to Calc Script Commands and Functions .............................................................3-21 Calc Script Command Categories ..........................................................................................3-21 Essbase Functions Categories .................................................................................................3-22 Exercise 3-3: Member Calculations and Mathematical Operators ...........................................3-28 Unit Summary .................................................................................................................................3-31

**4 Calculation Script Commands............................................................ 4-1
**

Calc Member Blocks..........................................................................................................................4-2 Focusing Calculations.......................................................................................................................4-3 Focusing Calculations Using Fix...Endfix ...............................................................................4-3 Focusing Calculations Using Conditional Statements ..........................................................4-3 Focusing Calculations Using the Cross-Dimensional Operator ..........................................4-3 Calc Script Commands .....................................................................................................................4-4 Summary of Calc Script Commands ..............................................................................................4-4 Detailed Description of Calc Script Commands ...........................................................................4-6 & ....................................................................................................................................................4-6 AGG ..............................................................................................................................................4-7 ARRAY .........................................................................................................................................4-8 CALC ............................................................................................................................................4-9 CALC ALL .................................................................................................................................4-10 CALC DIM.................................................................................................................................4-11 CALC (others) ...........................................................................................................................4-13 CCONV ......................................................................................................................................4-14 CLEARBLOCK ..........................................................................................................................4-15 CLEARDATA ............................................................................................................................4-16 DATACOPY ..............................................................................................................................4-17 FIX / ENDFIX ...........................................................................................................................4-18 IF / ELSE / ELSEIF / ENDIF .................................................................................................4-19 LOOP/ENDLOOP....................................................................................................................4-22 SET ..............................................................................................................................................4-24 SET AGGMISSG........................................................................................................................4-25 SET CACHE...............................................................................................................................4-26 SET CALCHASHTBL...............................................................................................................4-27 SET CALCPARALLEL .............................................................................................................4-28 SET CALCTASKDIMS .............................................................................................................4-30 SET CLEARUPDATESTATUS................................................................................................4-32 SET FRMLBOTTOMUP ...........................................................................................................4-34 SET LOCKBLOCK ....................................................................................................................4-35

3

Hyperion

T

Table of Contents

Hyperion Essbase Calc Scripts

SET MSG ....................................................................................................................................4-36 SET NOTICE..............................................................................................................................4-37 SET UPDATECALC .................................................................................................................4-39 SET UPTOLOCAL ....................................................................................................................4-40 VAR.............................................................................................................................................4-41 Exercise 4-1: Focus Calculations using Fix / EndFix .................................................................4-42 Exercise 4-2: Focus Calculations using If / Else / Endif ...........................................................4-43 Exercise 4-3: Focus Calculations using Cross-Dimensional Operators ...................................4-44 Unit Summary ...........................................................................................................................4-45

5 Math Functions .................................................................................... 5-1

Transforming Values with Math Functions ..................................................................................5-2 Math Function Parameters...............................................................................................................5-3 Summary of Math Functions ...........................................................................................................5-3 Detailed Description of Math Functions........................................................................................5-5 @ABS.............................................................................................................................................5-5 @AVG ...........................................................................................................................................5-6 @EXP.............................................................................................................................................5-7 @FACTORIAL.............................................................................................................................5-8 @INT .............................................................................................................................................5-9 @LN, @LOG, @LOG10 .............................................................................................................5-10 @MAX, @MAXS, @MIN and @MINS ....................................................................................5-11 @MOD ........................................................................................................................................5-12 @POWER....................................................................................................................................5-13 @REMAINDER .........................................................................................................................5-14 @ROUND ...................................................................................................................................5-15 @SUM .........................................................................................................................................5-16 @TRUNCATE ............................................................................................................................5-17 @VAR..........................................................................................................................................5-18 @VARPER ..................................................................................................................................5-19 Exercise 5-1: Using Math Functions .............................................................................................5-20 Unit Summary .................................................................................................................................5-21 ............................................................................................................................................................5-24

6 Boolean Functions............................................................................... 6-1

Testing for Values Using Boolean Functions ................................................................................6-2 Boolean Function Parameters ..........................................................................................................6-2 Summary of Boolean Functions ......................................................................................................6-3 @ISACCTYPE ..............................................................................................................................6-5 @ISANCEST, @ISANCEST........................................................................................................6-6 @ISCHILD, @ISICHILD.............................................................................................................6-7

4

Hyperion

Hyperion Essbase Calc Scripts

Table of Contents

T

@ISDESC, @ISIDESC ..................................................................................................................6-8 @ISGEN ........................................................................................................................................6-9 @ISLEV .......................................................................................................................................6-10 @ISMBR......................................................................................................................................6-11 @ISPARENT, @ISIPARENT ....................................................................................................6-12 @ISSAMEGEN ..........................................................................................................................6-13 @ISSAMELEV............................................................................................................................6-13 @ISSIBLING, @ISISIBLING .....................................................................................................6-14 @ISUDA .....................................................................................................................................6-15 Using Logical Connectors with Boolean Functions ...................................................................6-16 Exercise 6-1: Using Boolean Functions.........................................................................................6-17 Unit Summary .................................................................................................................................6-18 ............................................................................................................................................................6-21

**7 Member Set Functions ........................................................................ 7-1
**

Generating Lists Using Member set Functions .............................................................................7-2 Member Set Function Parameters...................................................................................................7-2 Summary of Member Set Functions ...............................................................................................7-3 @ALLANCESTORS ....................................................................................................................7-6 @ANCEST ....................................................................................................................................7-7 @ANCESTORS ............................................................................................................................7-8 @ATTRIBUTE..............................................................................................................................7-9 @CHILDREN.............................................................................................................................7-10 @CURRMBR ..............................................................................................................................7-11 @DESCENDANTS....................................................................................................................7-12 @GENMBRS ..............................................................................................................................7-13 @IALLANCESTORS.................................................................................................................7-14 @IANCESTORS.........................................................................................................................7-15 @ICHILDREN ...........................................................................................................................7-16 @IDESCENDANTS...................................................................................................................7-17 @ILSIBLINGS ............................................................................................................................7-18 @IRDESCENDANTS................................................................................................................7-19 @IRSIBLINGS ............................................................................................................................7-21 @ISIBLINGS...............................................................................................................................7-22 @LEVMBRS ...............................................................................................................................7-23 @LIST ..........................................................................................................................................7-25 @LSIBLINGS..............................................................................................................................7-26 @MATCH...................................................................................................................................7-27 @MEMBER.................................................................................................................................7-29 @MERGE....................................................................................................................................7-30

5

Hyperion

T

Table of Contents

Hyperion Essbase Calc Scripts

@PARENT..................................................................................................................................7-31 @RANGE....................................................................................................................................7-32 @RDESCENDANTS .................................................................................................................7-33 @RELATIVE ..............................................................................................................................7-35 @REMOVE .................................................................................................................................7-36 @RSIBLINGS .............................................................................................................................7-37 @SIBLINGS ................................................................................................................................7-38 @UDA .........................................................................................................................................7-39 @WITHATTR ............................................................................................................................7-40 @XRANGE .................................................................................................................................7-43 Exercise 7-1: Applying Member Set Functions ...........................................................................7-44 Unit Summary ...........................................................................................................................7-45

8 Relationship Functions ....................................................................... 8-1

Using Relationship Functions .........................................................................................................8-2 Relationship Function Parameters..................................................................................................8-2 Summary of Relationship Functions ..............................................................................................8-3 @ANCESTVAL ...........................................................................................................................8-4 @ATTRIBUTEBVAL ...................................................................................................................8-5 @ATTRIBUTESVAL ...................................................................................................................8-7 @ATTRIBUTEVAL .....................................................................................................................8-9 @CURGEN.................................................................................................................................8-10 @CURLEV..................................................................................................................................8-11 @GEN .........................................................................................................................................8-12 @LEV ..........................................................................................................................................8-13 @MDANCESTVAL...................................................................................................................8-14 @MDPARENTVAL ..................................................................................................................8-15 @PARENTVAL .........................................................................................................................8-16 @SANCESTVAL .......................................................................................................................8-17 @SPARENTVAL .......................................................................................................................8-19 @XREF ........................................................................................................................................8-21 How @XREF works ..................................................................................................................8-21 Defining a Location Alias...............................................................................................................8-24 Exercise 8-1: Applying Relationship Function (@ANCESTVAL) ............................................8-26 Exercise 8-2: Applying Relationship Function (@CHILDREN)................................................8-27 Exercise 8-3: Applying Relationship Function (@XREF) ...........................................................8-28 Unit Summary .................................................................................................................................8-30

**9 Range and Financial Functions.......................................................... 9-1
**

Using Range and Financial Functions............................................................................................9-2 Range and Financial Function Parameters ....................................................................................9-2

6

Hyperion

...............................................................................................................................................................9-28 @PRIOR .................................................................................................................................................9-20 @MDSHIFT............................................................................................................................................................9-23 @MINSRANGE .................................................................................9-26 @NEXTS .........................9-16 @IRR .........................9-35 Exercise 9-1: Applying Range Functions (@PRIOR) .....................................................10-8 Exercise 10-1: Applying Allocation Functions ............................................................................................................................................................................................................................9-17 @MAXRANGE ............9-32 @SLN ..........................................................................................................................................................................................................................9-19 @MAXSRANGE .........................................................................................................................................................................9-34 @SYD .............................................................................................................................................................................................................................9-12 @DISCOUNT............................................................10-10 Unit Summary ..........9-36 Exercise 9-2: Applying Financial Functions (@IRR) ............................................ 10-1 Using Allocation Functions ..............................................................................................................................................................................................................................................................................................................................................................................................................9-3 @ACCUM.....................................................................................................................................................................................................................9-38 10 Allocation Functions ........................................................................................................9-6 @COMPOUND ..................9-24 @NEXT ...........................................................................................................................10-5 @ALLOCATE ................................9-31 @SHIFT..................9-8 @CURRMBRRANGE ................................................................................................. 11-1 Using Forecasting Functions ..................................9-30 @PTD .......................9-15 @INTEREST ............................................................................................9-9 @DECLINE .............10-2 Common Parameters .........................................10-2 Summary of Allocation Functions .......................................................................9-33 @SUMRANGE........................11-2 7 Hyperion ..........................................................................................................9-27 @NPV........................................9-22 @MINRANGE ....................................................................10-11 11 Forecasting Functions ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................10-6 @MDALLOCATE .....................................................................................................................................................................................................................................................9-14 @GROWTH......................................................................................................................Hyperion Essbase Calc Scripts Table of Contents T Summary of Range and Financial Functions .........................................................................................................................................................................9-29 @PRIORS.................................................................................................................................................................................................9-5 @AVGRANGE..............9-7 @COMPOUNDGROWTH...............................................9-37 Unit Summary .................................

....................................................................................................................................................................................................... 14-1 Using Miscellaneous Functions..................................................................................................................................................12-2 Statistical Function Parameters ......12-7 @MODE..............................................................................................................................................13-3 Exercise 13-1: Applying the Date & Time Function ......................T Table of Contents Hyperion Essbase Calc Scripts Forecasting Function Parameters...................... 12-1 Generating Lists Using Statistical Functions.................................12-19 @VARIANCEP ....................................................................13-2 @TODATE ...............................................................................................................................................................................................................11-2 Summary of Forecasting Functions .............................................................................................................................................................12-15 @STDEVRANGE..................................................................................................................................11-3 @MOVAVG ..........11-17 Exercise 11-1: Applying Forecasting Functions ..............................................................................................................................................11-4 @MOVMAX ....................................................................................................................................................................................................12-4 @COUNT ................................................................................................................................................................12-17 @VARIANCE .....11-8 @MOVMIN ..............................................................................................................................................11-14 @SPLINE ....................................................................12-2 Summary of Statistical Functions .............................14-2 @CALCMODE ............12-9 @RANK ...........11-15 @TREND ...............................................................................................................................................................................12-11 @STDEV ...............................................................................................................................12-6 @MEDIAN .........11-21 Unit Summary ..................11-6 @MOVMED ....12-21 Exercise 12-1: Applying Statistical Functions ..............................................12-23 Unit Summary ......................................................................................................................................14-12 8 Hyperion ...........................................................................................................11-10 @MOVSUM .............. 13-1 Using Date and Time Functions...............................................................................................................................................14-11 @NAME.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................14-2 Summary of Miscellaneous Functions ...................................................................................................................................................................................................12-13 @STDEVP..................................................................13-5 14 Miscellaneous Functions .....................................................................................................................................................................................................................12-24 13 Date and Time Functions .12-3 @CORRELATION...................................................................14-3 @CONCATENATE......11-12 @MOVSUMX...............................................11-22 12 Statistical Functions.................................................................................................................................................................................................

..............................................................................................15-5 Exercise 15-1b: Isolating Data Using IF or FIX........................................ B-5 Calc ................................................................15-2 Two-pass calculations .................................................................................................................15-12 Unit Summary ..........................................................................................................................................................................................A-1 Possible Solutions ....................15-2 Approaching Calc Scripts Solutions ......................................................................................................................................................................................................................................15-3 Rollup considerations ....................................................................................................................15-2 Dense calculations before sparse calculations ...... B-11 Calc ....................................................................................15-7 Simpler is Usually Better........................................................Basic ............................. 15-1 Calc Script Design Considerations .......................................................................................................................................................................................................15-10 Exercise 15-3: Product Share Analysis ....................................................................................................................................................15-2 Intelligent Calcs........15-3 Business problem .........................................15-14 A Suggested Answers ..................................................................................................................COGS .............................................................. B-17 9 Hyperion .......................................................................................................14-13 15 Tips........................................................................................................15-3 Communication .......................................................................................................................................................................HLandS2 ....................Hyperion Essbase Calc Scripts Table of Contents T @SUBSTRING.............15-2 Blocks on equations .....15-2 IF or FIX..........................................................................15-4 Exercise 15-1: Isolating Data Using IF or FIX ........................B-1 Sample ......................................................................................................................................15-3 IF vs FIX .............................................................................................. Tricks and Techniques.......................................................................................... 1 B Essbase Outlines ................................................................................................HLandS1 ............................................................................................................................................................................................................................ B-2 Calc ...........................................................................15-8 Exercise 15-2: Allocations.............15-3 Individual calculations ................................................................................................................................................................................15-3 Affected data .............

T Table of Contents Hyperion Essbase Calc Scripts 10 Hyperion .

the instructor presents a topic conceptually by explaining its purpose.Preface Welcome to Hyperion® Essbase® XTD Calc Script Training! Before you begin. instructor-led training class. It contains: Step-by-step procedures Hands-on exercises Written reviews to check your understanding H H H H H H H H H The Hyperion Essbase XTD Calc Script (Calc Scripts) training is a 2-day. The preface presents an overview of: How the class is structured An explanation of the writing conventions used in this manual Course Structure What is in the Manual This manual is your guide and reference to learning fundamental tasks and concepts for creating Calc Scripts. please take a moment to review this section. In this course. demonstrating how it works and guiding the students through the exercise. A list of the manual’s components: A Table of Contents for easy reference A Preface containing: • An overview of what is in the manual • A description of the writing conventions Chapters containing: • An introductory objectives page • Step-by-step procedures for referencing during and after class • Detailed descriptions for each Essbase Calc Script command and function • Exercises that encourage you to practice what was just presented • A Check Your Understanding section to reinforce concepts An appendix containing suggested solutions for the exercises . This explain and do procedure has proved to be a successful method.

The descriptions of the individual functions and commands will demonstrate parameters passed to the commands. Some exercises contain two separate versions: ✍ Hyperion . Common parameters. this indicates one item or the other. as in this example: Setting User Defaults Step-by-step procedures begin with the steps graphic and a heading that defines the procedure. which appear in many of the commands or functions for a particular section are described in the beginning of the chapter for that command/function type. as in this example: Accounts Accounts store and identify data for each name and category in Hyperion Enterprise. etc. Exercises appear throughout the chapter to reinforce a new concept or task. Individual sections are noted with a helvetica/bold heading. such as: ii H H H H H H H H To set user defaults: Tables are used to define software components. this indicates that the parameter is optional. This section details these conventions. prefaced by . If two parameters are separated by the filter symbol |. common mistakes or cautions about the current topic. balance sheet.P Preface Hyperion Essbase Calc Scripts Conventions Certain formatting styles are used in this manual to help the student better understand the subject matter and the step-by-step procedures. provide related information. Accounts can contain two levels of subaccount detail. Accounts are organized into Account Groups such as income statement. Notes. tips. Periods represent a specific segment of time for each data category based on that category’s frequency. If the parameter is enclosed in square brackets []. Time Periods Screen captures appear frequently and further clarify a topic.

When available. When needed. appear as follows: [Ctrl] + [Enter] In the example above. the file is located in the directory. Keystrokes that are combined. . text to be typed. . names of files and modules and menu selections appear in Helvetica. This action/result format confirms the procedure and reinforces the student of the correct action. The letter x is used to refer to the drive letter in file names. For example. a different font is used to accentuate text. indicated with the Express/Local icon. such as pressing the Ctrl + Enter keys. icons are used to help identify an object or task. The end of each exercise is indicated by an end of exercise icon. click Yes.Hyperion Essbase Calc Scripts Preface P Since most of the exercises for this course require the creation of Calc Scripts. options to be selected. as in this example: • Click Properties. a result follows. iii . Narrow Bold. Your instructor will provide the appropriate drive letter for x. they are presented as combined versions. as in the following examples: Select Clear Profile. you would press the Enter key while holding down the Ctrl key. x:\Program Files. For UNIX or DOS procedures and for Calc Script examples. as in the following example: Change to the /home/essbase/app directory. Throughout the step-by-step procedures and exercises. text to be typed appears in Courier. Hyperion H H H H H 1) 2) • 1) The step-by-step procedures present the action to be performed. The following rules apply: • For Windows procedures. To clear the profile.

P Preface Hyperion Essbase Calc Scripts iv Hyperion .

Hook Line and Sinker. which is used in the exercises for the course • • .1 Introduction Chapter Objectives By the end of this chapter. you will be able to: • Describe the process an application designer or database administrator follows when learning an application such as Essbase XTD Preview course content. course objectives and course activities Describe the organization.

of Essbase to identify the parts of the system. you concentrate on learning the techniques of using Essbase. Creativity Optimization Techniques Usage Concepts Syntax Syntax You learn the combination of words. concepts. Usage The ability to conceptualize solutions is referred to as usage. Optimization Perhaps one of the most important steps in learning Essbase is how to optimize the techniques that make up an application. 1-2 Hyperion . your application of Essbase improves accordingly. you follow a set of steps. Techniques After you are comfortable with syntax. learning Essbase is like learning any language. others must learn them by trial and error. In many ways. As you improve your techniques. The combination of Essbase syntax and concepts provides you with the basic building blocks for creating an Essbase solution. These steps follow the natural progression in learning any complex system. Concepts You relate words by learning about Essbase concepts. Most users learn these optimization techniques from more expert users. and usage. This course is designed to provide usage examples. or the syntax.1 Introduction Hyperion Essbase Calc Scripts Learning Essbase When learning an application such as Essbase.

Building calc scripts Not all calculations can be achieved with an outline calculation. usage. techniques. and. A small efficient system usually retains optimum performance when scaled to a larger environment with more users and more data. You develop and test calc scripts that provide appropriate results and efficient database operations. Although classroom training helps foster creativity. You also explore a variety of built-in functions provided by Essbase.Hyperion Essbase Calc Scripts Introduction 1 One of the strengths of using Essbase is that you can build a scalable online analytical processing (OLAP) system. Hyperion 1-3 . The only way you can be creative is through mastering the basics. you acquire techniques that you can use in your working environment. by working with various examples. Class Overview During this class. Reviewing calculation architecture You begin by reviewing calculation architecture in Essbase databases. concepts. Using calc scripts Throughout the class. Because you are already familiar with the syntax and concepts of outline calculations. you can develop your own creative approaches. you concentrate on the architecture of a database to determine how calculations proceed. testing and debugging scripts. you examine solutions to common analytical database problems. Creativity After you have mastered syntax. You now look at the basics of building a calc script: using the editor.and optimization. it is experience in building applications that enables you to do so effectively. you explore the various uses of calculations.

Line and Sinker Company and became a wholesaler of fishing tackle throughout the United States to premium sporting goods outlets. sales. & Sinker realized that these were only the beginning of their analytical requirements. By 1985. which he sold through the local general store. Line. California. By the early 1950s. Smith became famous throughout Calavares County in the 1930s for his excellent lures. A client-server solution was implemented with some success. it was clear that Hook. Within five years. but a wide variety of fishing tackle to sporting goods stores. you review the history and description of the Hook. Line and Sinker Company began as a sideline for walnut farmer Claude Smith in West Point. and costs. Hook. Building an OLAP system In working with a consultant. However. Line and Sinker Company. Their search for a tool that would take advantage of existing data and for additional analysis led them to choose Essbase.1 Introduction Hyperion Essbase Calc Scripts Exercise 1-1 – Hook. 1-4 Hyperion . family-owned business. the following immediate analytical needs were identified: • product mix • market share • cost adjustment • forecast and budgeting • cost allocation The management of Hook. This company forms the framework for the practical exercises presented throughout the course. Line. by 1998 the next generation of Smiths believed that they needed greater control and started looking for analytical tools that could help Hook. Line and Sinker could no longer operate as a small. The company invested in PCs to control inventory. his nephew Bob decided to start a company to market not only lures. One of the third generation of Smiths decided to invest in a new breed of system: an OLAP system. the original company incorporated as Hook. Sierra Mercantile. it was clear that these standalone systems were no longer adequate to manage the ever-growing business. As the fame of Smith's lures spread throughout northern California. & Sinker manage its business more successfully. Line and Sinker Company In this exercise.

The database has a dual purpose. As you master each learning level—syntax. Efficient and accurate calculations provide required data manipulation. It enables experimentation with various calc scripts. concepts. • • It provides a reasonable. Hyperion 1-5 . The basic goal of this course is to provide practical tools that will assist you in building a successful Essbase layer in an OLAP system. usage. and maintainability of data. you must consider a variety of factors.Hyperion Essbase Calc Scripts Introduction 1 Unit Summary The process of learning Essbase follows a pattern common to that of learning most systems. To provide accurate data. During this course. and techniques. you use the Hook. appropriate data transformation. Line and Sinker (HLandS) database for exercises. Using the builtin functionality of Essbase reduces development time and processing time. you progress towards the ultimate goal of efficiently and accurately calculating a database. real-world example of a moderately complex Essbase database.

1 Introduction Hyperion Essbase Calc Scripts 1-6 Hyperion .

2 Calculation Architecture Chapter Objectives By the end of this chapter. you will be able to: • • • • • Describe the two types of calculations (outline and calc script) available in Essbase XTD Explore data storage options that affect calculation order List the levels of calculation order Explore the need for two-pass calculations and describe the differing behavior when used in outline calculations and calc scripts Review the sample database that is used during class exercises .

2

Calculation Architecture

Hyperion Essbase Calc Scripts

Types of Calculation

Hyperion Essbase provides two basic methods of calculation. Outline calculations are placed directly in the outline, and usually are run by invoking a default calc script. Calc scripts are generally more specific, calculating a portion of the database or performing special analytical tasks.

Outline calculations

Outline calculations are the simplest method of calculating the database. Outline calculations are dependent on the structure of the database outline. You use outline calculations when the database has been updated, data must be consolidated, and formulas must be recalculated. Outline calculations are invoked through a default calc script. When working with large databases, you can use an alternative default calc script to aggregate only those portions of the database that have been updated.

✍

The default calculation simply runs through the outline. If Intelligent Calculation is invoked, however, the calculation is limited to calculate for updated data, only.

Calc scripts

You use calc scripts for more specialized calculations. These include calculating a portion of the database, or performing calculations using commands that do not work in the outline. In conjunction with outline settings, a calc script uses a combination of functions, commands and formulas to answer a specific question.

2-2

Hyperion

Hyperion Essbase Calc Scripts

Calculation Architecture

2

Outline Calculations

Outline calculations are based on relationships between members in the database outline and on any formulas that you have attached to members in the outline. For example, the values stored for New York, Massachusetts, Florida, Connecticut and New Hampshire are added (aggregated) to calculate the total for East. Each region - East, West, South and Central - are in turn rolled up to calculate the total for Market. It is best to place calculations in the outline, where possible, for the following reasons: • • They are easier to understand in the outline than in a calc script. If the calculations can be expressed as unary relationships in the outline hierarchy using outline consolidation operators (+, -, /, *, %), they execute much faster than in formulas. There is no significant difference in efficiency between formulas in the outline and formulas in a calc script.

•

Hyperion

2-3

2

Calculation Architecture

Hyperion Essbase Calc Scripts

Default Calculation

The default calculation for a database is CALC ALL. CALC ALL calculates the database by evaluating the outline from top to bottom, executing rollups and formulas in the order in which they are encountered. The execution order is automatically optimized by Essbase when CALC ALL is used. You run the default calculation from an Application Manager menu, from Esscmd or from a calc script containing the command CALC ALL.

**To connect to the Essbase Server:
**

1) 2) Ensure Hyperion Essbase OLAP Server and Hyperion Essbase Application Manager are running. To connect to the server from the Essbase Application Manager main menu, select Server / Connect. In the Essbase System Login window, select the desired Server, and type a valid Username and Password. Click OK. The server window displays:

3)

**To calculate a database in Essbase Application Manager:
**

1) 2) Connect to the Essbase Server. In the Server window, select the Application from the drop-down list. The databases for the selected application display in the Databases list. In the database list, select the database to be calculated.

3)

2-4

Hyperion

Hyperion Essbase Calc Scripts 4)

Calculation Architecture

2

From the main menu, choose Database / Calculate. The Calculate Database window displays:

5)

Select the Calc Script that you want to execute. To choose the default calculation, select (Default). Click OK. A status window displays during the computation. When the calculation completes, the status window disappears.

You may specify any calc script as the default calculation. If you use a specific script rather than CALC ALL, you use Essbase Application Manager or Esscmd to set the script as the default.

**To view the default calc settings:
**

1) 2) Connect to the Essbase Server. In the Server window, select the Application from the drop-down list. The databases for the selected application display in the Databases list. In the database list, select the database to be calculated.

3)

Hyperion

2-5

2

Calculation Architecture 4)

Hyperion Essbase Calc Scripts

From the Essbase Application Manager main menu, choose Database / Set Default Calc. The Set Default Calc window displays:

The default calculation can be either a stored calc script procedure, identified by the Use Calc Script Object option; or the calc script that is stored in the text box associated with the Use String option.

From the Set Default Calc window, you can select one of two ways to change the default calc script. You may type an alternate calc script in the text box associated with the Use String option, or you may select an existing calc script file.

**To change the default calc settings by typing in a new calc script:
**

1) 2) 3) From the Set Default Calc window, select Use String. Type commands into text box associated with the Use String option in the Set Default Calc window. Click OK.

**To change the default calc settings by selecting an existing calc script:
**

1) 2) From the Set Default Calc window, select Use Calc Script Object. From the drop-down list, select the calc script that you wish to use as the default calc script.

2-6

Hyperion

Hyperion Essbase Calc Scripts 3) Click OK.

Calculation Architecture

2

✍

If you use a calc script object in place of the default calc, the calc script is copied into the text box. If you change the original calc script, the calc script in the Set Default Calc window is not automatically updated.

Hyperion

2-7

2

Calculation Architecture

Hyperion Essbase Calc Scripts

**Default Calculation Characteristics
**

You need to understand the behavior of a default calculation and consider performance.

**Minimizes Physical Passes Through the Database
**

Even when two-pass calculations are specified, Essbase attempts to perform calculations in a single pass of the database. The following chart summarizes the number of passes for each combination of dimensions tagged as Accounts and each tagged as Time:

Accounts Dense Sparse Dense Dense (and is the only dense dim) Dense Sparse Sparse Time None None Dense Sparse Sparse Sparse Sparse Passes 1 2 1 1 2 2 2

**Allows Users with Access to Specific Calc Scripts to Run the Default Calc
**

Users who have calc access (the ability to run calc scripts) also have access to the default calc. If you do not want users to calculate the database using the default calc script, create a default calc script that contains only a single semicolon (;). This prevents users from actually calculating the database and does not cause an error. You may want to prevent users from calculating the full database because of time and performance factors, as well as because of data consistency considerations.

2-8

Hyperion

Hyperion Essbase Calc Scripts

Calculation Architecture

2

**Calc Script Calculations
**

Calc scripts let you to control precisely the method and order of calculations. You can calculate only a portion or all of the data. You can calculate specific outline rollups or formulas in a calc script. You can control the order in which calculations are performed. You can also evaluate and control the effects your calc script has on block I/O.

**Contents of calc scripts
**

A calc script can be very simple, containing only a single statement, such as CALC ALL, or a single function that is not available in an outline calculation, such as CCONV. Many calc scripts, however, contain a series of steps that are dictated by logical tests or by the calculation of subsets of data.

**Reasons for calc scripts
**

You should use calc scripts instead of outline calculations in the following situations: Complex logic is required Calculations focus on a subset of the database Specific analytical functions are required Infrequently used calculations, such as year-end processing, that require standard scripts are needed

**Functions and commands that work only in scripts
**

Some functions are not valid in an outline, particularly functions that calculate only a portion of the database: Currency conversion using Hyperion Essbase Currency Conversion Iterative processing, such as solving simultaneous equations Data management commands, such as DATACOPY and CLEARBLOCK The FIX command, used to calculate subsets of data Temporary variables

Hyperion

H H H H H H H H H

2-9

you may not sell every product in every region. COGS and Expenses would be a likely candidate to tag as Dense. you must understand how Essbase stores data. Dimension tags Two special types of dimensions are tagged as Accounts and Time. Data storage To predict calculation order. Index nodes are made up of sparse dimensions. every product sold has sales information. such as Dynamic Time Series and Expense Reporting. They have special processing characteristics. and related expense. Sparse dimensions tend to change more frequently than dense dimensions. a product dimension and a market dimension would likely be sparse in this scenario. Dimension types You also review the order in which Essbase calculates each dimension type: • • Dense calculations Sparse calculations Dense and Sparse Dimensions When an Essbase database is designed. the dimension that contains the members of Sales. These concepts are vital to understanding both outline calculations and calc scripts. Data blocks are made up of dense dimensions. Sparse dimensions Sparse dimensions are used when the demographics of data is likely to be thinly spread. Therefore. these dimensions tend to be fairly static. cost of goods sold information. Dense dimensions When you examine data. The next few pages present a review of the basic concepts of data storage. 2-10 Hyperion . you see that some dimensions are likely to contain large amounts of data. Thus. For example. For example. Also. a crucial issue is the designation of dimensions as dense or sparse.2 Calculation Architecture Hyperion Essbase Calc Scripts Calculation Order Default calculation order is dependent on how data is stored in the database.

As Essbase processes data. index nodes and data blocks are read from a disk and brought into memory. Data cells are defined by the dense dimensions of the database combinations. which corresponds to the block’s combination of sparse members.Hyperion Essbase Calc Scripts Calculation Architecture 2 Block and Index Structure Essbase uses two types of internal structures to store and access data: data blocks index blocks Hyperion H H The data block contains data cells (the actual values). 2-11 . through calculations. The number of cells in each block equals the product of all stored members of dense dimensions. each block has an associated index node. You can use various Essbase settings to define the amount of memory allocated for processing index nodes and data blocks. data loads or data retrievals. To specify data blocks.

Therefore. Connecticut and New Hampshire. 2-12 H H Generations are numbered from the top of the hierarchy. Hierarchies. Levels are numbered from the bottom of the branches of the hierarchy. with the dimension name being Generation 1. Hyperion . The order of calculation within a dimension follows the level numbering. starting at Level 0. Albany. if it is not tagged as Label Only. But.2 Calculation Architecture Hyperion Essbase Calc Scripts Generations and Levels Essbase vocabulary uses two methods for referencing the position of a member within a hierarchy: generation level. can be asymmetric. is calculated up to the highest level. is consolidated. Florida. Each dimension branch. an upper-level member such as East may be Level 2 when traversing the branch to cities (New York City. it becomes Level 1 when traversing the branch to the states that have no city members: Massachusetts. with the lowest level being Level 0. Level 0 (leaf level) members have no members below them. and Buffalo). After all lower levels of a hierarchy are calculated. such as the example above. the dimension name.

Hyperion Essbase Calc Scripts Calculation Architecture 2 Block Types Block types are determined by the way in which the block was created and by the level of the sparse combination members that define the block. Markets is the top member of the Markets dimension. Thus. Markets->Cola is an upper-level block. the block did not exist. Hyperion 2-13 . the block East->Cola was created during a sparse calculation process. Upper-level blocks Upper-level blocks correspond to one or more sparse members that are not level zero. New York->Cola is a level zero block because New York and Cola are leaf-level members of their respective sparse dimensions. Markets and Products. Input blocks can be level zero or upper-level blocks. Markets->Cola is considered upper-level. For example. Although Cola is a zero level member from the Products dimension. Before calculation. Input blocks Input blocks are created by loading data to cells in the block. a data load with rules or a spreadsheet lock and send. Non-input blocks Non-input blocks are created through calculations. all data in the block is the result of calculation. for example. Level zero blocks Level zero blocks correspond to level zero members of sparse dimensions. Therefore. For example.

2-14 Hyperion . the dimension tagged as Time. whether dense or sparse Second. Dense combination cells inside each block are then calculated and filled.2 Calculation Architecture Hyperion Essbase Calc Scripts Calculation Order When you perform a default calculation (CALC ALL) on your database. Dense calculations proceed one block at a time until all existing blocks are calculated. other dense dimensions (in the order that they are displayed in the database outline) • Fourth. If a database includes a dimension tagged as Accounts and a dimension tagged as Time and if formulas are applied to members on the Accounts dimension. other sparse dimensions (in the order that they are displayed in the database outline) • Fifth. Dense Calculations Dense members are calculated first when using CALC ALL. the dimension tagged as Accounts. two-pass calculations (if selected in the database settings) Note: Two-pass calculations are sometimes calculated when the Accounts dimension is calculated. Essbase calculates dimensions in a predetermined order. whether dense or sparse Third. Essbase calculates in the following order: • • • First.

Each cell in the consolidated block corresponds to the aggregate total of its counterpart cells in the zero level blocks. Hyperion 2-15 . the newly created upper-level blocks (East->Cola) complete calculation in one step. after dense dimensions have been calculated for all existing blocks.Hyperion Essbase Calc Scripts Calculation Architecture 2 Sparse Calculations In a default calc. Because all data cells in the original level zero blocks have been calculated. sparse dimensions are calculated to consolidate level zero blocks into newly created upper-level blocks. Jan->Sales->Actual for East->Cola is 30 because Jan ->Sales->Actual for Vermont->Cola is 10 and Jan->Sales->Actual for New York->Cola is 20. For example.

In an outline. calculations move up to the next level.Profit. for the sample outline.2 Calculation Architecture Hyperion Essbase Calc Scripts Calculation Order: Dense Dimensions In this outline. calculations occur in the following order: • • • Within the Margin branch . then Inventory and then Ratios. the numbers indicate the order of calculation.Sales and then COGS Within the Profit branch . Shared members are pointers to a stored value. For example. Notice the following: • • Calculations start at the lowest level of a branch.Margin and then Expenses Within the Measures dimension . it is recommended to place shared members below the physically stored members. When the end of a sub-branch is reached. the calculation is actually performed on the data in the stored location. If you perform a calculation on a shared member. 2-16 Hyperion .

One sparse dimension is traversed while one member of another dimension remains constant. Calculation order for the above outline is as follows: Anchor Dimension A Cola Traversed Dimension 1 2 3 4 B Root Beer 1 2 3 4 And so on East West South Markets East West South Markets Hyperion 2-17 .Hyperion Essbase Calc Scripts Calculation Architecture 2 Calculation Order: Sparse Dimensions Sparse calculations obey the same sequential rules as dense calculations.

Batch calculation order: • • • • • Dimension with Accounts tag Dimension with Time tag Dense dimensions in outline order Sparse dimensions in outline order Two-pass calculations Dynamic Calc order: • • • • • • Sparse dimensions Dynamic Time Series calculations Dimension with Accounts tag Dimension with Time tag Dense dimensions in outline order Two-pass calculations 2-18 Hyperion .2 Calculation Architecture Hyperion Essbase Calc Scripts Calculation Order: Dynamic Calc Versus Batch The calculation order of Dynamic Calc members differs from batch (outline) calculation order.

Units per Container East Containers East .Total Units 10*2 = 20 10*1 = 10 10+10 = 20 2+1 = 3 20+10 = 30 If you tag East and Total Units as Dynamic Calc and run a calculation. 2. 5. then the Time dimension is chosen first for the sparse calculation. Consider the following outline: Sparse Dense A batch calculation first calculates the leaf blocks of the dense dimensions. New York . 3.Total Units East . Because the calculation order of batch calculations differs from the calculation order of dynamic calculations.Total Units Florida . Then the upper-level blocks (East) are calculated by aggregating along the sparse dimension.Hyperion Essbase Calc Scripts Calculation Architecture 2 Calculation order exceptions If the dimension tagged as Time is sparse and includes Dynamic Time Series members. tagging certain members as Dynamic Calc can create errors. you will receive different results: Hyperion 2-19 . 4. The following results are produced: Batch calculation results were calculated in this order: 1.

2 Calculation Architecture Hyperion Essbase Calc Scripts Since Dynamic Calculation calculates along the sparse dimensions before calculating the order of calculation is: 1. East .Total Units Florida . you need to be very careful in deciding when and how to apply Dynamic Calc tags.Total Units 10+10 = 20 2+1 = 3 10*2 = 20 10*1 = 10 20*3 = 60 Thus. even if the member is not in a dimension tagged as Accounts.Containers New York . 3. 2.Total Units East .Units per Container East . 2-20 Hyperion . ✍ You can tag any Dynamic Calc or Dynamic Calc and Store member as two-pass. 5. 4.

but the rolled-up calculation for percent is not correct: Accounts Profit Sales Profit% (NOT tagged as two-pass) Jan 100 1000 10% Feb 100 1000 10% Mar 100 1000 10% Qtr1 300 3000 30% The second pass corrects the percentage calculation: Accounts Profit Sales Profit% (tagged as two-pass) Jan 100 1000 10% Feb 100 1000 10% Mar 100 1000 10% Qtr1 300 3000 10% ✍ Two-pass calculations work only on the Accounts dimension. the dimension tagged as Time is calculated and the data is rolled up across the Time dimension. Although you can tag members in other dimensions as two-pass. when a two-pass calculation is run. Hyperion 2-21 . the dimension tagged as Accounts is calculated first. Two-pass calculation is also used when member calculations reference other member calculations that are not yet complete. the tag is ignored. Then. calculations made at the lowest level (months) are correct. Calculation passes During the first pass.Hyperion Essbase Calc Scripts Calculation Architecture 2 Two-Pass Calculation Two-pass calculation is used when data must be calculated twice: once during rollup and once after rollup is complete. In the example below.

In the Application field. type Trnadmin. Close the HLandS2 outline. From the list of available databases. 4) 5) 6) 7) 8) 9) 10) ✍ 11) 2-22 Hyperion . particularly under Statistics. In the Server textbox. Click Open. The major difference between these two outlines is the design of the Scenario and Time dimensions. you use the following files: Database CALC:HLandS1 CALC:HLandS2 CALC:COGS Spreadsheet SS_Demo. select Server / Connect.2 Calculation Architecture Hyperion Essbase Calc Scripts Exercise 2-1: Review Class Files In this exercise. The Localhost server window displays. HLandS2 also contains an attribute dimension (IntroDate). Expand each of the dimensions to obtain an understanding of the structure of the HLandS1 database. type Localhost. select HLandS1. From the list of available databases. In the Username field. Click OK. select HLandS2. You also review a typical sample spreadsheet used in one exercise. For this exercise. From the Essbase Application Manager main menu. The Essbase System Login dialog displays. Click Open. HLandS2 also contains a few more members in the Accounts dimension. Start Essbase Application Manager. In the Password field.xls 1) 2) 3) Ensure that the Essbase OLAP server is running. select CALC. type hyperion. Close the HLandS1 outline. Expand each of the dimensions to obtain an understanding of the structure of the HLandS2 database. you review the Essbase database outlines used in future exercises.

15) 16) 17) Launch Microsoft Excel. The COGS database is much simpler that HLandS1 and HLandS2. you use Essbase / Lock and Essbase / Send to initialize the database’s content.Hyperion Essbase Calc Scripts 12) 13) Calculation Architecture 2 From the list of available databases. A sheet containing the layout of the data that to be retrieved after executing the Calc Script you created to match the requirement for this exercise. After clearing the database. select COGS. Open the Excel workbook: SS_Demo found in the <x>:\Hyperion\Essbase\App\Calc directory. It contains the (percentage) cost of goods for each product. You use Essbase / Calculate to run your Calc Script. select the Calc&Retrieve tab. Click Open. Expand each of the dimensions to obtain an understanding of the structure of the COGS database. Close the Excel workbook. ✍ 14) Review a Typical Excel Workbook Each exercise uses an associated Excel workbook that usually includes: • • A sheet containing data used to initially populate the Essbase database. ✍ 18) ✍ 19) Hyperion 2-23 . You use Essbase / Retrieve in this worksheet to obtain the updated data and to confirm the correct operation of your Calc Script. select the Lock&Send tab. It is used for one exercise that applies the @XREF function. Close the COGS outline.

You can use either of two methods to describe the calculation position in the hierarchy. moving from left to right. followed by sparse dimensions. a dimension tagged as Time is calculated second. Levels work in the opposite direction. The order of calculation is determined by dimension type. Generations start at the top of the outline and count forward or down. The Generation and Level positions are used frequently in calc scripts. Dense dimensions contain data. the number increases. Outline calculations consist of database consolidations and member calculations. The simplest form of database calculations are those contained in the database outline. and sparse dimensions act as index pointers to the data blocks of the dense dimensions. As you move up the hierarchy.2 Calculation Architecture Hyperion Essbase Calc Scripts Unit Summary You must understand the structure of the Essbase database and the order in which the database is calculated before you can understand calculations. moving from right to left. A dimension tagged as Accounts is calculated first. 2-24 Hyperion . All remaining dense dimensions are calculated in the order in which they appear in the outline. An Essbase database is made up of dense and sparse dimensions. A dimension is often hierarchical in nature. The lowest level of the hierarchy-the leaf level-is Level 0. Dense dimensions are calculated before sparse dimensions. These calculations are used to ensure that the databases present consistent data to all users.

check your understanding by responding to the following questions: 1) What is the default calculation order when performing a database consolidation? 2) When would you use a calc script instead of the default calc? 3) Why would you use Two-pass calculation? Hyperion 2-25 .Hyperion Essbase Calc Scripts Calculation Architecture 2 þ Check Your Understanding Now that you have completed the chapter.

2 Calculation Architecture þ Check Your Understanding Solutions 1) Hyperion Essbase Calc Scripts What is the default calculation order when performing a database consolidation? If a database includes a dimension tagged as Accounts and a dimension tagged as Time and if formulas are applied to members on the Accounts dimension. • Calculations focus on a subset of the database. Why would you use Two-pass calculation? Two-pass calculation is used when data must be calculated twice: once during rollup and once after rollup is complete. • Infrequently used calculations. Essbase calculates in the following order: • First. 2) 3) 2-26 Hyperion . the dimension tagged as Time. two-pass calculations (if selected in the database settings) When would you use a calc script instead of the default calc? You should use calc scripts instead of outline calculations in the following situations: • Complex logic is required. other dense dimensions (in the order that they are displayed in the database outline) • Fourth. whether dense or sparse • Third. that require standard scripts are needed. whether dense or sparse • Second. • Specific analytical functions are required. the dimension tagged as Accounts. other sparse dimensions (in the order that they are displayed in the database outline) • Fifth. such as year-end processing. Two-pass calculation is also used when member calculations reference other member calculations that are not yet complete.

3 Calculation Script Environment Chapter Objectives By the end of this chapter. you will be able to: • • • • • • Describe the reasons for using calc scripts Demonstrate how to use the Calc Script Editor and online Help to build calc scripts Describe the use of member calculations and arithmetic operators List the types of commands and functions available to create calc scripts Create and execute a simple calc script Add in-line documentation to a calc script .

Calc Script Editor and online Help You can create calc scripts using Notepad or any text processor. examples of each function and a description of the command usage. it will be used. It also provides a syntax checker. 3-2 Hyperion . Calc scripts extend the analytical functionality of Essbase beyond the pro forma report that is presented when viewing a simple Essbase spreadsheet. Relational database programmers must always remember that they are not working with a flat structure. or Fortran can draw an analogy to multidimensional arrays. By cutting and pasting from online Help. they are working with a polyhedron that has as many sides as there are dimensions in the database outline. they do not take full advantage of the OLAP strengths of Hyperion Essbase. Online Help provides access to appropriate syntax. Components of calc scripts The Essbase calc script language possesses many of the calculation components with which programmers are familiar.3 Calculation Script Environment Hyperion Essbase Calc Scripts Introducing Calc Scripts As powerful as outline calculations are. To simplify the process. Java. all functions and calculations that are used in calc scripts can also be used in an outline. You create calc scripts to solve more complex and unusual analytical problems. Rather. for example. to calculate specific portions of the database and to develop business scenarios that are not used in every day reporting. ensuring that every user starts with the same data. you further simplify the creation of calc scripts. With the exception of a few commands and looping. the Calc Script Editor provides lists of database dimensions and members as well as lists of functions and commands. The greatest challenge the new Essbase programmer faces is thinking multidimensionally. The language provides not only for a variety of calculation functions but also for a variety of Boolean tests and for program control (if-tests and looping). If an outline consolidation is in a calc script. Hyperion Essbase Application Manager provides a tool called the Calc Script Editor. which is invoked from Essbase Application Manager. Calc scripts and outline calculation work together. Outline calculations provide a baseline for all analysis activities. Programmers who have worked with C++.

These commands and functions are studied in detail throughout this course.Hyperion Essbase Calc Scripts Calculation Script Environment 3 Commands and functions Calc script commands include the following subcategories: • • • • Commands that control calculation. and clearing an entire database Environmental commands that control output to the log. and optimize calculations Calc script functions usually begin with an @ sign and include the following subcategories: • • • • • • Boolean functions that test for member relationships Member set functions that return a list of members Relationship functions that return a value based on the current position of a calculation Range functions that return a single value after performing a calculation. on a range of values Math functions that perform a variety of mathematical operations Calc scripts also provide a full range of operators and connectors. clearing blocks. from calculating an entire database to calculating a single dimension Data isolation commands that specify a portion of the database to be calculated Data management commands that allow for copying data. manage the calculation environment. Hyperion 3-3 . such as sum.

Creating a New Calc Script: 1) From the server window of the Hyperion Application Manager.3 Calculation Script Environment Hyperion Essbase Calc Scripts Using Calc Script Editor Calc Script Editor is accessed from Essbase Application Manager. 2) 3) Click Calc Script . The names of the existing calc scripts display in the Calc Scripts list. From the Calc Scripts list. 2) Click Calc Script . select the name of the Calc Script to be opened. select the application and database. select the application and database. The Calc Script Editor window displays: Opening an Existing Calc Script: 1) From the server window of the Hyperion Application Manager. Click Open. Click New. 3) 4) 3-4 Hyperion .

include most common unary operators: Associating an Essbase Outline When editing a calc script. save and print: Check the calc script syntax: Associate an outline with the Calc Script 3-5 .Hyperion Essbase Calc Scripts Calculation Script Environment 3 The Calc Script Editor window displays.The selected calc script is in the edit area: Calc Script Editor Calc Script Editor minimizes typing by providing the capability to select from: Lists of dimensions and members for the associated Essbase outline. you may select the outline with which to associate the calc script. Hyperion H H H H H H H A button that accesses the complete list of commands and functions: Cut. the selected outline’s dimensions and members display in the appropriate lists (at the bottom half of the Calc Script Editor window). Buttons that. copy. Clicking on an item in the Member list will copy it to the edit area. paste and undo: Other functionality on the Calc script toolbar include: Open. Once associated. when clicked.

3-6 Hyperion . select the Server. If necessary. click the Associate button from the main menu. Select the item in the Members list. they may be selected for inclusion. Application and Database. or The default selections are to use the application and database that was created with.3 Calculation Script Environment Hyperion Essbase Calc Scripts Associating a Hyperion Essbase Outline: 1) In the Calc Script Editor window. The outline’s dimension display in the Dimension list of the Calc Script Editor window. 2) 3) If necessary. Click OK. The selected item is copied to edit area at the current cursor position. expand the dimension’s definition in the Members list to reveal the item that you wish to include. select Options / Associate Outline. select the dimension that contains the item (dimension or member) to be copied to the edit area. Instead of memorizing and typing in these commands. Selecting Items from the Associated Outline: 1) In the Dimensions list of the Calc Script Editor window. The Associate Server Outline Object window displays: . 2) 3) Inserting Functions (Using the Function Button) There is a large variety of commands and functions that can be included in a calc script.

it can be run to update the data in the selected Essbase database. Once the calc script is saved. The function / command is added at the cursor position of the edit area in Calc Script Editor window. The command’s template displays below the Categories list. select the desired function or command. 3) 4) 5) Checking the Syntax and Saving and Running the Calc Script The Calc Script Editor includes the capability to determine if the script contains errors. select the category that contains the function or command that you wish to include. Depending on the command/function selected. 2) From the Categories list. select Insert Arguments. and if you want to include the function’s arguments. The functions of the selected category are displayed in the Templates list. click Functions The Function Templates window displays: . In the Templates list. Click OK. If available. Hyperion 3-7 . the Insert Arguments check box becomes available.Hyperion Essbase Calc Scripts Calculation Script Environment 3 Inserting Commands and Functions: 1) In the Calc Script Editor window.

3) Saving an Existing Calc Script: 1) Click the Save button on the toolbar. The previous error displays on the Calc script Editor’s status line. or from the main menu select File / Save. To view the previous error. 3-8 Hyperion . click Syntax Checker .3 Calculation Script Environment Hyperion Essbase Calc Scripts Checking the Syntax: 1) After you enter the calc script. “No more errors” will display on the status line if there are no prior syntax errors in the calc script. select Syntax / Previous Error from the main menu. In this example. The next error displays on the Calc script Editor’s status line. The updated calc script is saved. 2) To view the next error. or from the main menu select Syntax / Check Syntax. “No more errors” will display on the status line if there are no further syntax errors in the calc script. A message will display on the Calc script Editor’s status line to identify the first error encountered. the semicolon is missing: “No errors” will display on the status line if no syntax errors exist in the calc script. select Syntax / Next Error from the main menu.

Click OK. 4) Hyperion 3-9 .Hyperion Essbase Calc Scripts Calculation Script Environment 3 Saving a New Calc Script: 1) Click the Save button on the toolbar. Running a Calc Script (Application Manager): 1) 2) 3) From the server window. Application and Database to be updated. Select the Server. type the name that want to which you want to save the calc script. From the Calc Scripts list. or from the main menu select File / Save or File / Save As. Once the calc script is completed. The Save Server Object dialog displays: 2) 3) In the Object Name field. the status message dismisses. The Select Database window displays. select the Calc Script to be executed. Click Run. click Calc Script . The Essbase Operation status message displays while the calc script is running. Click OK.

respectively. The easiest way to access the documentation is from the Information Roadmap. by selecting Programs / Hyperion Solutions / Hyperion Essbase/ OLAP Server Documentation: The following resources are most useful to you when creating calc scripts: • Database Administrator's Guide. The documentation for the Calc Script commands and Essbase functions can be accessed from Hyperion Essbase Application Manager. This is distributed as HTML for quick on-line reference. From the main menu select Help / Calculation Commands or Help / Functions. This can be accessed from the Windows Start menu. administrators and users. Technical Reference also provides an invaluable on-line resource for obtaining information about Calc Script commands and Essbase functions. • 3-10 Hyperion .3 Calculation Script Environment Hyperion Essbase Calc Scripts Using Essbase Documentation Several documentation sources are available to Essbase developers. and as a PDF for producing a printed copy of the guide.

Using Windows copy and paste functions. Hyperion 3-11 .Hyperion Essbase Calc Scripts Calculation Script Environment 3 Inserting Functions (From on-line Help) The documentation for each function and command includes a description of the syntax. the syntax of a required statement can be copied from the on-line help into the Calc Script Editor’s edit area.

Associate the calc script with the HLandS1 outline. Create a new calc script. type in Variance =. Click OK. In the Calc Script Editor. select Calc Dim. Switch to HTML Help by selecting Help / Functions. you experiment with Calc Script Editor. For this exercise. From the list of available databases. From the Categories list box of the Function Template. You also use the HTML Help to create another. The statement in the edit area reads CALC DIM (Accounts) Place the cursor at the end this line (and click). In the edit area. copy the syntax of @VAR to the clipboard. From the Templates list box. and locate the @VAR function. select Accounts from the Dimensions list box. You use the functions template option in Calc Script Editor to create a line of a calc script. select HLandS1. or click the semi-colon button on the toolbar. and then paste the contents from the clipboard. on a new line. you use the following files: Database Calc Script (new) CALC:HLandS1 CSDemo 1) 2) 3) Start Essbase Application Manager. Either type a semicolon. select Functional. Press [Enter]. The Calc Dim(dimList) statement is copied to the Calc Editor edit area. The statement in the edit area reads CALC DIM (Accounts). 4) 5) 6) Click the Calc Script Editor function button . In HTML Help. highlight dimList in the CALC DIM parentheses. select Accounts from the Members list box.3 Calculation Script Environment Hyperion Essbase Calc Scripts Exercise 3-1: Explore Calc Script Editor and Online Help In this exercise. 7) 8) 9) 10) 3-12 Hyperion . and connect to the CALC application.

Make sure that punctuation is correct. insert Actual and Budget into the formula in that order. it would override the formula in the outline. review your calc script to ensure the syntax and punctuation is correct (according to step 11). This exercise duplicates the Variance formula. Budget). Save the calc script as CSDemo. Variance has a formula. However. Variance = Var(Actual. Verify the syntax by selecting Syntax / Check Syntax or by clicking the Syntax Checker button on the toolbar. The statements in the edit area reads: CALC DIM (Accounts). Note: In the database outline.Hyperion Essbase Calc Scripts 11) Calculation Script Environment 3 Using the Members list box. if the calc script calculated Variance differently. ✍ 12) 13) 14) If there are errors. Hyperion 3-13 . Reverify the syntax.

This worksheet is usually named Lock&Send.?” message. Click OK to the Clear Data confirmation message. From the main menu. Each exercise has a pre-built Excel workbook available.. you use the Spreadsheet Addin with Microsoft Excel to perform many of the steps. other worksheets used to retrieve selected data. Each workbook has: A worksheet with data required to support the specific exercise. you review the results. If unexpected results are retrieved. Possibly. select Database / Clear Data / All. Calculate the database using the Calc Script that you create to solve the exercise problem..3 Calculation Script Environment Hyperion Essbase Calc Scripts Reviewing Essbase Data Using Spreadsheet Add-in Once the database has been populated and the calc script has been executed. Hyperion . Retrieve the database results into the spreadsheet (Calc & Retrieve sheet). Exercise Procedures For the remaining exercises for this course. Clearing the Database (Application Manager): In the server window of Hyperion Essbase Application Manager. Populate the database with data in a spreadsheet (Lock & Send sheet). 3-14 H H H H H H H H H 1) 2) 3) 4) The general process for remaining exercises is: Clear the data in the database. This worksheet is usually named Calc&Retrieve. repair the Calc Script and repeat Calculation and Retrieve. Compare the results with the expected results. There are a number of tools available to retrieve Essbase data. A worksheet formatted to retrieve specific data from the updated Essbase database. select the application and database. Click Yes to the “Are you sure.

connect to the appropriate Essbase database. After connecting to the selected server. Username and Password. a list of all applications and databases available to the user from that server is displayed. Select Essbase / Lock. connect to the appropriate Essbase database.Hyperion Essbase Calc Scripts Calculation Script Environment 3 Connecting to the Essbase Database (Spreadsheet Add-in): 1) 2) In the desired worksheet. Select Essbase / Send. Click OK. In the Essbase Calculation dialog. In the Essbase System Login window. Running a Calc Script (Spreadsheet Add-in): 1) 2) 3) Select Essbase / Calculation. select Essbase / Connect. Click Essbase / Retrieve. Click OK at the message stating “Your calculation is finished”. select the Calc Script to be run. Hyperion 3-15 . Select the appropriate Application/Database combination from the list. (or double-click in an empty cell). Retrieving Essbase Data (Spreadsheet Add-in): 1) 2) In the desired worksheet. 3) Populating the Database (Spreadsheet Add-in): 1) 2) 3) In the desired worksheet. Click OK. provide the Server name. select Calculate.

Select the Lock&Send tab. you use the calc script created in the previous exercise. 3-16 Hyperion . Lock and send the data in the Lock&Send sheet to the HLandS1 database. It should contain the following statements: CALC DIM (Accounts).xls Clear the Essbase Database 1) In Essbase Application Manager. run the CSDemo calc script. You run the calc script and view results in a spreadsheet. Variance = @VAR (Actual. review the calc script CSDemo. Send the Spreadsheet Data to Essbase 5) 6) Connect to the Essbase server and select the Calc:HLandS1 database. 2) Correct any errors in the calc script if they exist. For this exercise. Budget). Review the Spreadsheet 3) 4) In Microsoft Excel. Run the Calc Script 7) From the Calc&Retrieve sheet. you use the following files: Database Calc Script Spreadsheet CALC:HLandS1 CSDemo SS_Demo. open SS_Demo from the <x>:\Hyperion\Essbase\App\Calc directory. You also are introduced to the application log and the messages written to the log during a calculation.3 Calculation Script Environment Hyperion Essbase Calc Scripts Exercise 3-2: Running Calc Scripts In this exercise.

The Log Viewer window displays. CSDemo: SET MSG SUMMARY. The View Log File dialog displays. Click OK. save.Hyperion Essbase Calc Scripts Calculation Script Environment 3 Retrieve the Updated Data 8) Perform a retrieval from the Essbase database and notice the calculation results. Click Date and in the drop-down list select today's date. and run the CSDemo calc script. close. Find and review the log entry that contains information regarding your calculation. Retrieve data in the Retrieve Variance sheet to check the variance calculation. What is the elapsed time for your calculation? _____ seconds. select Application / View Event Log. Close the Event Log Viewer window. 10) 11) 12) Modify and Run the Calc Script 13) Add the following command to the beginning of calc script. close the SS_Demo spreadsheet. and notice how the SET MSG SUMMARY command affects the log entries for the calculation. Scroll down to the bottom of the log entries. View the application log once again. In Microsoft Excel. 15) 16) Hyperion 3-17 . How many blocks were created by this calculation? ______ Blocks. Review the Application Log 9) In Essbase Application Manager From the server window. 14) In Essbase Application Manager.

mbrName2 . In other words. Notes The member is calculated according to the operations defined in the Essbase outline.3 Calculation Script Environment Hyperion Essbase Calc Scripts Calc Script Basics Member Calculations If.Member defined in the database outline whose results are to be calculated. the lower level members have been properly calculated first. in a calc script. If the member being calculated is dependent upon lower members that have missing values. be sure that when calculating. mbrName. mbrName1. (mbrName1. Syntax mbrName. mbrName2). 3-18 Hyperion . you reference a member name and follow the name with a semicolon. these values are treated as zero. the named member is calculated.

06. value2 . value1. Multiplies. Hyperion 3-19 .Member defined in the database outline whose results are to be calculated. Syntax mbrName = value1 <operator> value2. Ave = (“First Value” + “Second Value” + “Third Value”) / 3.member name within the same dimension as mbrName or constant value. For example. Valid mathematical operators: + * / % Adds. () Examples “Sales Tax” = Sales * . Member1%Member2 evaluates Member1 as a percentage of Member2. Divides.Hyperion Essbase Calc Scripts Calculation Script Environment 3 Arithmetic Operators The method by which to calculate a member may not be defined in the Essbase outline. mbrName . “Margin” = “Net Income” / “Gross Revenue”. The calculation method for the member can be defined in the calc script. “Sales Pct” = Sales % “Total Sales”. Subtracts. Evaluates percentage. Controls the order of calculations and nests equations and formulas.

A single comment can be split over multiple lines in the calc script source file using the /* characters. it ignores everything following it on that single line. When Essbase’s Calc Script interpreter encounters the opening comment characters. 3-20 Hyperion . or to provide other users with information about the calc script. When Essbase’s Calc Script interpreter encounters the opening comment characters. it ignores everything following it until the closing comment characters are encountered. Syntax /* Free form text */ or // Single-line of free form text The free-form text can be anything that you like. //.06. Examples // Sales Tax rate is 6% “Sales Tax” = Sales * . /*.3 Calculation Script Environment Hyperion Essbase Calc Scripts Adding In-line Documentation Comments can be added to your calc scripts to document your logic. /* Margin is calculated as Net Income divided by Gross Revenue */ “Margin” = “Net Income” / “Gross Revenue”.

Calc Script Command Categories The categories that contain Calc Script commands are: Data Declarations Control flow commands Functional Conditionals Hyperion H H H H A command template can be found by selecting its category: Command AGG ARRAY CALC CCONV CLEARBLOCK CLEARDATA DATACOPY ELSE ELSEIF ENDFIX Select Category Functional Data Declarations Functional Functional Functional Functional Functional Conditionals Conditionals Control Flow 3-21 . and a chapter is devoted to the specific commands in each category.Hyperion Essbase Calc Scripts Calculation Script Environment 3 Introduction to Calc Script Commands and Functions As described earlier. The categories are introduced here. clicking the Calc Script Editor functions button displays the Function Template dialog: Essbase calc script commands and Essbase functions are listed by specific categories.

3 Calculation Script Environment Hyperion Essbase Calc Scripts Command ENDIF ENDLOOP FIX IF LOOP SET VAR Select Category Conditionals Control Flow Control Flow Conditionals Control Flow Functional Data Declarations Essbase Functions Categories The categories that contain Essbase functions are: Boolean Relationship functions Math Member Set Range (Financial) Allocation Forecasting Statistical Date & Time Miscellaneous 3-22 H H H H H H H H H H A function template can be found by selecting its category: Function @ABS @ACCUM @ALLANCESTORS @ALLOCATE @ANCEST @ANCESTORS @ANCESTVAL @ATTRIBUTE @ATTRIBUTEBVAL Select Category Math Range (and Financial) Member Set Allocation Member Set Member Set Relationship Functions Member Set Relationship Functions Hyperion .

Hyperion Essbase Calc Scripts Calculation Script Environment 3 Function @ATTRIBUTESVAL @ATTRIBUTEVAL @AVG @AVGRANGE @CALCMODE @CHILDREN @COMPOUND @COMPOUNDGROWTH @CONCATENATE @CORRELATION @COUNT @CURGEN @CURLEV @CURRMBR @CURRMBRRANGE @DECLINE @DESCENDANTS @DISCOUNT @EXP @FACTORIAL @GEN @GENMBRS @GROWTH @IALLANCESTORS @IANCESTORS @ICHILDREN @IDESCENDANTS @ILSIBLINGS Select Category Relationship Functions Relationship Functions Math Range (and Financial) Miscellaneous Member Set Range (and Financial) Range (and Financial) Miscellaneous Statistical Statistical Relationship Functions Relationship Functions Member Set Range (and Financial) Range (and Financial) Member Set Range (and Financial) Math Math Relationship Functions Member Set Range (and Financial) Member Set Member Set Member Set Member Set Member Set Hyperion 3-23 .

3 Calculation Script Environment Hyperion Essbase Calc Scripts Function @INT @INTEREST @IRDESCENDANTS @IRR @IRSIBLINGS @ISACCTYPE @ISANCEST @ISCHILD @ISDESC @ISGEN @ISIANCEST @ISIBLINGS @ISICHILD @ISIDESC @ISIPARENT @ISISIBLING @ISLEV @ISMBR @ISPARENT @ISSAMEGEN @ISSAMELEV @ISSIBLING @ISUDA @LEV @LEVMBRS @LIST @LN @LOG Select Category Math Range (and Financial) Member Set Range (and Financial) Member Set Boolean Boolean Boolean Boolean Boolean Boolean Member Set Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Boolean Relationship Functions Member Set Member Set Math Math 3-24 Hyperion .

Hyperion Essbase Calc Scripts Calculation Script Environment 3 Function @LOG10 @LSIBLINGS @MATCH @MAX @MAXRANGE @MAXS @MAXSRANGE @MDALLOCATE @MDANCESTVAL @MDPARENTVAL @MDSHIFT @MEDIAN @MEMBER @MERGE @MIN @MINRANGE @MINS @MINSRANGE @MOD @MODE @MOVAVG @MOVMAX @MOVMED @MOVMIN @MOVSUM @MOVSUMX @NAME @NEXT Select Category Math Member Set Member Set Math Range (and Financial) Math Range (and Financial) Allocation Relationship Functions Relationship Functions Range (and Financial) Statistical Member Set Member Set Math Range (and Financial) Math Range (and Financial) Math Statistical Forecasting Forecasting Forecasting Forecasting Forecasting Forecasting Miscellaneous Range (and Financial) Hyperion 3-25 .

3 Calculation Script Environment Hyperion Essbase Calc Scripts Function @NEXTS @NPV @PARENT @PARENTVAL @POWER @PRIOR @PRIORS @PTD @RANGE @RANK @RDESCENDANTS @RELATIVE @REMAINDER @REMOVE @ROUND @RSIBLINGS @SANCESTVAL @SHIFT @SIBLINGS @SLN @SPARENTVAL @SPLINE @STDEV @STDEVP @STDEVRANGE @SUBSTRING @SUM @SUMRANGE Select Category Range (and Financial) Range (and Financial) Member Set Relationship Functions Math Range (and Financial) Range (and Financial) Range (and Financial) Member Set Statistical Member Set Member Set Math Member Set Math Member Set Relationship Functions Range (and Financial) Member Set Range (and Financial) Relationship Functions Forecasting Statistical Statistical Statistical Miscellaneous Math Range (and Financial) 3-26 Hyperion .

Hyperion Essbase Calc Scripts Calculation Script Environment 3 Function @SYD @TODATE @TREND @TRUNCATE @UDA @VAR @VARIANCE @VARIANCEP @VARPER @WITHATTR @XRANGE @XREF Select Category Range (and Financial) Date and Time Forecasting Math Member Set Math Statistical Statistical Math Member Set Member Set Relationship Functions Hyperion 3-27 .

You use the Spreadsheet Add-in to review the results. connect to the CALC:HLandS1 database. 3-28 Hyperion . and associate it with the HLandS1 outline. using the outline consolidation. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSSimple SS_Simple1. Review the contents This sheet contains data to populate Level-0 data items for Actual “Pre Tax Profit” for selected cities. Review the Spreadsheet 2) In Microsoft Excel. testing and modifying a simple calc script to calculate Account members (“Pre Tax Profit”. Select the Lock&Send tab.3 Calculation Script Environment Hyperion Essbase Calc Scripts Exercise 3-3: Member Calculations and Mathematical Operators This exercise guides you through creating. Note that all values for “Pre Tax Profit” are “#Missing”. and Commission using a simple mathematical operation). open SS_Simple1 from the <x>:\Hyperion\Essbase\App\Calc directory. Create a new calc script. For this exercise. 4) 5) Create and Run the Calc Script 6) 7) In Essbase Application Manager. products and months. retrieve the data from the Essbase database.xls Clear the Essbase Database 1) In Essbase Application Manager. From the Calc&Retrieve1 worksheet. Lock and send the data in the Lock&Send sheet to the HLandS1 database. clear all the data for the specified database. Send the Spreadsheet Data to Essbase 3) Connect to the Essbase server and select the CALC:HLandS1 database.

“Total Expenses”. Run the CSSimple calc script. In Essbase Application Manager.xls spreadsheet.) Correct and Run the Calc Script 13) In Essbase Application Manager.xls spreadsheet. Hyperion 3-29 .Hyperion Essbase Calc Scripts 8) 9) 10) 11) 12) Calculation Script Environment 3 In the new calc script file.814. click the Calc&Retrieve2 tab of the SS_Simple1. Do the “Pre Tax Profit” value now seem to be correct? (The “Pre Tax Profit” for “Round Bodied Floating” in Bridgeport for January 1999 should be 370. “Pre Tax Profit”.) Modify and Run the Calc Script 18) From the Calc&Retrieve2 worksheet. Retrieve the data from the Essbase database. Note that all values for Commission are “#Missing”. retrieve the data from the Essbase database. Do they seem to be correct? How was this value arrived at? (Hint . Verify the calc script. Run the CSSimple calc script. click the Calc&Retrieve1 tab of the SS_Simple1. There are now values for “Pre Tax Profit”. 14) 15) 16) 17) Verify and save the calc script. 19) 20) 21) Verify and save the calc script. “Regional Profit”. click the Calc&Retrieve1 tab of the SS_Simple1. In Microsoft Excel. Retrieve the data from the Essbase database. In Microsoft Excel. and save it as CSSimple. add a command to calculate: “Pre Tax Profit”. In Microsoft Excel. add the following to the end of the CSSimple Calc Script: Commission = .1 * Sales.review the data in the Lock&Send sheet.xls spreadsheet. modify the calc script file to be: “Margin”.

and retrieve the results until they are as expected. Close the Excel spreadsheet (but leave Excel. open). continue to correct and execute the Calc Script. If the expected results are not retrieved. 25) 3-30 Hyperion . The commissions. Hyperion Essbase Calc Scripts Retrieve the data from the Essbase database. calculated to be 10% of the sales.3 Calculation Script Environment 22) 23) 24) Run the CSSimple calc script. display.

You can type directly into the editor. or you can select appropriate functions and paste them to the edit window. Calc scripts can be created using Calc Script Editor in Essbase Application Manager. Hyperion 3-31 . Calc script syntax is both simple and powerful. By understanding the structure of a database and the nature of the tasks to be accomplished. which perform an action. These actions are not included in the database outline because they are designed to solve a specific analytical task or to make adjustments that do not affect the entire database. Calc scripts are made up of commands. you can solve almost any business-related calculation problem. Online Help provides detailed explanations and examples of functions. A calc script can also contain tests that direct how and under what conditions calculations are performed. A calc script can contain a single command or function or a variety of commands and functions. and functions. which return a value.Hyperion Essbase Calc Scripts Calculation Script Environment 3 Unit Summary You create calc scripts to perform specific actions on a database or a portion of a database.

“Profit Pct” = Profit % Sales. check your understanding by responding to the following questions: What are advantages of using the Calc Script Editor rather than creating your calc script in a text editor? 2) Describe what each of the following calc scripts statements do: a. January. /* Time dimensions are consolodated */ c.3 Calculation Script Environment þ Check Your Understanding 1) Hyperion Essbase Calc Scripts Now that you have completed the chapter. 3-32 Hyperion . b.

Hyperion 3-33 . January.Hyperion Essbase Calc Scripts Calculation Script Environment 3 þ Check Your Understanding Solutions 1) What are advantages of using the Calc Script Editor rather than creating your calc script in a text editor? The Calc Script Editor offers: • A mechanism for selecting functions from lists (instead of having to type them) • A mechanism for selecting dimensions and measures from the outline definition (instead of having to type them) • A syntax verification tool Describe what each of the following calc scripts statements do: a. “Profit Pct” = Profit % Sales. Calculates a member “Profit Pct” to be the “percent of Profit to Sales”. 2) Calculates the member “January”. c. b. /* Time dimensions are consolidated */ Places a comment (in-line documentation) in the Calc script.

3 Calculation Script Environment Hyperion Essbase Calc Scripts 3-34 Hyperion .

you will be able to: • • • • Create a calc member block Describe how to focus calculation areas using FIX...4 Calculation Script Commands Chapter Objectives By the end of this chapter.ENDIF and cross-dimensional operators Describe the basic commands used to create calc scripts Apply these commands to a series of incremental exercises ..ENDFIX.. IF.

Example These two blocks are produce the same results: Commission ( Sales * . the formula may be too complicated to present as a simple formula. Notes Formula for other members may be included within a single calculation block. In these situations. Here the calculation of Sales and “Net Sales” are calculated as a block. 4-2 H H Occasionally. Hyperion . By specifying a formula in the calc script.1. ). a calc member block structure is used. For example. Here the calculation defined for that member in the outline is used. ). For example: Sales ( Sales * . ). ). Syntax mbrname ( <calculation statement(s)>. The member is calculated using the formula in the calc script.9. Commission ( Commission = Sales * . the method to calculate a member’s value may be conditional depending upon the value of another member.1.4 Calculation Script Commands Hyperion Essbase Calc Scripts Calc Member Blocks The previous chapter outlined two ways that members can be calculated in a calc script: Simply by specifying the member name followed by a semi-colon.1 “Net Sales” = Sales * .

. Focusing Calculations Using Conditional Statements You can define formulas that use a conditional test or a series of conditional tests to control the flow of calculation. such as moving the value to February Actual Sales.ENDFIX structure Using conditional statements: IF. More complex statements are built by providing additional actions if a test proves false. you may want to use one set of parameters to calculate a portion of the database and a different set of parameters to calculate another portion.. In other analytical situations. It is also available on the Calc Script Editor toolbar.ELSE.. you can define a fixed range of members within a dimension...Hyperion Essbase Calc Scripts Calculation Script Commands 4 Focusing Calculations In many analytical situations. you do not want to calculate the entire database. 4-3 . Hyperion H H H Example SALES (SALES->BUDGET->JANUARY = SALES->ACTUAL->JANUARY.ENDIF Using the cross-dimensional operator (->) Focusing Calculations Using Fix. it isolates an area of the database to be calculated.... The calc member block association is required when a crossdimensional operator is used on the left side of a formula. There are three ways to focus calculations: Using the FIX.. Focusing Calculations Using the Cross-Dimensional Operator The cross-dimensional operator (->) isolates data values for specific member combinations. you use a cross-dimensional operator to capture a value for January Actual Sales.ENDFIX structure. you can perform calculations on the value.. For example.ENDFIX does not perform a calculation. The cross-dimensional formula is associated with a calc member block. You type the cross-dimensional operator by following a hyphen (-) with a greater-than sign (>). In the simplest form.. a conditional statement directs that processing be performed only if a test proves true..). FIX.. Do not leave spaces between the cross-dimensional operator and the member names. Sales.Endfix Using the FIX.ELSEIF. After you isolate this value..

in detail. 4-4 H H H H AGG Functional ARRAY CALC Data Functional CCONV Functional CLEARBLOCK Functional CLEARDATA Functional DATACOPY Functional FIX/ENDFIX Control Hyperion . Command & Category Use Prefaces a substitution variable in a calculation script. Calculates currency conversions (available if the optional Hyperion Essbase Currency Conversion product is installed. Calculates database values by simply consolidating the defined parent/child relationships and ignoring all member formulas.4 Calculation Script Commands Hyperion Essbase Calc Scripts Calc Script Commands Essbase provides a number of calc script commands to build and store calculation procedures. In general. In the Calc Script Editor. Calculates all or selected subsets of the database. which category each is associated with. Calc Script commands can be selected using the Functions button on the toolbar. in this chapter.). Specific Calc Script commands are found in one of four categories: Data Declarations Control flow commands Functional Conditionals Summary of Calc Script Commands This table presents a summary of the available calc script commands. and a brief description of the command’s use. Isolate a subset of the database for further processing. Declares one-dimensional array variables. Copies a range of data cells to another range within the database. Each command is also described. a calc script command is completed with a semicolon (.) Clears blocks of data and sets them to #MISSING Clears data values from the database and sets them to #MISSING.

Hyperion Essbase Calc Scripts Calculation Script Commands 4 Command IF/ ELSE/ ELSEIF/ ENDIF LOOP/ ENDLOOP SET Category Conditional Use Perform Boolean (logical) tests before performing a calculation. Declares a temporary variable containing a single value. Control Functional VAR Data Hyperion 4-5 . Change the Essbase calculation environment during the execution of the Calc Script. Specifies the number of times to repeat a series of calculations.

if the substitution variable &CurQtr has the value "Qtr1". 4-6 Hyperion . variableName .The name of the substitution variable set on the database. Syntax &variableName.4 Calculation Script Commands Hyperion Essbase Calc Scripts Detailed Description of Calc Script Commands & The & command prefaces a substitution variable in a calculation script. Example Usage &CurQtr. becomes Qtr1. Hyperion Essbase treats any string that begins with a leading & as a substitution variable and substitutes these variables with their values before it parses the calculation script.

Notes The AGG command is used for a limited set of high-speed consolidations. 2. it can only perform aggregations based on the database structure. An AGG command ignores all member formulas. Hyperion 4-7 .Scenario). Syntax AGG (dimList). Aggregate the dimension. using the AGG command. Calculate any members that are "leaf" members (that is.Market. If a member has a customized calculation defined in the outline. Calculate all other members with formulas that have not been calculated yet. level 0). AGG follows the rules for any defined FIX command. Although AGG is faster than any of the CALC commands when calculating sparse dimensions. it cannot calculate formulas. When a dimension contains fewer than six consolidation levels. Conversely. the formula is ignored and the result does not match the relationship defined by the database outline. it simply consolidates parent/child relationships. Example AGG(Market). The AGG command aggregates a list of sparse dimensions. the CALC command is usually faster on dimensions with six or more levels. If you want to aggregate a dimension that contains formulas: 1.Name of a single dimension or a comma-delimited list of sparse dimensions.Hyperion Essbase Calc Scripts Calculation Script Commands 4 AGG The AGG command consolidates database values. dimList . 3. The aggregation is based on the hierarchical relationship defined in the database outline. AGG is typically faster than CALC. AGG(Product.

constList . and called tmpProduct). ARRAY discount[Scenario]. arrayVariableName . tmpProduct[Product]. Example ARRAY discount[Scenario] = {1. As the member formula is processed. ARRAY Discount[Period] has 12 members). each value in the array is assigned as its member is evaluated in the calculation.Comma-delimited list of one or more array variable names. then the array values are set to #MISSING. You can calculate data for an array directly as part of a member formula.list of data values used to initialize the array variable(s). You must surround the dimName with brackets [ ] when using the ARRAY command. Which yields two arrays.Dimension whose size determines the size of the array variable. The variables are contained within the calc script and cease to exist after the calculation script ends. 4-8 Hyperion .4 Calculation Script Commands Hyperion Essbase Calc Scripts ARRAY The ARRAY command declares one-dimensional array variables. 2. 3. and called discount) and one of 9 members (corresponding to dimension Product. with the values 1 through 4 entered in those four entries. The order of the values corresponds to the order of the members in the dimension used to define the array. one of 4 members (corresponding to the dimension Scenario. Notes Typically. If no initialization is performed. The size of the array variable is determined by the corresponding dimension (for example. if dimension Period has 12 members. Syntax ARRAY arrayVariableName [dimName] = {constList}. 4}. dimName . Which yields an array of 4 entries. arrays are used to temporarily store variables as part of a member formula.

and CALC TWOPASS) allow for calculation of members that have been assigned specific calculation characteristics.Hyperion Essbase Calc Scripts Calculation Script Commands 4 CALC There are a number of variations of the CALC command. CALC ALL Low Level data loaded The CALC DIM commands allows the user to specify the dimension(s) to be calculated. data is loaded into lower levels of the database. 4-9 . CALC FIRST. The CALC commands calculate all or selected subsets of the database. Usually. CALC LAST. The description and syntax for the CALC commands are presented in three segments: CALC ALL CALC DIM CALC (others) Hyperion H H H The CALC ALL command allows for calculating the entire database. and the CALC command uses the outline consolidation formulas to calculate the remaining members. The remaining variations of the CALC command (CALC AVERAGE.

member set functions. or range functions. Syntax CALC ALL [EXCEPT DIM (dimList) | MBR (mbrList)]. CALC ALL EXCEPT DIM(Product). mbrList .Defines an exception list of dimensions or members that are to be excluded from the calculation.Comma-delimited list of dimensions.the exception list is a set of dimensions.the exception list is a set of members. EXCEPT .Comma-delimited list of members. except the Product dimension. DIM . dimList . Calculates all members. Notes Calculation order is determined by: Type of dimension (Accounts. The order in which dimensions are processed depends on the definitions of the various dimensions in the database outline. Example CALC ALL. Calculates all members according to the consolidation definitions. and user-defined dimensions) Dimension storage type (dense or sparse) Dimension order within the outline 4-10 H H H Hyperion . Time. MBR . according to the consolidation definitions.4 Calculation Script Commands Hyperion Essbase Calc Scripts CALC ALL The CALC ALL command calculates and aggregates the entire database based on consolidation attributes and member formulas in the database outline.

Here. Calc Dim (Markets. All of the dense dimensions are calculated first.Sparse1. The sparse dimensions are then calculated in the order in which they appear in dimList.Dense2). If your dimensions need to be calculated in a particular order. in the order that the dense dimensions appear in dimList. Calc Dim (Markets). To minimize the number of passes. DIM(Sparse1). use separate CALC DIM commands (see Notes for efficiency concerns): CALC CALC CALC CALC DIM(Dense1).Accounts). Sparse2. Calc Dim (Accounts). DIM(Dense2). Sparse1.Single dimension or comma-delimited list of dimensions to be calculated. Dense2. causes two passes through the database. DIM(Sparse2). Each CALC DIM statement forces Essbase to make a pass through the database. dimList .Sparse2. list a series of dimensions in a single CALC DIM statement. the calculation order would be: Dense1. Syntax CALC DIM (dimList). Example CALC DIM(Dense1. Hyperion 4-11 . causes one pass through the database.Hyperion Essbase Calc Scripts Calculation Script Commands 4 CALC DIM CALC DIM calculates the formulas and consolidations associated with all members of all specified dimensions. Notes The order of calculations depends on whether dimensions are dense or sparse.

in the second example. it gives you greater control. the procedural flow-Markets then Accounts-is followed. no matter where it appears in the list. 4-12 Hyperion . meaning that Markets are calculated before Accounts. Accounts is calculated first.4 Calculation Script Commands Hyperion Essbase Calc Scripts Although the second example causes two passes through the database. In the first example.

CALC LAST. it does not do a Time Series calculation on the dimension tagged as time. Note These commands calculate the members based on the dimension tagged as accounts only. All other member calculations are ignored during the processing of these commands. Hyperion 4-13 . All other member calculations are ignored during this process. The CALC AVERAGE command calculates all members tagged in the database outline as time balance Average or Average Non-Missing. The CALC LAST command calculates all members tagged in the database outline as time balance Last.Hyperion Essbase Calc Scripts Calculation Script Commands 4 CALC (others) CALC DIM calculates the formulas and consolidations associated with all members of all specified dimensions. The CALC TWOPASS command calculates all members tagged in the database outline as two-pass. CALC TWOPASS. The CALC FIRST command calculates all members tagged in the database outline as time balance First. for example. Syntax CALC AVERAGE. CALC FIRST.

a member from the CurType dimension in the currency database.Currency name containing the required exchange rate. 4-14 Hyperion . converted currency using the CCONV currExchMbr command. local currency using the CCONV TOLOCALRATE curType command. TOLOCALRATE . converts all the data values back to the local currencies using the Act xchg currency type from the currency database. You can convert the data values back to the original. Notes You convert data values from a local to a common. converts all the data values from local currency values (for example.4 Calculation Script Commands Hyperion Essbase Calc Scripts CCONV CCONV calculates currency conversions. French Francs and US$) to Japanese Yen using the YEN exchange rate from the currency database. currExchMbr . curType . This is a member from the currency database. local rate.Converts a converted currency back to the original. CCONV TOLOCALRATE "Act xchg". Example CCONV YEN.Currency type. This command is available only if your company has installed the optional Hyperion Essbase Currency Conversion product. Syntax CCONV currExchMbr | TOLOCALRATE curType.

NONINPUT . In this case. ALL . Hyperion Essbase clears only the data cells within the fixed range. Subsequent calculations against the same set of data take longer since Hyperion Essbase must pass through these additional data blocks. UPPER . CLEARBLOCK clears blocks before a calculation occurs.Clears blocks containing values derived from Dynamic Calc And Store member combinations.Clears all consolidated level blocks. If you use CLEARBLOCK within a FIX command. numerous consolidated level sections (blocks) are created. Hyperion 4-15 . DYNAMIC . you should use the NONINPUT option. If you regularly enter data values directly into a consolidated level.Clears all data blocks. CLEARBLOCK NONINPUT. When a database is initially calculated. and not the entire block. CLEARBLOCK DYNAMIC. CLEARBLOCK UPPER. the UPPER option overwrites your data.Hyperion Essbase Calc Scripts Calculation Script Commands 4 CLEARBLOCK The CLEARBLOCK command clears blocks of data and sets them to #MISSING. Notes CLEARBLOCK is especially useful when you want to optimize the calculation speed of a database. Examples CLEARBLOCK ALL. Syntax CLEARBLOCK ALL | UPPER | NONINPUT | DYNAMIC.Clears blocks containing values derived from calculations. which only clears blocks that contains calculated values.

which can improve performance. CLEARDATA does not clear blocks. select Database / Clear Data / ALL from the Application Manager main menu. Examples CLEARDATA Budget. To clear the entire database. mbrName . Notes CLEARDATA does not work if placed in an IF statement.4 Calculation Script Commands Hyperion Essbase Calc Scripts CLEARDATA The CLEARDATA command clears data values from the database and sets them to #MISSING. It cannot clear the entire database. 4-16 Hyperion . This command is useful when you need to clear existing data values before loading new values into a database. Syntax CLEARDATA mbrName. clears only Budget data for the Colas product family. CLEARDATA Budget->Colas. or a function that returns a single member or member combination. even if all data values in a block are #MISSING.Any valid single member name or member combination. CLEARDATA can only clear a section of a database. clears all Budget data. Use CLEARBLOCK if you wish to clear blocks from the database.

DATACOPY follows the rules for any defined FIX command. or a function that returns a single member or member combination. then by default the same member or members from mbrName1 are assumed to exist in mbrName2 to complete the range. The ranges specified by both mbrName1 and mbrName2 must be of the same size. Syntax DATACOPY mbrName1 TO mbrName2. Any dimension explicitly represented in mbrName2 MUST be represented by another member of the same dimension in mbrName1.Hyperion Essbase Calc Scripts Calculation Script Commands 4 DATACOPY The DATACOPY command copies a range of data cells to another range within the database. Hyperion 4-17 . mbrName2 .Any valid single member name or member combination. To reduce typing. mbrName1. Example DATACOPY Plan TO Revised_Plan. The size of the copied dimensions must be equal to the destination (TO) size. The same dimensions represented by the members that make up mbrName1 must also be present in mbrName2. if any dimension(s) represented by the members in mbrName1 are not represented in mbrName2. The reverse is not true. Notes This command is useful when you must maintain an original set of data values and perform changes on the copied data set.

Use the OR operator when only one of several conditions must be met. Command(s) .A member name or a list of members from any number of database dimensions. Commands encountered after ENDFIX are performed only when the calculation unit is completed.4 Calculation Script Commands Hyperion Essbase Calc Scripts FIX / ENDFIX The FIX structure is used to isolate a subset of the database. ENDFIX fixMbrs . Product. ENDFIX This calculates Year. Measures. FIX reduces I/O by evaluating data as it is brought into memory. When the FIX parameter references sparse dimensions. FIX commands can be nested within other FIX command blocks. (Use the AND operator when all conditions must be met. Data that does not pass the FIX test is not calculated and therefore is not brought into memory. Notes All commands between FIX and ENDFIX are executed as a calculation unit. fixMbrs can also contain: • AND/OR operators. Measures. Syntax FIX (fixMbrs) Command(s). Product and Market dimension for only the Budget scenario.The commands that you want executed for the duration of the FIX Example FIX (Budget) CALC DIM (Year.) Member set functions that build member lists based on other members • 4-18 Hyperion . Market). FIX and ENDFIX do not require semicolons because they do not perform calculations.

[statement4.]] ENDIF) mbrName .Operations that are to be performed if the “IF” test returns a FALSE value and the “ELSEIF” test returns a TRUE value statement5. statement6 .Member with which the formula is associated conditions . statement2 . statement4 .] [ELSEIF(condition2) statement3. Syntax mbrName (IF(condition1) statement1.]] [ELSE statement5.[statement2.[statement6.Hyperion Essbase Calc Scripts Calculation Script Commands 4 IF / ELSE / ELSEIF / ENDIF The IF conditional statements perform Boolean tests before performing a calculation.Formula or function that returns a Boolean value of TRUE (a nonzero value) or FALSE (a zero value) statement1.Operations that are to be performed if all conditional tests returns a FALSE value Hyperion 4-19 .Operations that are to be performed if the “IF” test returns a TRUE value statement3.

4

Calculation Script Commands

Hyperion Essbase Calc Scripts

Example

Commission (IF(Sales > 200000) Commission = Sales * .12; ELSEIF (Sales >= 100000) Commission = Sales * .098; ELSE Commission = Sales * .05; ENDIF);

If the value of sales is greater than 200,000, commission is calculated as 12% of Sales. Otherwise, if the value of sales is greater than 100,000, commission is calculated as 9.8% of Sales. Otherwise, commission is calculated as 5% of Sales.

Notes

When you use a conditional formula in a calc script, you must enclose it in parentheses and associate it with a member in the database outline. This is called a calc member block. The IF and ELSEIF statements introduce tests. When an IF test is true, the commands immediately following the test are executed, and control passes to ENDIF. If the test fails, execution falls to the ELSEIF test. If this test is true, the commands immediately following the ELSEIF are executed. Finally, all other circumstances are handled by the commands following the ELSE statement. You should not use a semicolon at the end of an IF command. If you use a semicolon, either an error occurs, or the progression of tests and commands does not execute as expected.

Logical Operators

Conditional statements are often made up using logical (comparison) operators. Valid logical operators include:

> >= < <= == < > or != Is greater than. Is greater than or equal to. Is less than. Is less than or equal to. Is equal to. Is not equal to.

4-20

Hyperion

Hyperion Essbase Calc Scripts

Calculation Script Commands

4

**Compound and complex logical tests can be created by using AND, OR and NOT:
**

AND Logical AND linking operator for multiple value tests. Result is TRUE if both conditions are TRUE. Otherwise the result is FALSE. Logical OR linking operator for multiple value tests. Result is TRUE if either condition is TRUE. Otherwise the result is FALSE. Logical NOT operator. Result is TRUE if condition is FALSE. Result is FALSE if condition is TRUE.*

OR

NOT

Example

IF ((Sales > 100000) AND (Returns <= 5000)

is true if the value of “Sales” exceeds 100,000 and the value of “Returns” does not exceed 5000.

Hyperion

4-21

4

Calculation Script Commands

Hyperion Essbase Calc Scripts

LOOP/ENDLOOP

The LOOP...ENDLOOP command block specifies the number of times to iterate calculations. All commands between the LOOP and ENDLOOP statements are performed the number of times that specified in the LOOP statement.

Syntax

LOOP (integer, [break]) Command(s); ENDLOOP integer - An integer constant that indicates the number of times to execute the commands contained in the loop block. break - parameter used to break the iterative process of a loop. break must be the name of a temporary variable (VAR). Setting the value of the variable to 1 during the execution of the loop causes the loop to break at the beginning of its next iteration. Command(s) - The commands that you want executed for the duration of the LOOP

Notes

LOOP is a block command that defines a series of commands for repeated execution. As with the FIX command, you can nest LOOP statements, if necessary. The ENDLOOP command ends a LOOP command block. It terminates the LOOP block and occurs after the commands in the LOOP block, but before any other commands. The use of LOOPs is a rare occurrence in Essbase Calculations.

4-22

Hyperion

Hyperion Essbase Calc Scripts

Calculation Script Commands

4

Example

VAR Break = 0; CALC DIM(MEASURES); LOOP(10,BREAK) PROFIT = SALES - (PROFIT * .10); COMMISSIONS = PROFIT - SALES; PROFIT( IF ((PROFIT <> #MISSING) AND (@ABS(.10*PROFIT-COMMISSIONS) < .001)) BREAK = 1; ENDIF) ENDLOOP

On the first line, the Break variable is set to 0. When tolerance reaches an appropriate point, you set Break to 1. The change causes looping to stop, even if the loop has not made its full 10 iterations. The solution of a simultaneous equation is contained in the loop structure. In the example, Profit is an unknown on both sides of the equation. The first equation, PROFIT = SALES - (PROFIT * 10) uses a substitution method to solve for Profit. A new value of profit is obtained by calculating commission on the old value of profit and subtracting it from sales. The second equation uses the new profit result of the first equation to calculate a new Commission. The conditional statement determines whether the absolute value of the difference of (10% of the new Profit) and Commission are within a tolerance of .001. If so, the “Break” variable is set to one, and this causes an exit of the loop before the next iteration.

✍

This is a simple example that illustrates the use of a Loop structure. It does not necessarily represent the best Calc Script solution for this particular problem.

Hyperion

4-23

4

Calculation Script Commands

Hyperion Essbase Calc Scripts

SET

Set commands allow the user to adjust the Essbase calculation environment during the execution of the Calc Script. There are a number of environmental parameters that can be set. SET commands in a calculation script are procedural. The first occurrence of a SET command in a calculation script stays in effect until the next occurrence of the same SET command. A description of each of the parameters for the Set command follows.

4-24

Hyperion

Hyperion Essbase Calc Scripts

Calculation Script Commands

4

SET AGGMISSG

The SET AGGMISSG command specifies whether Hyperion Essbase aggregates #MISSING values in the database.

Syntax

SET AGGMISSG ON | OFF;

Notes

The default behavior of SET AGGMISSG is determined by the global setting for the database, as described in the Database Administrator's Guide. SET AGGMISSG commands apply to calculating sparse dimensions and not to aggregating.

Hyperion

4-25

4

Calculation Script Commands

Hyperion Essbase Calc Scripts

SET CACHE

The SET CACHE command specifies the size of the calculator cache.

Syntax

SET CACHE HIGH | DEFAULT | LOW | OFF | ALL; HIGH, DEFAULT, LOW - Levels defining the size of the calculator cache. You set the values of HIGH, DEFAULT and LOW in the essbase.cfg file. If you do not set the value of DEFAULT in the essbase.cfg file, Hyperion Essbase uses a default value of 200,000 bytes. The maximum calculator cache size that you can specify is 200,000,000 bytes. OFF - Hyperion Essbase does not use a calculator cache. ALL - Hyperion Essbase uses a calculator cache, even when you do not calculate at least one full sparse dimension. Hyperion Essbase uses the calculator cache to create and track data blocks during calculation. Using the calculator cache significantly improves your calculation performance. The size of the performance improvement depends on the configuration of your database. You can choose one of three levels. The size of the calculator cache at each level is defined using the CALCCACHE{HIGH | DEFAULT | LOW} settings in the essbase.cfg file. The level you choose depends on the amount of memory your system has available and the configuration of your database. You can specify whether, by default, Hyperion Essbase uses a calculator cache using the CALCCACHE TRUE | FALSE setting in the essbase.cfg file. By default CALCCACHE is set to TRUE. Hyperion Essbase uses the calculator cache providing that: • • Your database has at least two sparse dimensions. You calculate at least one, full sparse dimension (unless you specify the CALCCACHE ALL option).

You can use this command more than once within a calculation script.

4-26

Hyperion

Hyperion Essbase Calc Scripts

Calculation Script Commands

4

SET CALCHASHTBL

The SET CALCHASHTBL command optimizes the calculation of large, flat database outlines.

Syntax

SET CALCHASHTBL ON|OFF;

Notes

The default setting is OFF. You can change this setting using CALCOPTCALCHASHTBL=TRUE in the essbase.cfg file. When you enable this feature, Hyperion Essbase uses a hash table to optimize use of the calculator cache for large, flat databases. A large flat database is, for example, a database in which one or members has over 5000 children. Using this feature may significantly improve the performance of a CALC ALL of the database or CALC DIM of the dimension containing the member with over 5000 children. You can set the limit of the hash table using the CALCHASHTBLMEMORY setting in the essbase.cfg file. This feature has no effect if you are using parallel calculation. .

Hyperion

4-27

Values 1-4 specifies parallel calculation with 1-4 threads. If you specify a value for appname and do not specify a value for dbname.Specifies that parallel calculation applies to all databases on the named application. Values less than 0 return an error. Notes Essbase analyzes each pass of a calculation to determine whether parallel calculation is possible. Values greater than 4 are interpreted as 4. you cannot specify a database. If you do not specify an application. specifies serial calculation: no parallel calculation takes place. If it is not. If you specify a value for dbname but do not include appname.4 Calculation Script Commands Hyperion Essbase Calc Scripts SET CALCPARALLEL SET CALCPARALLEL enables parallel calculation in place of the default serial calculation. 4-28 Hyperion . n . the parameter is ignored and parallel calculation is enabled for all applications and databases on the OLAP Server. A number of features are affected by parallel calculation. thus reducing opportunities for parallel calculation. dbname . and the setting applies to all applications and databases on the Essbase OLAP Server. the setting applies to all databases in the specified application. 0. appname .Specifies that parallel calculation applies only to the database named. specifying the number of threads to be made available for parallel calculation. If your outline generates many empty tasks.An integer from 0-4. Example SET CALCPARALLEL 3. This example enables up to three threads to be used to perform calculation tasks at the same time. Syntax SET CALCPARALLEL [appname [dbname]] n. consider setting the CALCTASKDIMS configuration setting to increase the number of tasks and to decrease the size of each task identified for parallel calculation. Essbase uses serial calculation even if CALCPARALLEL is set. The default value.

Hyperion 4-29 . For example you might want to set all applications to use serial calculation. This saves one processor for use either by the operating system or by the Essbase process that writes out dirty blocks from the calculator cache. but issue a calculation script command against a single application or database to use parallel calculation.Hyperion Essbase Calc Scripts Calculation Script Commands 4 Consider setting the value of CALCPARALLEL to one less than the number of available processors. You can use SET CALCPARALLEL to override a CALCPARALLEL entry in the configuration file.

you cannot specify a database. n . dbname . the potential number of parallel tasks is the product of the number of members of the selected dimensions.4 Calculation Script Commands Hyperion Essbase Calc Scripts SET CALCTASKDIMS SET CALCTASKDIMS specifies how many of the sparse dimensions in an outline are used to identify potential tasks that can be run in parallel. and the setting applies to all applications and databases on the Essbase OLAP Server. 1. Syntax SET CALCTASKDIMS [appname [dbname]] n. Notes Because each unique combination of members from the selected sparse dimensions is a potential task. If you specify a value for dbname but do not include appname. If you specify a value for appname and do not specify a value for dbname.Specifies that SET CALCTASKDIMS applies only to the database named. A value of 2.Specifies that SET CALCTASKDIMS applies to all databases on the named application. for example. Example SET CALCTASKDIMS Sample Basic 2. The default value. the last two sparse dimensions in the outline will be used to identify potential tasks to be performed at the same time during a calculation pass. appname . the setting applies to all databases in the specified application. the parameter is ignored. This example specifies that for application Sample and database Basic. indicates that the last and second-to-last sparse dimensions in the outline are used. 4-30 Hyperion . If you do not specify an application. Essbase issues an error if the value is less than 1. A value greater than the number of sparse dimensions in the outline is interpreted as the largest valid value. indicates that only the last sparse dimension in the outline will be used to identify tasks. The maximum value is the number of sparse dimensions in the outline. and parallel calculation is enabled for all applications and databases on the OLAP Server.An integer specifying the number of sparse dimensions to be included when Essbase identifies tasks that can be performed at the same time.

For example you might want to set all applications to use a single dimension for parallel calculation. Sometimes using more task dimensions can generate such a large number of tasks that performance may decrease instead of increase. Use this configuration setting only if your outline generates many empty tasks. consider returning it to its default value of 1. Hyperion 4-31 .Hyperion Essbase Calc Scripts Calculation Script Commands 4 Using the calculator bitmap cache can affect this value. because the overhead of generating and managing the tasks is too great. You can use SET CALCTASKDIMS to override a CALCTASKDIMS entry in the configuration file. but issue a calculation script command against a single application or database to use two dimensions. If you do not notice an improvement in performance after raising the value of CALCTASKDIMS. thus reducing opportunities for parallel calculation.

ENDFIX New York is a member on the sparse Market dimension.4 Calculation Script Commands Hyperion Essbase Calc Scripts SET CLEARUPDATESTATUS SET CLEARUPDATESTATUS specifies when Hyperion Essbase marks data blocks as clean. but disables calculation. Hyperion Essbase searches for dirty parent data blocks for New York (for example "New York"->Colas in which Colas is a parent member). because they are not calculated. When Hyperion Essbase does a full calculation of your database. even on a default calculation (CALC ALL. OFF . even if you are calculating a subset of your database. The existing clean or dirty status of the calculated data blocks remains unchanged. Example The following examples are based on the Sample Basic database. it marks the calculated data blocks as clean. Input blocks as clean. It calculates these dirty blocks based on the Product dimension and marks them as clean. Hyperion Essbase will not recalculate the data block on subsequent calculations.) of your database. SET CLEARUPDATESTATUS AFTER.Hyperion Essbase marks the specified data blocks as clean but does not actually calculate the data blocks. They assume that intelligent calculation is turned on (the default). When a data block is clean. provided that intelligent calculation is turned on. 4-32 Hyperion . Hyperion Essbase does not mark the child. The data blocks in your database have a calculation status of either clean or dirty. Notes This clean status is used during intelligent calculation. ONLY . Syntax SET CLEARUPDATESTATUS AFTER | ONLY | OFF. AFTER .Hyperion Essbase does not mark the calculated data blocks as clean. Data blocks are not marked as clean.Hyperion Essbase marks calculated data blocks as clean. FIX ("New York") CALC DIM(Product). This does the same as AFTER.

consider carefully the effect of the SET CLEARUPDATESTATUS AFTER command on your calculation. you may want to use the SET CLEARUPDATESTATUS AFTER command to ensure that the calculated blocks are marked as clean. Hyperion Essbase marks data blocks as clean only on a full calculation (CALC ALL. Hyperion 4-33 . If you calculate a subset of your database. If you do not use SET CLEARUPDATESTATUS. consider carefully the effect of this command on your calculation to ensure that your calculation results are correct.Hyperion Essbase Calc Scripts Calculation Script Commands 4 To ensure the accuracy of your calculation results. Hyperion Essbase does not mark calculated data blocks as clean when you calculate a subset of your database.) or when Hyperion Essbase calculates all members in a single calculation pass through your database. However.

You can change this setting by using CALCOPTFRMLBOTTOMUP TRUE in the essbase. You might want to turn on this setting when using the CALC ALL.4 Calculation Script Commands Hyperion Essbase Calc Scripts SET FRMLBOTTOMUP The SET FRMLBOTTOMUP command optimizes the calculation of complex formulas on sparse dimensions in large database outlines. Syntax SET FRMLBOTTOMUP ON|OFF. Forcing a bottom-up calculation on a formula may produce results that are inconsistent with a top-down calculation if: • • The formula contains complex functions (for example. 4-34 Hyperion . be sure to check the validity of calculation results produced when the command is enabled (set to ON). Example Notes The default setting is OFF. This command tells Hyperion Essbase to perform a bottom-up calculation on formulas that would otherwise require a top-down calculation. range functions) The formula's dependencies are not straightforward Before using the SET FRMLBOTTOMUP command in a production environment. This command optimizes the calculation of complex formulas on sparse dimensions in large database outlines. and CALC DIM.cfg file. commands to calculate the database.

Notes You can choose one of three levels.Levels defining the number of blocks that Hyperion Essbase can address concurrently.cfg file. you may want to set a number higher than 100 if you are consolidating very large numbers of children in a formula calculation. Hyperion Essbase locks the block along with the blocks containing its children. DEFAULT. This is sufficient for most database calculations. When a block is calculated. By default Hyperion Essbase allows up to 100 blocks to be locked (addressable) concurrently when calculating a block. However. LOW . This setting ensures that Hyperion Essbase can address all the required blocks when calculating a data block and that performance will not be impaired. Syntax SET LOCKBLOCK HIGH | DEFAULT | LOW.Hyperion Essbase Calc Scripts Calculation Script Commands 4 SET LOCKBLOCK The SET LOCKBLOCK command specifies the maximum number of blocks that Hyperion Essbase can address concurrently when calculating a sparse member formula. Hyperion Essbase calculates the block and then releases it along with the blocks containing its children. HIGH. The number of blocks that can Hyperion Essbase can address at each level is defined using the CALCLOCKBLOCK setting in the essbase. Hyperion 4-35 .

Displays only error messages. depending on the database size. Syntax SET MSG SUMMARY | DETAIL | ERROR | WARNS | INFO | NONE | ONLY. and error messages. You may disregard any error message during validation that indicates Essbase does not recognize command. and written Data cells calculated DETAIL . It causes a high processing overhead and therefore should be used during test calculations only. Notes The SET MSG command applies only to the calculation script in which it is used. 4-36 Hyperion . they are still displayed.4 Calculation Script Commands Hyperion Essbase Calc Scripts SET MSG The SET MSG command indicates the level of messaging that you wish to receive / review during your calculations. WARNS . In addition. NONE . it displays a detailed information message every time Hyperion Essbase calculates a data block.Instructs Essbase to perform a simulated calculation only.Displays only warning and error messages. read.Displays no messages during the life of the calculation script. SET MSG SUMMARY causes a processing overhead of approximately 1% to 5%. SET MSG DETAIL is useful for testing your database's consolidation path. warning.Displays calculation settings and provides statistics on the number of: • • Data blocks created. However.Displays information. ERROR . ONLY . SUMMARY . because error messages may contain vital information.Provides the same information as SUMMARY. INFO .

cfg file. Hyperion Essbase notifies you when the calculation approximately reaches block 2000. If you do not set the value of DEFAULT in the essbase.000. 8. if there are 10.000 exist. Hyperion Essbase measures the interval by taking the number of data blocks already calculated as a percentage of the total number of possible data blocks in your database. For example. 4000. DEFAULT. Syntax SET NOTICE HIGH | DEFAULT | LOW. Hyperion Essbase uses a default value of 10.000 . However. For partial calculations and calculations with multiple passes through your database.Hyperion Essbase Calc Scripts Calculation Script Commands 4 SET NOTICE The SET NOTICE command monitors the progress of your calculation by providing completion notices at intervals during the calculation. except when used with a very small database. 6000.cfg file. The interval between notices is approximate. Completion notices do not significantly reduce the calculation performance. which provides 10 completion messages at 10% intervals during the calculation.Levels defining the frequency and number of completion notices.4. Hyperion 4-37 . and LOW using the CALCNOTICE setting in the essbase. Notes You can set the values of HIGH. then Hyperion Essbase displays only two notices. DEFAULT. HIGH.000 and 10.000 possible blocks and you specify 5 notices. if only the blocks 1. the interval between completion notices is very approximate.cfg file. LOW . You can specify the number of notices for each level using the CALCNOTICE setting in the essbase.

4 Calculation Script Commands Hyperion Essbase Calc Scripts Example If the essbase. 4-38 Hyperion .cfg file contains the following settings: CALCNOTICEHIGH 50 CALCNOTICEDEFAULT 20 CALCNOTICELOW 5 then. SET NOTICE DEFAULT. displays 50 completion notices at 2% intervals. in the calc script: SET NOTICE HIGH. displays 5 completion notices at 20% intervals. displays 20 completion notices at 5% intervals. SET NOTICE LOW.

If required. If a data block is clean. Hyperion Essbase calculates only dirty blocks. then Hyperion Essbase knows that the block does not need to be recalculated.Hyperion Essbase calculates all data blocks. Therefore. Hyperion 4-39 . you can change this default behavior using the SET CLEARUPDATESTATUS command in your calculation script. Syntax SET UPDATECALC ON | OFF. regardless of whether they have been updated.Hyperion Essbase Calc Scripts Calculation Script Commands 4 SET UPDATECALC The SET UPDATECALC command turns intelligent calculation on and off. such as updated data blocks and their dependent parents.Hyperion Essbase calculates only blocks marked as dirty OFF . By default. All data blocks in the database are marked as either clean or dirty. ON . the calculation is very efficient. Notes Using intelligent calculation. all data blocks are marked as clean after a full calculation of the database but not after a partial calculation of the database.

Notes The default is OFF. because Europe also contains countries that use other currencies. however. and Avignon. consolidate to France. Syntax SET UPTOLOCAL ON | OFF. all children of France. such as the cities Paris. all cities in France use the franc (FF) as the unit of currency. 4-40 Hyperion . you must use CCONV to convert the values to a master rate before consolidating. The following database outline example illustrates this situation: If you want to consolidate values above this level. Consolidation stops at this level.4 Calculation Script Commands Hyperion Essbase Calc Scripts SET UPTOLOCAL The SET UPTOLOCAL command restricts consolidations to those parents with the same defined currency. Nancy. Therefore. SET UPTOLOCAL ON has no effect on databases with no currency definitions. For example.

Hyperion 4-41 . varName . Notes You can also use a single VAR command to declare multiple variables by supplying a comma-delimited list of variable names. value . Declares a variable “Target” and initializes it to 1200. VAR commands can only be assigned values within a member calculation or when VAR is declared. “Break3“and initializes them to #Missing. VAR Break1. “Break2“. Syntax VAR varName [= value]. Break3. If a value is not declared. it is set to #MISSING. Break2.Hyperion Essbase Calc Scripts Calculation Script Commands 4 VAR The VAR command declares a temporary variable that contains a single value.Name of the temporary variable.parameter that declares the data value. The name of the variable cannot duplicate a database member name. Example VAR Target = 1200. Declares three variables “Break1”.

4 Calculation Script Commands Hyperion Essbase Calc Scripts Exercise 4-1: Focus Calculations using Fix / EndFix In this exercise.xls 1) 2) From Essbase Application Manager. Verify that the database calculated only the sales values for Albany. and Jan 1999. Ensure that the differences between the Essbase calculated sales and the spreadsheet calculated sales are zero. Lock and send the data in the Lock&Send sheet to the HLandS1 database. Buffalo. Note: Because this is a custom spreadsheet designed for the exercise. Save the calc script. you may see an Essbase message alerting you to unknown member names. Increase their sales by 15%. The Sales are increased by 15%. you use the FIX command to create a calc script to change sales values in the Budget scenario for the Albany and Buffalo markets for Jan 1999. Perform a retrieval and notice the calculation results. Open the SS_Fix spreadsheet. view the application log. clear all data from the HLandS1 database. Using the FIX command. Close the spreadsheet. Formulas are included within the Calc&Retrieve sheet to assist you. Then set your global options to not display unknown member names. 3) 4) 5) ✍ 6) 7) 8) 4-42 Hyperion . From Essbase Application Manager. create a new calc script that changes Budget Sales values for the Albany and Buffalo markets for Jan 1999. Select No to suppress additional messages. calling it CSFix. From the Calc&Retrieve sheet. Budget. run the CSFix calc script. For this exercise. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSFix SS_Fix.

Lock and send the data in the Lock&Send sheet into the HLandS1 database. Save the calc script as CSIF. revise the calc script and rerun the calculation. the commission is 8% of sales. For this exercise. 2) 3) 4) 5) 6) 7) 8) 9) Hyperion 4-43 . Use an IF statement to calculate commission based on margin percent. the commission should be 10% of sales. the commission is 10% of sales. you use the following files: Database Calc Script Calc Script (new) Spreadsheet CALC:HLandS1 CSDemo CSIF SS_IF. clear all data from the HLandS1 database. you use an IF statement to calculate commission based on margin percent. If margin percent is less than or equal to 15%. If margin percent is greater than 15 percent. If not. the commission should be 8% of sales. If margin percent is less than or equal to 15%. Open the SS_IF spreadsheet. Save the calc script as CSIF. Remove the line that does the variance calculation. Open the CSDemo calc script. Add a block to calculate the commission.Hyperion Essbase Calc Scripts Calculation Script Commands 4 Exercise 4-2: Focus Calculations using If / Else / Endif In this exercise. Ensure that the commission is being calculated correctly. Close the spreadsheet. If margin percent is greater than 15%. Perform a retrieval and notice the calculation results. From the Calc&Retrieve sheet.xls 1) From Essbase Application Manager. run the CSIF calc script.

clear all data from the HLandS1 database. For this exercise. 3) 4) 5) 6) 7) 4-44 Hyperion .xls 1) 2) From Essbase Application Manager. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSXDim SS_X_Dim. Perform a retrieval and notice the calculation results. Ensure that Feb 1999 sales values are calculated correctly. calling it CSXDim. Spreadsheet calculations are included in the Calc&Retrieve sheet to facilitate data verification. you use cross-dimensional operators within a calc script to calculate Budget Sales for Feb 1999 as a 10% increase of the Jan 1999 Budget Sales values. Close the spreadsheet.4 Calculation Script Commands Hyperion Essbase Calc Scripts Exercise 4-3: Focus Calculations using Cross-Dimensional Operators In this exercise. Save the calc script. Open the SS_X_Dim spreadsheet. Lock and send the data in the Lock&Send sheet into the HLandS1 database. Create a new calc script that uses cross-dimensional operators within a calc script to calculate Budget Sales for Feb 1999 as a 10% increase on the Jan 1999 Budget Sales values. run the CSXDim calc script. Ensure that the "Excel Calculation" results are identical to the "Feb 1999" results. From the Calc&Retrieve sheet.

while the LOOP…ENDLOOP command allows you to repeat a command as necessary. Conditional commands let you to control which formulas are executed within a given member calculation.. and test conditions and calculate a formula based on the success or failure of the test. The FIX…ENDFIX command can be used to restrict a calculation to a particular member or members....ELSEIF.ENDIF structure Functional commands allow you to consolidate an entire database or focus on a single dimension or a single member. These commands are composed of the IF. which allow you to define the calculation environment parameters. Control Flow commands are used to iterate a set of commands or to restrict the commands' effect to a specified subset (partition) database. Also included in the Functional commands are the SET commands. Essbase provides a number of commands that are used to create calculation scripts. CLEARBLOCK. These include the CALC.Hyperion Essbase Calc Scripts Calculation Script Commands 4 Unit Summary Calc member blocks treat a series of member computations as single block of calculations.. and set the initial values of.ELSE. temporary variables. Examples are ARRAY and VAR. There are four categories of Calc Script commands: Data Declarations Control flow commands Functional Conditionals Hyperion H H H H Data Declaration commands are used to declare. CLEARDATA and DATACOPY commands.. 4-45 .

Functional or Conditional) Command VAR FIX IF CALC SET Command Type 4-46 Hyperion . Control flow.4 Calculation Script Commands þ Check Your Understanding 1) Hyperion Essbase Calc Scripts Now that you have completed the chapter. identify the type of command (Data Declaration. check your understanding by responding to the following questions: For each of the following commands.

Hyperion Essbase Calc Scripts Calculation Script Commands 4 þ Check Your Understanding Solutions 1) For each of the following commands. Control flow. identify the type of command (Data Declaration. Functional or Conditional) Command VAR FIX IF CALC SET Command Type Data Declaration Control flow Conditional Functional Functional Hyperion 4-47 .

4 Calculation Script Commands Hyperion Essbase Calc Scripts 4-48 Hyperion .

5 Math Functions Chapter Objectives By the end of this chapter. you will be able to: • • Describe and demonstrate mathematical functions used in Calc Scripts Apply these mathematical functions to a series of incremental exercises .

Math functions can be broken into three basic categories: Simple arithmetic operations. such as: logarithms and exponentiation modulus arithmetic Those that perform operations on lists. such as: absolute values rounding. These functions return a numeric result that is based on supplied member values. Limiting scripts to Essbase functions ensures that all calc scripts use the same method. such as: summation and averaging selecting maximum or minimum value When performing statistical and financial manipulations. thus promoting consistency of data across the application. ✍ More complicated mathematically oriented functions are available in the Statistical Functions and in the Range (and Financial) Functions.5 Math Functions Hyperion Essbase Calc Scripts Transforming Values with Math Functions The mathematical functions used in calc scripts include many of the standard mathematical operations. truncation variance calculation factorial 5-2 H H H H H H H H More complicated arithmetic operations. use Essbase functions rather than formulas where possible. Hyperion .

and numeric expressions.Hyperion Essbase Calc Scripts Math Functions 5 Math Function Parameters There are common parameters associated with the various math functions: expression Member name or mathematical expression that generates a numeric value. this parameter indicates how missing and zero values are to be processed. The maximum value all values in a list. all of which return numeric values. in this chapter. Function @ABS @AVG @EXP Used to calculate The absolute value of number. The base-10 logarithm.Ignores all 0 and #MISSING values mbrName1. Used in conjunction with an expList. mbrName2 expList SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH Summary of Math Functions This table summarizes the Math Functions. Members from the same dimension whose results are to be calculated. The average of all values in a list. The maximum value all values in a list.Ignores all #MISSING values SKIPZERO . The natural logarithm (base e). The logarithm calculation to a specified base. functions.Includes in the operation all values specified in expList regardless of their content SKIPMISSING . @MAXS enables skipping of #MISSING and 0 values. The value of e (the base of natural logarithms) raised to a power.Ignores all 0 values SKIPBOTH . SKIPNONE . Comma-delimited list of members. Each function is also described. The factorial of number. in detail. The next lowest integer value of number. @FACTORIAL @INT @LN @LOG @LOG10 @MAX @MAXS Hyperion 5-3 . variable names.

The summation of all the values in a list. The minimum value all values in a list. The difference between two values. @MINS enables skipping of #MISSING and 0 values. The percent difference between two values. The modulus of a division operation of mbrName1 divided by mbrName2. The value of the decimal portion of expression. @MOD @POWER @REMAINDER @ROUND @SUM @TRUNCATE @VAR @VARPER 5-4 Hyperion . The value rounded to a specified number of digits. The value of the specified expression raised to power.5 Math Functions Hyperion Essbase Calc Scripts Function @MIN @MINS Used to calculate The minimum value all values in a list. The integer portion of expression. The modulus is the remainder for an integer quotient.

3 -6. In the example.3 6. you perform a test that yields either a positive or a negative value.7 -5.4 0.3 0.8 5. Syntax @ABS (expression) In some cases. Example ABS = @ABS(Value). This yields the following result: Value 6.3 -0.8 Usage A common use of @ABS is to test for tolerances.Hyperion Essbase Calc Scripts Math Functions 5 Detailed Description of Math Functions @ABS @ABS returns the magnitude of the expression as a positive number. Hyperion 5-5 . Whether the resulting tolerance is negative or positive is unimportant in this test.4 -0. when the only important factor is the magnitude of the number itself.7 5. you are testing the result of a simultaneous equation.8 Abs 6.8 5.

expList) Example West=@AVG(SKIPNONE.California:Nevada). This example produces the following results: Cola California Oregon Washington Utah Nevada West 678 160 130 130 76 234. Syntax @AVG (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH.5 Math Functions Hyperion Essbase Calc Scripts @AVG The @AVG() function calculates and returns the average of all values in a list.8 Diet Cola 145 150 #MI 170 #MI 93 5-6 Hyperion .

that is.5 EXP 44355.7 3. Hyperion 5-7 . the value of e (the base of natural logarithms) raised to the power of the specified expression. Syntax @EXP (expression) Example The following example is based on a variation of Sample Basic: EXP = @EXP(Value).5 -0.6 1 0.6 36.59823 2.606531 Note If the expression is less than -700 or greater than 700.Hyperion Essbase Calc Scripts Math Functions 5 @EXP The @EXP() function returns the exponent of a specified expression.648721 0. This example produces the following results: Value 10. Essbase returns #MISSING.718282 1.

.7 3. This example produces the following results: Value 10.6 1 0.5 Fact 362880 36.5 -0. If the expression is non-integer. The factorial of a number is equal to 1*2*3*. Syntax @FACTORIAL(expression) Examples Fact = @FACTORIAL(Value).5 Math Functions Hyperion Essbase Calc Scripts @FACTORIAL The @FACTORIAL() function returns the factorial of expression. 5-8 Hyperion .59823 1 1 #Missing Notes If the expression is larger than 189 or less than zero.* number.. Essbase calculates the factorial value for the integer portion of the expression. Essbase returns #MISSING.

3 -6.8 Int 6 5 -1 -1 -6 -7 Hyperion 5-9 .4 -0.7 -5.3 -0.Hyperion Essbase Calc Scripts Math Functions 5 @INT The @INT() function returns the next lowest integer value of expression. Syntax @INT (expression) Example Int = @INT(Value). This yields the following result: Value 6.8 5.

@LOG(Sales) is equivalent to @LOG10(Sales).1 100 1000 0 -10 LN_val -2. Essbase returns #MISSING. member combination. 2).30259 4. LOG_val = @LOG(Value.907755 #Missing #Missing LOG10_val -1 2 3 #Missing #Missing LOG_val -3. If the base is omitted.60517 6. less than or equal to 0.Single member specification.643856 9. Syntax @LN (expression) @LOG10 (expression) @LOG (expression. or close to 1. [base]) base (optional for LOG() function) .5 Math Functions Hyperion Essbase Calc Scripts @LN. or numeric expression. This example produces the following result: Value . The @LOG() function returns the logarithm (for the specified base) of the specified expression. Essbase calculates the base-10 logarithm of the specified expression.32193 6. 5-10 Hyperion . @LOG and @LOG10 functions are used to calculate and return logarithm values. Example LN_val = @LN(Value). @LOG10 The @LN. If the value of base is #MISSING. the @Log() function returns #MISSING. @LOG. LOG10_val = @LOG10(Value). The @LOG10() function returns the logarithm (base 10) of the specified expression. The @LN() function returns the natural logarithm (base e) of the specified expression.965784 #Missing #Missing Notes If expression less than or equal to 0.

Jan:Mar). expList) @MIN (expList) @MINS (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. Jan:Mar). Qtr1_MinS_Both = @MINS(SKIPBOTH. @MIN and @MINS @MAX. Qtr1_Min = @MIN(Jan:Mar). Qtr1_MinS_None = @MINS(SKIPNONE. Jan:Mar). The @MAXS and MINS functions permit skipping of #MISSING and 0 values. @MAXS. @MIN and @MINS are used to find the maximum and minimum values of a range.Hyperion Essbase Calc Scripts Math Functions 5 @MAX. Qtr1_MaxS_Both = @MAXS(SKIPBOTH. expList) Examples Qtr1_Max = @MAX(Jan:Mar). @MAXS. Qtr1_MaxS_None = @MAXS(SKIPNONE. Sales Jan Feb Mar Qtr1_Max Qtr1_MaxS_Both Qtr1_MaxS_None Qtr1_Min Qtr1_MinS_Both Qtr1_MinS_None 500 0 700 700 700 700 0 500 0 COGS #Missing 1500 2300 2300 2300 2300 #Missing 1500 #Missing Other -500 -350 0 0 -350 0 -500 -500 -500 Hyperion 5-11 . Jan:Mar). Syntax @MAX (expList) @MAXS (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH.

3 2.3 divisor 3 3. Syntax @MOD (mbrName1. The modulus is the remainder for an integer quotient.5 Math Functions Hyperion Essbase Calc Scripts @MOD @MOD function calculates the modulus (the remainder) of a division operation. mbrName2) Example Mod = @MOD(Value.2 3 3.8 0.3 5.1 5-12 Hyperion .3 -5.3 -2. divisor). The modulus is produced by dividing mbrName1 by mbrName2.2 3 3.8 6.1 -2.4 2. This example produces the following results: Value 6.3 -5.8 5.2 Mod 0.

Essbase returns #MISSING. Essbase returns #MISSING. 3) = 2744 @POWER (2. Syntax @POWER (expression. Hyperion 5-13 .Single member specification.Hyperion Essbase Calc Scripts Math Functions 5 @POWER The @POWER() function returns the value of the specified member or expression raised to power. 8) = 256 Notes If expression is negative. Examples @POWER(14. variable name. and if power is not an integer. function. If the value calculated by @POWER is an infinite number. power) power . or other numeric expression.

3 -6.7 -5.3 -0.8 5-14 Hyperion .5 Math Functions Hyperion Essbase Calc Scripts @REMAINDER The @REMAINDER() function returns the value the decimal portion of the expression.8 0.4 -0. This example produces the following results: Value 6.3 -0.4 -0.8 Remain 0.8 5.7 -0. Syntax @REMAINDER (expression) Example Remain = @REMAINDER(Value).3 -0.

an expression is rounded to the specified number of decimal places.31 -6. variable name.81 Hyperion 5-15 .82 5. Its default value is 0. [numDigits]) numDigits [optional] . If numDigits is 0.42135 -0.42 -0. If numDigits is greater than 0. A negative value for numDigits rounds an expression to a power of 10. In this way. or other numeric expression that provides an integer value.71 -5. 2). an expression is rounded to the nearest integer.31234 -6. @ROUND also acts as a scaling factor.80988 Round 7 5 0 -1 -5 -7 Round2 6. This yields the following results: Value 6. Round2 = @ROUND(Value.70688 -5. Syntax @ROUND (expression.32544 -0.33 -0.Hyperion Essbase Calc Scripts Math Functions 5 @ROUND @ROUND rounds expressions as indicated by the numDigits parameter. Example Round = @ROUND(Value).Single-member specification.82145 5.

5 Math Functions Hyperion Essbase Calc Scripts @SUM The @SUM() function returns the summation of all the values in a list. Syntax @SUM (expList) Example West = @SUM(California:Nevada). This example produces the following results: Cola California Oregon Washington Utah Nevada West 678 160 130 130 76 1174 Diet Cola 145 150 #MI 170 #MI 465 5-16 Hyperion .

This yields the following results: Value 6.70688 -5. Syntax @TRUNCATE (expression) Example Trunc = @TRUNCATE(Value).82145 5.Hyperion Essbase Calc Scripts Math Functions 5 @TRUNCATE @TRUNCATE returns only the integer portion of an expression.31234 -6.42135 -0.32544 -0.80988 Trunc 6 5 0 0 -5 -6 Hyperion 5-17 .

49754 -1. This function considers accounts that are tagged in the database outline as Expense and accounts tagged as No Expense and calculates the variance accordingly.49754 5-18 Hyperion .49601 -1.49601 1.80988 Value2 5. unless an account is tagged as "Expense".31234 Variance 1.82145 -6.82145 5. This yields the following results (assuming Value1 and Value2 do not represent “Expense Accounts”): Value1 6. member2) Example Variance=@VAR(Value1.5 Math Functions Hyperion Essbase Calc Scripts @VAR @VAR presents the difference between the values of two members. The variance (@VAR) is derived by subtracting mbrName2 values from mbrName1.32544 -5.31234 -6. Syntax @VAR (member1. in which case mbrName1 values are subtracted from mbrName2. Value2).32544 6.80988 -5.

09176 -21.31234 Variance % 28.32544 6.931 21. member2) Example “Variance %”=@VARPER(Value1. unless an account is tagged as Expense in which case the member1 percent value is subtracted from the member2 percent value.31234 -6. This yields the following results (assuming Value1 and Value2 do not represent “Expense Accounts”): Value1 6.82145 5.80988 -5.80988 Value2 5. Value2). This function considers accounts that are tagged in the database outline as Expense and accounts tagged as No Expense and calculates the variance accordingly. The percent variance (@VARPER) is derived by subtracting the percent value of member2 from the percent value member1. Syntax @VARPER (member1.Hyperion Essbase Calc Scripts Math Functions 5 @VARPER The @VARPER function returns the percent difference between the values of two members.1898 Hyperion 5-19 .99065 -28.32544 -5.82145 -6.

Ensure that the commission is calculated correctly. clear all data from your HLandS1 database. Perform a retrieval and note the calculation results. revise the calc script and rerun the calculation. 3) 4) 5) 6) 7) 8) 5-20 Hyperion . you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSMath SS_Math. From the Calc&Retrieve sheet. the “Average Sales” member stores the total sales for that city. For example. For this exercise. For level-1 market members (states). the “Average Sales” member stores the average of the sales for the cities of a state. Close the CSMath spreadsheet. The value is to be rounded to two decimals.5 Math Functions Hyperion Essbase Calc Scripts Exercise 5-1: Using Math Functions For level-0 market members (cities). Save the new script as CSMath. run the CSMath calc script. you use the @ROUND and @AVG functions within a calc script to calculate Connecticut’s “Average Sales”.xls 1) 2) From Essbase Application Manager. Open the SS_Math spreadsheet. and use the @ROUND function to round the calculated values to two decimal places. Lock and send the data in the Lock&Send sheet to the HLandS1 database. If not. Create a new calc script to calculate the “Average Sales” for Connecticut to represent the average amount of sales in the cities in Connecticut. In this exercise. the “Average Sales” for Connecticut is the total sales for Connecticut divided by the number of cities in Connecticut. Use the @AVG function.

use the Essbase functions rather than creating your own formulas. such as: logarithms and exponentiation modulus arithmetic There are also math functions that perform operations on lists. 5-21 .Hyperion Essbase Calc Scripts Math Functions 5 Unit Summary A wide range of mathematical functions is available for the creation of calc scripts. truncation variance calculation factorial Hyperion H H H H H H H H There are more complicated arithmetic operations. such as: absolute values rounding. These include simple arithmetic operations. such as: summation and averaging selecting maximum or minimum value To promote consistency throughout an application.

What is the value of the next lowest integer to number? Determine the minimum value in a list. excluding #MISSING and 0 values. identify the Math function that you apply. 5-22 Hyperion . check your understanding by responding to the following questions: For each of the following situations.5 Math Functions þ Check Your Understanding 1) Hyperion Essbase Calc Scripts Now that you have completed the chapter. Find the remainder when one number is divided by another to produce an integer quotient. Compute the average of a collection of values. Calculate the total of a series of values.

@SUM @AVG @INT @MINS @MOD Hyperion 5-23 . What is the value of the next lowest integer to number? Determine the minimum value in a list. identify the Math function that you apply. excluding #MISSING and 0 values.Hyperion Essbase Calc Scripts Math Functions 5 þ Check Your Understanding Solutions 1) For each of the following situations. Compute the average of a collection of values. Find the remainder when one number is divided by another to produce an integer quotient. Calculate the total of a series of values.

5 Math Functions Hyperion Essbase Calc Scripts 5-24 Hyperion .

you will be able to: • • Describe and demonstrate the use of Boolean functions to test values in a Calc Script Practice using boolean functions to a series of incremental exercises .6 Boolean Functions Chapter Objectives By the end of this chapter.

6 Boolean Functions Hyperion Essbase Calc Scripts Testing for Values Using Boolean Functions A Boolean function returns a value of TRUE (1) or FALSE (0). New York. or range functions Name of the specified dimension dimName 6-2 Hyperion . member set functions. Boston. Boston. The determination is based on the characteristics of the current member combination. the TRUE test includes the member specified in the parameter list. Not all tests can be performed with a single condition. and @ISIDESC(EAST) includes East. When a boolean function has a related “@ISI” function. and Chicago. @ISDESC(EAST) includes New York. Boolean functions are usually used within conditional statements. and NOT. Essbase provides three logical connectors for compound logical tests: AND. For example. and Chicago. OR. Boolean Function Parameters There are common parameters associated with the various boolean functions: mbrName mbrList rangeList Single-member specification Comma-delimited list of members Colon-delimited range of members. When a boolean function begins with @ISI. you may want to test whether current member California is in a list of members so that you can adjust salary to match California's higher cost of living. the detailed description section of this chapter presents them together. For example.

Hyperion Essbase Calc Scripts Boolean Functions 6 Summary of Boolean Functions This table summarizes the Boolean Functions. Each function is also described. in detail. or the specified member itself? Is the current member at the specified dimension level? Is calculation being done for the specified member? Is the current member the parent of the specified member? Is the current member the same generation as the specified member? Is the current member the same level as the specified member? @ISANCEST @ISCHILD @ISDESC @ISGEN @ISIANCEST @ISICHILD @ISIDESC @ISIPARENT @ISISIBLING @ISLEV @ISMBR @ISPARENT @ISSAMEGEN @ISSAMELEV Hyperion 6-3 . Function @ISACCTYPE Tests Does current member have the specified accounts tag? Is the current member an ancestor of the specified member? Is the current member a child of the specified member? Is the current member a descendant of the specified member? Is the current member at the specified dimension generation Is the current member an ancestor of the specified member. or the specified member itself? Is the current member a child of the specified member. or the specified member itself? Is the current member a sibling of the specified member. or the specified member itself? Is the current member the parent of the specified member. or the specified member itself? Is the member being calculated a descendant of the specified member. in this chapter.

6 Boolean Functions Hyperion Essbase Calc Scripts Function @ISSIBLING Tests Is the current member a sibling of the specified member? Does the current member of the specified dimension have the specified user-defined attribute (UDA) at the time of the calculation? @ISUDA 6-4 Hyperion .

Expense. ENDIF.Valid account tag defined in the current database. and TwoPass. Syntax @ISACCTYPE(tag) tag .Hyperion Essbase Calc Scripts Boolean Functions 6 @ISACCTYPE The @ISACCTYPE() function returns TRUE if the current member has the specified accounts tag. Hyperion 6-5 . For members with the Expense accounts tag. Average. Any of the following tags may be used: First. IF (@ISACCTYPE(Expense)) Budget = @ABS(Budget). the formula uses the @ABS function to calculate Budget as the absolute value of Budget. Last. Example The following example is based on the Sample Basic database.

This function excludes the specified member. Market. West.6 Boolean Functions Hyperion Essbase Calc Scripts @ISANCEST. East. @ISIANCEST(California) returnsTRUE for California. West. Syntax @ISANCEST(mbrName) @ISIANCEST(mbrName) Example In the Sample Basic database: @ISANCEST(California) returns TRUE for Market. @ISIANCEST(West) returns FALSE for California. @ISANCEST The @ISANCEST() function returns TRUE if the current member is an ancestor of the specified member. East. @ISANCEST(West) returns FALSE for California. 6-6 Hyperion . West. The @ISIANCEST() function returns TRUE if the current member is the specified member or an ancestor of the specified member.

@ISICHILD(Margin) returns FALSE for Measures. Connecticut. Hyperion 6-7 .Hyperion Essbase Calc Scripts Boolean Functions 6 @ISCHILD. Margin. Florida. @ISCHILD(Margin) returns FALSE for Measures. The @ISICHILD() function returns TRUE if the current member is the specified member or a child of the specified member. Florida. Profit. This function excludes the specified member. East. Syntax @ISCHILD(mbrName) @ISICHILD(mbrName) Example In the Sample Basic database: @ISCHILD(East) returns TRUE for New York. @ISICHILD The @ISCHILD() function returns TRUE if the current member is a child of the specified member. @ISICHILD(East) returns TRUE for New York. Connecticut. Profit.

Syntax @ISDESC (mbrName) @ISIDESC (mbrName) Example Payroll (IF(@ISDESC(East) OR @ISDESC (West)) Payroll = Sales * . If the current member on the Market dimension is a descendant of Central. ELSE Payroll = Sales * . ELSEIF (@ISDESC (Central)) Payroll = Sales * . @ISIDESC The @ISDESC function returns TRUE if the member being calculated is a descendant of the referenced member. ENDIF) The example operates as follows: The IF condition uses @ISDESC to determine whether the member of the Market dimension being calculated is a descendant of either East or West. @ISIDESC returns TRUE if the member being calculated is a descendant of the referenced member. Payroll is calculated by multiplying the value in Sales by 0. The @ISDESC function excludes the specified member.6 Boolean Functions Hyperion Essbase Calc Scripts @ISDESC. If the current member is not a descendant of East.11.10.11. If the member being calculated on the Market dimension is a descendant of East or West. 6-8 Hyperion . Payroll is calculated by multiplying value in Sales by 0. Payroll is calculated by multiplying the value in Sales by 0. or the member itself.15.15. West.10. If the current member is not a descendant of East or West. or Central. the ELSEIF condition uses the @ISDESC function to determine whether the current member is a descendant of Central.

Generation name that defines the number of a generation. Total Inventory.A non-negative number that defines the number of a generation. Hyperion 6-9 .Hyperion Essbase Calc Scripts Boolean Functions 6 @ISGEN The @ISGEN() function returns TRUE if the current member of the specified dimension is in the specified generation.3) returns TRUE if the current member is Margin. because these members are all in generation 3 of the Measures dimension. or Margin %.”East”) returns TRUE if the current member is East. or genNum . Syntax @ISGEN(dimName. Example In the Sample Basic database: @ISGEN(Measures. @ISGEN(Market. genName | genNum) genName . South or Central because these members are not in the same Market dimension generation as East. West.

Member specification. or numeric expression (The numeric expression provides an integer value equal to or greater than 0. use @ISLEV to isolate the calculation.) Example IF (@ISLEV("Market". thus preventing the default aggregation behavior. “Florida”. “California”. Notes Using @ISLEV can significantly reduce calculation time. level) level . 6-10 Hyperion . returns FASLE if the current member is East because East has children and therefore is a Level 1 member. Syntax @ISLEV (dimName. To prevent this. If a lower-level formula is calculated. because these members are all in level 0 of the Market dimension. The @ISLEV function determines position within a hierarchy and is particularly useful when working with asymmetric hierarchies. all higher levels are aggregated by default.6 Boolean Functions Hyperion Essbase Calc Scripts @ISLEV The @ISLEV function returns TRUE if the current member (the member being calculated) of the specified dimension is at the specified level. variable name. 0)) • • returns TRUE if the current member is “New York”. and identifies the level. etc.

Texas) FALSE for Connecticut. ELSEIF (@ISMBR(Budget)) Commission = 100. the term evaluates as TRUE only if all the cross-dimensional member's components match the current member list. a range of members. results such as the following are returned (for the Sample Basic database): @ISMBR(“New York”:”New Hampshire”) TRUE for Connecticut. A single member. or a discrete list of members may be specified.Oregon. Notes If you examine the contents of a range or list of values.Hyperion Essbase Calc Scripts Boolean Functions 6 @ISMBR The @ISMBR function returns TRUE if any specified member matches the member being calculated. Hyperion 6-11 . ENDIF) The example syntax calculates different values for Commission for Actual and Budget. Syntax @ISMBR (mbrName | rangeList | mbrList) Example Commission (IF @ISMBR(Actual) Commission = Sales *.10. If a cross-dimensional (->) member term is included. @ISMBR(“New York”.

Profit. @ISPARENT(Profit) returns FALSE for Margin. New York. This function excludes the specified member. @ISIPARENT("New York") returns TRUE for East. The @ISIPARENT() function returns TRUE if the current member is the specified member or the parent of the specified member. 6-12 Hyperion . @ISIPARENT The @ISPARENT() function returns TRUE if the current member is the parent of the specified member.6 Boolean Functions Hyperion Essbase Calc Scripts @ISPARENT. Syntax @ISPARENT(mbrName) @ISIPARENT(mbrName) Example In the Sample Basic database: @ISPARENT("New York") returns TRUE for East. @ISIPARENT(Profit) returns FALSE for Margin.

@ISSAMELEV(Jan)returns TRUE for Apr. Syntax @ISSAMELEV(mbrName) Example In the Sample Basic database: @ISSAMELEV(Sales)returns FALSE for Total Expenses . Syntax @ISSAMEGEN(mbrName) Example In the Sample Basic database: @ISSAMEGEN(West)returns TRUE for East. @ISSAMEGEN(West)returns FALSE for California.Hyperion Essbase Calc Scripts Boolean Functions 6 @ISSAMEGEN The @ISSAMEGEN() function returns TRUE if the current member is the same generation as the specified member. Oct. Hyperion 6-13 . Jul. @ISSAMELEV The @ISSAMELEV() function returns TRUE if the current member is the same level as the specified member.

The @ISISIBLING() function returns TRUE if the current member is the specified member or a sibling of the specified member. New Hampshire. Sales. @ISISIBLING("New York")returns TRUE for Florida.6 Boolean Functions Hyperion Essbase Calc Scripts @ISSIBLING. @ISISIBLING(Sales)returns FALSE for Margin. This function excludes the specified member. New York. New Hampshire. Syntax @ISSIBLING(mbrName) @ISISIBLING(mbrName) Example In the Sample Basic database: @ISSIBLING("New York")returns TRUE for Florida. @ISISIBLING The @ISSIBLING() function returns TRUE if the current member is a sibling of the specified member. @ISSIBLING(Sales)returns FALSE for Margin. 6-14 Hyperion .

Example This example is based on the Sample Basic database. If it does not. Some members represent major markets.2. the Budget->Sales value is set to 110% of Actual->Sales. ENDIF. Syntax @ISUDA(dimName. the Budget->Sales value is set to 120% of Actual->Sales. ENDFIX This example tests to see if the current member of Market has a UDA called "Major Market".user-defined attribute (UDA) name string."Major Market")) Sales = Sales->Actual * 1.Hyperion Essbase Calc Scripts Boolean Functions 6 @ISUDA The @ISUDA() function returns TRUE if the specified user-defined attribute (UDA) exists for the current member of the specified dimension at the time of the calculation.). The Market dimension has members that indicate a geographic location. The example below calculates the database and stores a budget amount for the upcoming year based on the actual amount from this year. If it does.1. FIX (Budget) Sales (IF(@ISUDA(Market. A different sales growth rate is applied to major markets than to small markets.UDAStr) UDAStr . Hyperion 6-15 . ELSE Sales = Sales->Actual * 1.

ENDIF) Usage When using compound IF statements.0))) "TAX RATE" = ("TAX PROVISION"/"PRE TAX INCOME") * 100. ENDIF) Some conditional Boolean statements can be complex: "TAX RATE" (IF(NOT(@ISLEV(GEOGRAPHY. Be careful when using NOT and when placing parentheses. Refer to the following table to reinforce your understanding of logical connectors: Condition1 Condition2 Condition1 Condition1 NOT (Condition1) AND Condition2 True True False False True False True False True False False False OR Condition2 True True True False False False True True Examples Note the use of the NOT connector in the first example: COMMISSION (IF(NOT(@ISUDA(SCENARIO.6 Boolean Functions Hyperion Essbase Calc Scripts Using Logical Connectors with Boolean Functions Although the use of logical connectors is straightforward.0) AND @ISLEV(TIME. as in the second example."MYUDA"))) COMMISSION = 100. placement of parentheses is very important. 6-16 Hyperion . you should be careful of compound conditions.

Hyperion Essbase Calc Scripts Boolean Functions 6 Exercise 6-1: Using Boolean Functions In this exercise. Lock and send the 1999 Actual Sales data in the Lock&Send sheet to the HLandS1 database. Save the new script as CSBool. Create a new calc script to calculate the 2000 budgeted product sales for all cities. and 2000 sales for cities in the Central region to decrease by 5% from actual 1999 sales. Close the SS_Bool spreadsheet. Perform a retrieval and compare the calculation results to the Expected Values column. 2000 sales for cities in the East and West to increase by 10% over actual 1999 sales. Open the SS_Bool spreadsheet. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSBool SS_Bool. The company expects 2000 sales for cities in the South to increase by 15% over actual 1999 sales. 2000 sales for cities in the East and West to increase by 10% over actual 1999 sales. you use the @ISDESC function within a calc script to calculate the budgeted product sales for all cities. The company projects 2000 sales for cities in the South to increase by 15% over actual 1999 sales. clear all data from your HLandS1 database. If not. and 2000 sales for cities in the Central region to decrease by 5% from actual 1999 sales. 3) 4) 5) 6) 7) 8) Hyperion 6-17 . Ensure that the projected sales are calculated correctly. run the CSBool calc script. revise the calc script and rerun the calculation. For this exercise.xls 1) 2) From Essbase Application Manager. From the Calc&Retrieve sheet.

Many conditional statements use Boolean functions to identify characteristics of the member for which calculations are currently being performed. Compound conditions can also be created by using: • • logical connectors: AND. OR and NOT parenthesis to control the logical interpretation 6-18 Hyperion .6 Boolean Functions Hyperion Essbase Calc Scripts Unit Summary Tests can be performed on data using if-logic of the conditional statements.

Hyperion Essbase Calc Scripts Boolean Functions 6 þ Check Your Understanding Now that you have completed the chapter. only? Perform a calculation for East. Hyperion 6-19 . Perform a calculation for all accounts that are identified as “Expense”. identify the Boolean function that you would use to isolate the required members. Perform a calculation for all level one members of the Market Dimension. Use the Sample Basic outline. and all the cities in the East market. Perform a calculation for “New York”. check your understanding by responding to the following questions: 1) For each of the following situations. East and Market. only. Perform a calculation for “New York”.

and all the cities in the East market.6 Boolean Functions þ Check Your Understanding Solutions 1) Hyperion Essbase Calc Scripts For each of the following situations. Perform a calculation for all level one members of the Market Dimension. Use the Sample Basic outline. East and Market. identify the Boolean function that you would use to isolate the required members. Perform a calculation for all accounts that are identified as “Expense”. only. only? Perform a calculation for East. Perform a calculation for “New York”. Perform a calculation for “New York”. @ISMBR @ISICHILD @ISLEV @ISIANCEST @ISACCTYPE 6-20 Hyperion .

Hyperion Essbase Calc Scripts Boolean Functions 6 Hyperion 6-21 .

6 Boolean Functions Hyperion Essbase Calc Scripts 6-22 Hyperion .

7 Member Set Functions Chapter Objectives By the end of this chapter. you will be able to: • • Explain the purpose and use of member set functions to generate member lists Practice using the member set functions in a series of incremental exercises .

Single dimension name specification. the generated list includes the referenced member and the requested members. If a generation or level number is required. if @DESCENDANTS(EAST) includes New York. and Chicago. @RELATIVE Generation and level member sets generate a list of members based upon a generation or level number. mbrName2 genLevNum An integer value that defines the generation or level number from which the ancestor value is returned. @LEVMBRS. the current calculation position affects the returned list.7 Member Set Functions Hyperion Essbase Calc Scripts Generating Lists Using Member set Functions A member set function generates a list of members based on the criteria provided as arguments. and @IDESCENDANTS(EAST) includes East. for example. Boston. When a member set function begins with an “@I”. if the parameter of the other function can be list of members. A member set function can be used as a parameter of another function. A value of 0 or a negative integer defines a level number. mbrName1. For example. this can be used to resolve issues of data that may be constantly changing and to avoid hard-coding of member lists. Member set functions can be broken into three basic categories: Family member sets generate a list of members based upon a hierarchical relationship. for example. New York. Obviously. 7-2 Hyperion . Boston. Member Set Function Parameters There are common parameters associated with the various member set functions: dimName mbrName. @DESCENDANTS. Using a member set function in conjunction with the FIX command fixes on a list of members. such as performing a search on a wild card pattern. Other member sets generate lists in a variety of ways. @UDA. for example. @GENMBRS. and Chicago. A positive integer defines a generation number. @CHILDREN. @SIBLING. Specifies a single member. The member list is generated dynamically at the time the member set function is executed. @MATCH. thus reducing the need to hard-code member names.

including ancestors of any occurrences of the specified member as a shared member. All members in the level immediately below the specified member. The specified member and all members in the level immediately below the specified member. All ancestors of the specified member or those up to the specified generation or level. in this chapter. All members with the specified generation number or generation name in the specified dimension. The member that is currently being calculated in the specified dimension. The specified member and all members that share the same parent as that member and that follow that member in the database outline. Each function is also described. All descendants of the specified member. The ancestor at the specified generation or level in the specified dimension of the current member being calculated. The specified member and all the ancestors of that member. Function @ALLANCESTORS Used to generate a list containing All the ancestors of that member. @ANCEST @ANCESTORS @ATTRIBUTE @CHILDREN @CURRMBR @DESCENDANTS @GENMBRS @IALLANCESTORS @IANCESTORS @ICHILDREN @IDESCENDANTS @ILSIBLINGS @IRSIBLINGS Hyperion 7-3 .Hyperion Essbase Calc Scripts Member Set Functions 7 Summary of Member Set Functions This table summarizes the Member Set Functions. The specified member and all ancestors of the specified member or those up to the specified generation or level. or those down to the specified generation or level. including ancestors of any occurrences of the specified member as a shared member. All base members that are associated with the specified attribute member. The specified member and all members that share the same parent as that member and precede that member in the database outline. in detail. or those down to the specified generation or level. The specified member and all descendants of the specified member.

The specified member and all siblings of that member. All members with the specified level number or level name in the specified dimension. A collection of individual items that are to be passed to functions that require list arguments. All descendants of the specified member (including descendants of shared members). or those down to the specified generation or level. All members at the specified generation or level that are above or below the specified member in the database outline. A list from which with selected values have been removed. All members whose names match a specified pattern. All members that share the same parent as the specified member and precede that member in the database outline. A member list that crosses the specified member from one dimension with the specified member range from another dimension. All base members that are associated with an attribute that satisfies a specified condition.7 Member Set Functions Hyperion Essbase Calc Scripts Function @IRDESCENDANTS Used to generate a list containing The specified member and all descendants of the specified member (including descendants of shared members). All siblings of the specified member. The union of two member lists that are to be passed to another function. The parent of the current member being calculated in the specified dimension. All members that share the same parent as the specified member and that follow that member in the database outline. @ISIBLINGS @LEVMBRS @LIST @LSIBLINGS @MATCH @MEMBER @MERGE @PARENT @RANGE @RDESCENDANTS @RELATIVE @REMOVE @RSIBLINGS @SIBLINGS @UDA @WITHATTR 7-4 Hyperion . The member with the name that is provided as a character string. Members with a common user-defined attribute (UDA). or those down to the specified generation or level.

Hyperion 7-5 .1. * New in Essbase XTD Release 6.Hyperion Essbase Calc Scripts Member Set Functions 7 Function @XRANGE * Used to generate a list containing All members in the range specified by the arguments used in the function.5.

However. including ancestors of any occurrences of the specified member as a shared member. 7-6 Hyperion . So 100-20 (Diet Cola) is a descendant of 100 (Colas) and is a shared member descendant of Diet. This function excludes the specified member. @ALLANCESTORS("100-20")returns “100”. “Diet” and “Product” Notes Essbase sorts the generated list of members in ascending order of the member number in the outline. the order in which shared ancestors are returned is not guaranteed. This order is important to consider when you use the @ALLANCESTORS member set function with certain forecasting and statistical functions. Syntax @ALLANCESTORS(mbrName) Example The following example is based on the Sample Basic database. Sample Basic has a shared level of diet drinks.7 Member Set Functions Hyperion Essbase Calc Scripts @ALLANCESTORS The @ALLANCESTORS() function returns all ancestors of the specified member. which includes 100-20 (Diet Cola).

In some cases.East) returns Total Expenses->East.3.2). the @ANCEST function is equivalent to the @ANCESTVAL function. Sales = @ANCESTVAL(Product. Hyperion 7-7 . if the current member of Measures being calculated is Payroll. @ANCEST(Measures. genLevNum [. If you specify the optional mbrName. that ancestor is combined with the specified member. mbrName]) Example In the Sample Basic database: @ANCEST(Product. For example. if the current member of Product being calculated is Diet Cola. Notes You cannot use the @ANCEST function in a FIX statement.Sales) returns Colas->Sales. except in terms of calculation performance.2). the following two formulas are equivalent: Sales = @ANCEST(Product.2. Syntax @ANCEST(dimName. You can use the @ANCEST function on both the left-hand and right-hand sides of a formula.Hyperion Essbase Calc Scripts Member Set Functions 7 @ANCEST The @ANCEST() function returns the ancestor at the specified generation or level of the current member being calculated in the specified dimension. using the latter formula results in better calculation performance. The time required for retrieval and calculation may be significantly longer if this function is in a formula attached to a member tagged as Dynamic Calc or Dynamic Calc and Store. In this case.

-2) eturns Margin. 7-8 Hyperion . This order is important to consider when you use the @ANCESTORS member set function with certain forecasting and statistical functions. Syntax @ANCESTORS (mbrName [. genLevNum | genLevName]) Example In the Sample Basic database: @ANCESTORS("New York")returns East. Notes Essbase sorts the generated list of members starting with the specified member. @ANCESTORS(Qtr4)returns Year. Profit (in that order).1)returns 100.7 Member Set Functions Hyperion Essbase Calc Scripts @ANCESTORS The @ANCESTORS() function returns all ancestors of the specified member or those up to a specified generation or level. then the next nearest ancestor of the member. @ANCESTORS("100-10". Product (in that order). @ANCESTORS(Sales. Market (in that order). followed by nearest ancestor of the member. and so on.

specify the member name (for example. Hyperion 7-9 . True or False). specify the full attribute member name (for example. and Diet Cream. Caffeinated). This order is important to consider when you use the @ATTRIBUTE member set function with certain forecasting and statistical functions. @ATTRIBUTE(Can) returns all base members with the Can attribute: Cola. You may have duplicate Boolean. For example. Syntax @ATTRIBUTE (attMbrName) attMbrName . Example In the Sample Basic database. 12 can be the attribute value for the size (in ounces) of a product as well as the value for the number of packing units for a product. date. Essbase returns all base members that are associated with either Caffeinated member (for example. If you specify the name of a Boolean attribute dimension (for example. For example. Diet Cola. @ATTRIBUTE(12_Ounces)). Essbase sorts the generated list of members in ascending order from the database outline. To return only one. @ATTRIBUTE(Large) returns all base members that fall into one of the population ranges for the attribute parent Large. To distinguish duplicate member names. Notes When @ATTRIBUTE is used with a non-level 0 member of an attribute dimension. Essbase returns all base members that are associated with the children of the attribute member.Hyperion Essbase Calc Scripts Member Set Functions 7 @ATTRIBUTE The @ATTRIBUTE() function generates a list of all base members that are associated with the specified attribute member. in the Sample Basic database.Single attribute member name or member combination. and numeric attribute member names in your outline. @ATTRIBUTE(Caffeinated_True)).

Essbase returns 100-10. 100-20. Syntax @CHILDREN(mbrName) Example In the Sample Basic database: @CHILDREN(Market)returns East. if you specify 100 for mbrName. This order is important to consider when you use the @CHILDREN member set function with certain forecasting and statistical functions. 100-30 (in that order). Notes Essbase sorts the generated list of members in ascending order.7 Member Set Functions Hyperion Essbase Calc Scripts @CHILDREN The @CHILDREN () function returns all children of the specified member. 7-10 Hyperion . South. Using Sample Basic as an example. excluding the specified member. and Central. @CHILDREN(Margin)returns Sales and COGS. West.

The time required for retrieval and calculation may be significantly longer if this function is in a formula attached to a member tagged as Dynamic Calc or Dynamic Calc and Store. consider: @CHILDREN(@CURRMBR(Product)) generates a list of all children for the current member of the Product dimension. Syntax @CURRMBR(dimName) Example In the Sample Basic database. @CURRMBR(Year)returns Jan if the current member of Year being calculated is Jan. As a more complex example. Notes You cannot use the @CURRMBR function in a FIX statement. Hyperion 7-11 .Hyperion Essbase Calc Scripts Member Set Functions 7 @CURRMBR The @CURRMBR() function returns the member that is currently being calculated in the specified dimension. You cannot use the @CURRMBR function on the left-hand side of a formula.

Total Expenses. A value of 0 or a negative integer defines a level number. 7-12 Hyperion . Massachusetts. Sales. Notes Essbase sorts the generated list of members starting with the nearest descendant of the member. Syntax @DESCENDANTS(mbrName [. Marketing.2)returns East. Payroll. or genLevName . COGS. South. West.Level name or generation name down to which to select the members. This function excludes the specified member.0)returns 100-20. @DESCENDANTS(Profit)returns Margin. genLevNum| genLevName]) Optional genLevNum . and 300-30.7 Member Set Functions Hyperion Essbase Calc Scripts @DESCENDANTS The @DESCENDANTS function returns all descendants of the specified member. and Misc. or those down to the specified generation or level. @DESCENDANTS(Market. Example In the Sample Basic database: @DESCENDANTS(East)returns New York. followed by the next nearest descendant of the member. and Central . This order is important to consider when you use the @DESCENDANTS member set function with certain forecasting and statistical functions. @DESCENDANTS(Diet. 200-20.An integer value that defines the absolute generation or level number down to which to select the members. and New Hampshire. Connecticut. Florida. A positive integer defines a generation number. and so on.

genName|genNum) genNum .3) both return Jan. Nov. and Dec (in that order). 300. Essbase checks to see if the parameter is a valid generation number. Sep. Essbase does not recognize the value of the variable. Oct. Syntax @GENMBRS(dimName. Essbase returns 100. Essbase first looks for a generation with a number string name. Aug. This order is important to consider when you use the @GENMBRS member set function with certain forecasting and statistical functions.Hyperion Essbase Calc Scripts Member Set Functions 7 @GENMBRS The @GENMBRS() function returns all members with the specified generation number or generation name in the specified dimension.Generation name from the specified dimension. Example In the Sample Basic database: @GENMBRS(Year. 400. Hyperion 7-13 . If you specify a temporary variable for the genName parameter. Feb.An positive integer value that defines the absolute generation number.2). or genName . If no generation name exists with that numeric name.”May”) @GENMBRS(Year. Mar. Apr. 200. if you specify @GENMBRS(Product. May. Jul. It looks in the outline for a generation name with the same name as the temporary variable. If you specify a number for the genName parameter. Essbase sorts the generated list of members in ascending order. Diet (in that order). Notes If you specify a name for the genName parameter. Essbase looks for a generation with that name in the specified dimension. Jun. Using Sample Basic as an example.

7-14 Hyperion . the order in which shared ancestors are returned is not guaranteed. Sample Basic has a shared level of diet drinks. “Diet” and “Product” Notes Essbase sorts the generated list of members in ascending order of the member number in the outline. Syntax @IALLANCESTORS(mbrName) Example The following example is based on the Sample Basic database. @IALLANCESTORS("100-20") returns “100-20”. including ancestors of any occurrences of the specified member as a shared member. “100”. So 100-20 (Diet Cola) is a descendant of 100 (Colas) and is a shared member descendant of Diet. which includes 100-20 (Diet Cola). This order is important to consider when you use the @IALLANCESTORS member set function with certain forecasting and statistical functions. However.7 Member Set Functions Hyperion Essbase Calc Scripts @IALLANCESTORS The @IALLANCESTORS() function returns the specified member and all the ancestors of that member.

Hyperion Essbase Calc Scripts Member Set Functions 7 @IANCESTORS The @IANCESTORS() function returns the specified member and all ancestors of the specified member or those up to the specified generation or level. Profit (in that order). followed by nearest ancestor of the member. 100. then the next nearest ancestor of the member.1) returns "100-10". Market (in that order).-2) returns Sales. @IANCESTORS("100-10". Notes Essbase sorts the generated list of members starting with the specified member. Hyperion 7-15 . Margin. @IANCESTORS(Sales. Year. and so on. This order is important to consider when you use the @ANCESTORS member set function with certain forecasting and statistical functions. genLevNum | genLevName]) Example In the Sample Basic database: @IANCESTORS("New York") returns “New York”. East. Syntax @IANCESTORS (mbrName [. Product (in that order). @IANCESTORS(Qtr4) returns Qtr4.

South. Sales and COGS. East. 7-16 Hyperion . followed by its children in ascending order. @ICHILDREN(Margin)returns Margin. and Central.7 Member Set Functions Hyperion Essbase Calc Scripts @ICHILDREN The @ICHILDREN() function includes the specified member and all members in the level immediately below the specified member. This order is important to consider when you use the @ICHILDREN member set function with certain forecasting and statistical functions. West. Notes Essbase sorts the generated list of members starting with the specified member. Syntax @ICHILDREN(mbrName) Example In the Sample Basic database: @ICHILDREN(Market)returns Market.

Marketing. and so on This order is important to consider when you use the @IDESCENDANTS member set function with certain forecasting and statistical functions. genLevNum| genLevName]) genLevNum . and Misc. A value of 0 or a negative integer defines a level number.2) returns Market. A positive integer defines a generation number. Hyperion 7-17 . @IDESCENDANTS(Diet. Florida. COGS. and New Hampshire. Connecticut. 200-20. Total Expenses. Syntax @IDESCENDANTS(mbrName [. Example In the Sample Basic database: @IDESCENDANTS(East) returns East. East.0)returns Diet. @IDESCENDANTS(Profit)returns Profi. or those down to the specified generation or level. or genLevName . Payroll.Hyperion Essbase Calc Scripts Member Set Functions 7 @IDESCENDANTS The @IDESCENDANTS function returns the specified member and all descendants of the specified member.Level name or generation name down to which to select the members. and 300-30. New York. 100-20.An integer value that defines the absolute generation or level number down to which to select the members. Margin. and West. Sales. Massachusetts. Notes Essbase sorts the generated list of members as follows: • • • The specified member The nearest descendant of the member The next nearest descendant of the member. @IDESCENDANTS(Market.

@ILSIBLINGS(Qtr3) returns Qtr1. Left siblings are children that share the same parent as the member and that precede the member in the database outline. and Florida .7 Member Set Functions Hyperion Essbase Calc Scripts @ILSIBLINGS The @ILSIBLINGS() function returns the specified member and all of the left siblings of the member. siblings appearing above the member in the database outline) in ascending order. Qtr2. 7-18 Hyperion . Notes Essbase sorts the generated list of members starting with the left siblings of the member (that is. and Qtr3. Massachusetts. This order is important to consider when you use the @ILSIBLINGS member set function with certain forecasting and statistical functions. Syntax @ILSIBLINGS(mbrName) Example In the Sample Basic database: @ILSIBLINGS(Florida) returns New York.

If one or more of the descendants are shared. 200-20. genLevNum| genLevName]) genLevNum . Example Consider an outline with the following Product dimension: Product 100 100-10 100-20 100-30 200 200-10 200-20 200-30 200-40 Diet 100 (Shared Member) 200 (Shared Member) Diet has two children "100" and "200". The members "100" and "200" are shared members. 100-10. the result also includes either all descendants of each member being shared or descendants down to the specified generation or level. 200.Level name or generation name down to which to select the members. 200-10. or those down to the specified generation or level. 200-40 (in that order). A value of 0 or a negative integer defines a level number. Hyperion 7-19 . 100-30.Hyperion Essbase Calc Scripts Member Set Functions 7 @IRDESCENDANTS The @IRDESCENDANTS function returns the specified member and all its descendants. 100-20. Syntax @IRDESCENDANTS(mbrName [. @IRDESCENDANTS(Diet) returns the members: Diet. A positive integer defines a generation number. 100. 200-30. or genLevName .An integer value that defines the absolute generation or level number down to which to select the members.

the above steps are repeated on the member being shared.7 Member Set Functions Hyperion Essbase Calc Scripts Notes In the absence of shared members. @IRDESCENDANTS and @IDESCENDANTS return the same result. If a shared member is encountered. Essbase generates the list of members in the following sequence: • • • • The specified member The nearest descendant of the member The next nearest descendant of the member. 7-20 Hyperion . The order of members in the result list is important to consider when you use the @IRDESCENDANTS member set function with certain forecasting and statistical functions. and so on.

Hyperion Essbase Calc Scripts Member Set Functions 7 @IRSIBLINGS The @IRSIBLINGS() function returns the specified member and all of the right siblings of the specified member. Syntax @IRSIBLINGS (mbrName) Example In the Sample Basic database: @IRSIBLINGS(Florida) returns Florida. 200-30. and New Hampshire. 200-40 (in that order). Essbase returns 200-20. Connecticut. if you specify 200-20 for mbrName. Right siblings are children that share the same parent as the member and that follow the member in the database outline. Notes Essbase sorts the generated list of members starting with the specified member. This order is important to consider when you use the @IRSIBLINGS member set function with certain forecasting and statistical functions. followed by the right siblings of the member (that is. @IRSIBLINGS(Qtr3) returns Qtr3 and Qtr4. Using Sample Basic as an example. siblings appearing below the member in the database outline) in ascending order. Hyperion 7-21 .

7 Member Set Functions Hyperion Essbase Calc Scripts @ISIBLINGS The @ISIBLINGS() function returns the specified member and all siblings of that member. @ISIBLINGS(Qtr2) returns Qtr1. Washington. Oregon. This order is important to consider when you use the @ISIBLINGS member set function with certain forecasting and statistical functions. Using Sample Basic as an example. 200-30. Notes Essbase sorts the generated list of members in ascending order. Qtr3. 200-20. and Nevada (in that order). . if you specify 200-30 for mbrName. Syntax @ISIBLINGS (mbrName) Example In the Sample Basic database: @ISIBLINGS(California) returns California. Utah. 7-22 Hyperion . 200-40 (in that order). Essbase returns 200-10. and Qtr4 (in that order). Qtr2.

Marketing. and Profit per Ounce (in that order). It looks in the outline for a level name with the same name as the temporary variable. Hyperion 7-23 . If no level name exists with that name. Profit %. Additions. Essbase first looks for a level with a number string name. If you specify a temporary variable for the levName parameter. Margin %. Example In the Sample Basic database: @LEVMBRS(Measures.Hyperion Essbase Calc Scripts Member Set Functions 7 @LEVMBRS The @LEVMBRS() function returns all members with the specified level number or level name in the specified dimension. 2). Essbase looks for a level with that name in the specified dimension.0) both return Sales. @LEVMBRS(Scenario. The integer value must be 0 or a positive integer. If you specify a number for the levName parameter (for example. levName|levNum) levName .” Notes If you specify a name for the levName parameter.0) returns Actual. Budget.An integer value that defines the number of a level. Essbase checks to see if the parameter is a valid level number. Opening Inventory. or levNum . COGS.A level name of the specified dimension. Syntax @LEVMBRS(dimName. Misc. Ending Inventory. Payroll."Profit and Loss") @LEVMBRS(Measures. Variance. Essbase does not recognize the value of the variable. and “Variance %.

7-24 Hyperion . If you use a negative number for the level number. but the calculation will fail with an error message. no syntax error is noted.7 Member Set Functions Hyperion Essbase Calc Scripts Essbase sorts the generated list of members in ascending order. This order is important to consider when you use the @LEVMBRS member set function with certain forecasting and statistical functions.

.The list of arguments that are collected and treated as one argument so they can be processed by the parent function.. argument2. Aug))... argumentN .Hyperion Essbase Calc Scripts Member Set Functions 7 @LIST The @LIST() function creates and distinguishes lists that are processed by functions that require list arguments. member set functions. ENDFIX Notes @LIST does not check for or eliminate repetitions. argument2. Hyperion 7-25 . Example A company ran special promotional activities for January. Arguments can be member names. Their Essbase database has an account field to store sales for the promotional periods. or rangeLists. Syntax @LIST(argument1. One way to populate this field: FIX (Sales) “Special Sales”= @SUM(@LIST(Jan. range functions.. member lists... argumentN) argument1. and numeric expressions.. @LIST can be used to create expLists. June and August. member combinations.Jun. @LIST treats a collection of parameters as one entity.

and California. 7-26 Hyperion . and Qtr1. Notes Essbase sorts the generated list of left siblings in descending order. Oregon. This order is important to consider when you use the @LSIBLINGS member set function with certain forecasting and statistical functions. Qtr2.7 Member Set Functions Hyperion Essbase Calc Scripts @LSIBLINGS The @LSIBLINGS() function returns the left siblings of the specified member. Left siblings are children that share the same parent as the member and that precede the member in the database outline. @LSIBLINGS(Utah) returns Washington. Syntax @LSIBLINGS (mbrName) Example In the Sample Basic database: @LSIBLINGS(Qtr4) returns Qtr3. This function excludes the specified member.

"???-10") returns: 100-10. and 400-10 @MATCH(Year. Hyperion 7-27 . 100-10 (Cola). To include spaces in the character pattern. 100-30 (Caffeine Free Cola)."C*") returns: 100 (Colas). enclose the pattern in double quotation marks (""). Jun."J*") returns: Jan. Essbase searches the member names and alias names of the specified member and its descendants. 200-10. or levName -The default or user-defined name of the level to search. or genName . Essbase searches all member names and member alias names in the generation.Hyperion Essbase Calc Scripts Member Set Functions 7 @MATCH The @MATCH function performs wildcard member selections. Jul @MATCH(Product.The default or user-defined name of the member on which to base the search. including a wildcard character (* or ?). Essbase searches all member names and member alias names in the level. You can use * only at the end of the pattern.The default or user-defined name of the generation to search. You can use ? anywhere in the pattern. Syntax @MATCH (mbrName|genName|levName. * substitutes any number of characters. "pattern" The character pattern to search for. "pattern") mbrName . 300 (Cream Soda) Notes ? substitutes one occurrence of any character. 300-10. Example In the Sample Basic database: @MATCH(Product.

7 Member Set Functions Hyperion Essbase Calc Scripts This function performs a trailing-wildcard member selection. If the members names in the database you are searching are case-sensitive. the search is case-sensitive. Essbase searches for member names and alias names that match the pattern you specify and returns the member and alias names it finds. If Essbase does not find any members that match the chosen character pattern. To define database member names as case-sensitive. 7-28 Hyperion . it returns no member names and continues with the other calculation commands in the calculation script. the search is not case-sensitive. choose Settings | Case Sensitive Members from the Application Manager Outline Editor menu. Otherwise.

Hyperion 7-29 . QTR1)). QTD=@MEMBER(@CONCATENATE("2000_". Syntax @MEMBER (String) String . the @MEMBER function is used in combination with string functions that are used to manipulate character strings to form the name of a member. the member name QTR1 is appended to the character string 2000_ to form the string 2000_QTR1.A string (enclosed in double quotation marks) or a function that returns a string Example Typically. The @MEMBER function returns the member 2000_QTR1 and QTD is set to the value of this member. In the following example.Hyperion Essbase Calc Scripts Member Set Functions 7 @MEMBER The @MEMBER function returns the member with the name that is provided as a character string.

7-30 Hyperion . list2 . even though it is a child of both Colas and Diet Drinks. @MERGE can merge only two lists at a time.7 Member Set Functions Hyperion Essbase Calc Scripts @MERGE The @MERGE() function merges two member lists that are processed by another function. Diet Root Beer.The second list of member specifications to be merged. Example In the Sample Basic database.The first list of member specifications to be merged. Notes Duplicate values are included only once in the merged list. and Diet Cream Soda. Diet Cola. Syntax @MERGE(list1. You can nest @MERGE functions to merge more than two lists. list2) list1 . @MERGE(@CHILDREN(Colas). Diet Cola appears only once in the merged list.@CHILDREN("Diet Drinks")) returns Cola. Duplicate values from both lists are included only once in the merged list. Caffeine Free Cola.

that is combined with the parent returned. You can use the @PARENT function on both the left and right sides of a formula. if the current member of Market being calculated is Colorado.Hyperion Essbase Calc Scripts Member Set Functions 7 @PARENT The @PARENT () function returns the parent of the current member being calculated in the specified dimension. For example: Sales = @AVG(SKIPMISSING. member]) member . If you use this function on the left side of a formula in a calculation script. Syntax @PARENT(dimName [. In general. The time required for retrieval and calculation may be significantly longer if this function is in a formula attached to a member tagged as Dynamic Calc or Dynamic Calc and Store. that parent is combined with the specified member. For example: Sales(@PARENT(Product) = 5. Hyperion 7-31 . Example In the Sample Basic database: @PARENT(Market. use @PARENT as a member rather than as an implied value of a cell.Any valid single member name or member combination.Sales)returns Central->Sales.). @PARENT(Measures)returns Profit. If you specify the optional member. associate it with a member. or a function that returns a single member or member combination. @ISIBLINGS(@PARENT("100"))). if the current member of Measures being calculated is Margin. Notes You cannot use the @PARENT function in a FIX statement.

Prod Count. The @RANGE function is used with the @COUNT function to calculate the count of all products for which a data value exists: "Prod Count" = @COUNT(SKIPMISSING. Assume that the Measures dimension contains an additional member.@CHILDREN(Product))). rangeList]) Optional rangeList .@RANGE(Sales. If rangeList is not specified. and range functions from the same dimension.A valid member name. Syntax @RANGE(mbrName [.7 Member Set Functions Hyperion Essbase Calc Scripts @RANGE The @RANGE() function returns a member list that crosses the specified member from one dimension with the specified member range from another dimension. This example produces the following results: Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product 678 551 663 587 #MI 2479 Prod Count #MI #MI #MI #MI #MI 4 7-32 Hyperion . Examples The following example is based on the Sample Basic database. Hyperion Essbase uses the level 0 members from the dimension tagged as Time. member set functions. a comma-delimited list of member names.

100-10. 100-30. 200-20. The members "100" and "200" are shared members. Hyperion 7-33 . 200-10. or those down to the specified generation or level. 200-30.Hyperion Essbase Calc Scripts Member Set Functions 7 @RDESCENDANTS The @IRDESCENDANTS function returns the specified member and all its descendants. or genLevName . the result also includes either all descendants of each member being shared or descendants down to the specified generation or level. A value of 0 or a negative integer defines a level number. A positive integer defines a generation number. 200-40 (in that order).An integer value that defines the absolute generation or level number down to which to select the members. If one or more of the descendants are shared. Example Consider an outline with the following Product dimension: Product 100 100-10 100-20 100-30 200 200-10 200-20 200-30 200-40 Diet 100 (Shared Member) 200 (Shared Member) Diet has two children "100" and "200". Syntax @RDESCENDANTS(mbrName [. genLevNum| genLevName]) genLevNum .Level name or generation name down to which to select the members. 200. @RDESCENDANTS(Diet) returns the members: 100. 100-20.

the above steps are repeated on the member being shared.7 Member Set Functions Hyperion Essbase Calc Scripts Notes In the absence of shared members. Essbase generates the list of members in the following sequence: • • • The nearest descendant of the member The next nearest descendant of the member. 7-34 Hyperion . @RDESCENDANTS and @DESCENDANTS return the same result. and so on. If a shared member is encountered. The order of members in the result list is important to consider when you use the @RDESCENDANTS and the @IRDESCENDANTS member set function with certain forecasting and statistical functions.

3) @RELATIVE(Qtr1.Hyperion Essbase Calc Scripts Member Set Functions 7 @RELATIVE The @RELATIVE function returns all members at the specified generation or level that are above or below the specified member in the database outline. genLevNum | genLevName) Example In the Sample Basic database: @RELATIVE(Qtr1.-1) returns the two members that are at level 1 and that are below Profit: Margin and Total Expenses (in that order). Hyperion 7-35 . Syntax @RELATIVE (mbrName. This order is important to consider when you use the @RELATIVE member set function with certain forecasting and statistical functions. and Mar. @RELATIVE(Profit. Notes Hyperion Essbase sorts the generated list of members in ascending order.0) both return the three members that are at generation 3 (or level 0) and that are below Qtr1 in the Sample Basic outline: Jan. Feb.

from which the members specified in list2 are removed.@LIST("New York". @REMOVE(@CHILDREN(East).Connecticut)) returns Massachusetts. Syntax @REMOVE (list1.A list of member specifications to be removed from list1. Example In the Sample Basic database. list2 . 7-36 Hyperion . list2) list1 . Florida.7 Member Set Functions Hyperion Essbase Calc Scripts @REMOVE The @REMOVE() function removes values or members in one list from another list.A list of member specifications. New Hampshire.

This order is important to consider when you use the @RSIBLINGS member set function with certain forecasting and statistical functions. Hyperion 7-37 . @RSIBLINGS(Sales) returns COGS . Notes Essbase sorts the right siblings in ascending order. Syntax @RSIBLINGS(mbrName) Example In the Sample Basic database: @RSIBLINGS(Florida) returns Connecticut and New Hampshire. Right siblings are children that share the same parent as the member and that follow the member in the database outline.Hyperion Essbase Calc Scripts Member Set Functions 7 @RSIBLINGS The @RSIBLINGS() function returns all of the right siblings of the specified member. This function excludes the specified member.

California. Essbase returns 200-20.7 Member Set Functions Hyperion Essbase Calc Scripts @SIBLINGS The @SIBLINGS() function returns all siblings of the specified member. Using Sample Basic as an example. 200-40 (in that order). and Central (in that order). siblings appearing above the member in the database outline) in descending order. 200-10. Utah. This order is important to consider when you use the @SIBLINGS member set function with certain forecasting and statistical functions. siblings appearing below the member in the database outline) in ascending order. if you specify 200-30 for mbrName. @SIBLINGS(East)returns West. 7-38 Hyperion . This function excludes the specified member. right siblings of the member (that is. Notes Essbase sorts the generated list of members as follows: • • left siblings of the member (that is. Syntax @SIBLINGS (mbrName) Example In the Sample Basic database: @SIBLINGS (Washington)returns Oregon. South. and Nevada (in that order).

User-defined attribute string as it is shown in the database outline. Hyperion 7-39 . which have been defined as a user-defined attribute (UDA) on the Hyperion Essbase server."Small Market") This function returns a list of all members whose Market dimension has been assigned the UDA “Small Market”. Example @UDA(MARKET. Syntax @UDA (dimName.Hyperion Essbase Calc Scripts Member Set Functions 7 @UDA The @UDA function returns members with a common attribute. udaStr) udaStr . Notes You must type the UDA string exactly as it is shown in the database outline.

Syntax @WITHATTR (dimName. <. or a date-format function. You can use operators such as >. in combination with the operator. "operator". defines the condition that must be met. a constant. @WITHATTR(Population. and IN to specify conditions that must be met.A value that. value) operator . For example. The following operators are supported: Operator > >= < <= == <> or != IN Meaning Greater than Greater than or equal to Less than Less than or equal to Equal to Not equal to In The IN operator returns the base members that are associated with a subcategory of attributes in the attribute dimension. The value can be an attribute member specification.Logical operator enclosed in quotation marks (""). =.7 Member Set Functions Hyperion Essbase Calc Scripts @WITHATTR The @WITHATTR() function returns all base members that are associated with an attribute that satisfies a specified condition. value . in the Sample Basic database. 7-40 Hyperion ."IN".Medium) returns the base members that are associated with all attributes under the Medium parent member in the Population dimension.

Hyperion 7-41 . Florida. Diet Cola. you must use the @TODATE function in the string parameter to convert the date string to a number. Birch Beer. Texas New York. Sasparilla Diet Cream Cola.True) @WITHATTR("Population". Diet Cream Caffeine Free Cola.Hyperion Essbase Calc Scripts Member Set Functions 7 Examples The following table shows examples."04-01-1996")) @WITHATTR("Pkg Type". Texas.Can) @WITHATTR(Caffeinated.000.1. Strawberry Massachusetts. ENDFIX Notes If you specify a date attribute with the @WITHATTR function. Illinois. Illinois."06-26-1996"))).000 is a constant @WITHATTR(Ounces. @TODATE("mm-dd-yyyy".">". Sasparilla. Diet Cola.">=".">=".1.">". Florida. based on the Sample Basic database. ENDFIX /* To increase by 10% the marketing budget for products brought to market after a certain date */ FIX (@WITHATTR("Intro Date". Ohio @WITHATTR("Intro Date". Old Fashioned. Marketing = Marketing * 1. California. based on the Sample Basic database: /* To increase by 10% the price of products that are greater than or equal to 20 ounces */ FIX (@WITHATTR(Ounces."16") Returns New York.10000000) where 10. Grape."18000000") @WITHATTR(Population. @TODATE("mm-dd-yyyy".Medium) The following two examples show @WITHATTR used in a calc script."IN"."<". California. Caffeine Free Cola. Old Fashioned Cola. for each type of operator: Condition @WITHATTR(Population."<=". Diet Cola. Ohio Cola."20")) Price = Price * 1. Orange."= ="."<>".

When using Boolean attributes with @WITHATTR. for example. 7-42 Hyperion .7 Member Set Functions Hyperion Essbase Calc Scripts Date @WITHATTR("Intro Date"."<". use only the actual Boolean attribute member name. You cannot use True/Yes and False/No interchangeably. or use 1 (for True or Yes) or 0 (for False or No)."<>".Orange) returns base members with attributes that precede Orange in the alphabet. Boolean @WITHATTR(Caffeinated."07-261996")) returns all base members with date attributes that are before July 26."<".True). Apple. Mango. It does not return base members that do not have Caffeinated set to True (or Yes) or do not have a Caffeinated attribute at all. Cranberry. An operator may work differently with different attribute types."<". but not Peach or Strawberry. which returns only base members with Caffeinated set to False. For example: Text @WITHATTR(Flavors.@TODATE("mm-dd-yyyy".True) returns all base members that have Caffeinated set to False (or No). 1996. and Oat. The behavior is similar for a formula like @WITHATTR(Caffeinated.

@SUMRANGE. It determines the cross product of all members in the range and then prunes the set to include only the range requested.. 2001->Qtr1) is invalid. @MOVSUM. 2000->Dec. @XRANGE can be used only in these functions: @AVGRANGE. @MAXSRANGE. @MAXRANGE. 1998->Dec. Although the syntax is correct.. @MOVMIN. 2001->Jan. @MOVMAX. @MINRANGE. @MOVAVG. mbrName2) Examples This function is useful. Syntax @XRANGE (mbrName1. For example. The member components of each argument must be from the same level. @XRANGE(1998->Jun. 1999->Dec. For example. . @XRANGE(1998->Aug. @XRANGE(1998->Jun. @MOVMED. 1999->Feb. 2001->March) This example returns the set consisting of: 1998->Aug. The dimension order of members must match for both arguments. 2000->Jan. 1999->Jan. 2001->Feb. for example. 1998->Sep. . 1998) results in an empty set. when you work with the Time and Scenario dimensions. For example.. @MINSRANGE. 2001) is invalid.Hyperion Essbase Calc Scripts Member Set Functions 7 @XRANGE @XRANGE takes as input two members (single or cross-dimensional) and returns a member range. 2001->Mar Notes @XRANGE can appear anywhere in a formula where a range can normally appear. @XRANGE(1998->Jun. March->2001) is invalid. @SPLINE The two arguments to @XRANGE must be either single members or crossdimensional members with the same member components.. @STDDEVRANGE. a function such as @XRANGE (2001. .. Hyperion 7-43 . 2000->Feb..

all Time members. The calc script should calculate all Accounts members. Do the pink cells beneath Connecticut and East contain data after the calculation? Why or why not? If they do not. Retrieve into this sheet. you create a calc script to calculate all members within East. Open the SS_Member spreadsheet. For this exercise. run the CSmember calc script.xls 1) 2) From Essbase Application Manager. From the Calc&Retrieve sheet. all Time members. modify the CSMember calc script and rerun the calculation until all pink cells are populated with data. clear all data from the HLandS1 database. Switch to the Calc&Retrieve sheet. Lock and send the data in the Lock&Send sheet to the HLandS1 database. Save the new script as CSMember.7 Member Set Functions Hyperion Essbase Calc Scripts Exercise 7-1: Applying Member Set Functions In this exercise. including the East total. and all Products members. Perform a retrieval and notice the calculation results within the pink cells. Close the spreadsheet. Notice that the values in pink have not been calculated yet. This calc script should apply only to the Budget. including the East total. 3) 4) 5) 6) 7) 8) 7-44 Hyperion . and all Products members. The calc script should calculate all Accounts members. Create a calc script to calculate Budget values for all members within East. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSMember SS_Member.

Therefore.Hyperion Essbase Calc Scripts Member Set Functions 7 Unit Summary To avoid hard-coding lists of members or dimensions. you use member set functions. for example. Hyperion 7-45 . when the database structure changes by adding members. an associated calc script need not change. Member set functions return lists of members and dimensions. The member set functions are often used in conjunction with Fix structures to isolate specific members for which calculations are to be performed.

and East. All the states in the East market. check your understanding by responding to the following questions: For each of the following situations. All states that begin with the letter “N”. All level one members of the Market Dimension.000. Use the Sample Basic outline. identify the Member Set function that you would use to create a list of the required members. “New York” and all its ancestors. 7-46 Hyperion .000.7 Member Set Functions þ Check Your Understanding 1) Hyperion Essbase Calc Scripts Now that you have completed the chapter. itself. All states whose population is greater than 6.

Hyperion 7-47 . and East. itself. All level one members of the Market Dimension. identify the Member Set function that you would use to create a list of the required members.000. “New York” and all its ancestors. All the states in the East market.000. Use the Sample Basic outline. All states whose population is greater than 6.) @MATCH @ICHILDREN or @IDESCENDANTS @LVLMBRS @IANCESTORS @WITHATTR All states that begin with the letter “N”.Hyperion Essbase Calc Scripts Member Set Functions 7 þ Check Your Understanding Solutions 1) For each of the following situations. (Multiple solutions may be correct for some of these answers.

7 Member Set Functions Hyperion Essbase Calc Scripts 7-48 Hyperion .

you will be able to: • • Explain the purpose and use of relationship functions to generate member lists Practice using the relationship functions in a series of incremental exercises .8 Relationship Functions Chapter Objectives By the end of this chapter.

Los Angeles -. dimName1.Albany -.Group 01-2 -. simpler outline are used to explain how relationship functions work.Connecticut West Region .8 Relationship Functions Hyperion Essbase Calc Scripts Using Relationship Functions A relationship function returns a value based on the member combination being calculated and the degree of relationship specified by the function. An integer value that defines the generation or level number from which the ancestor value is returned.New York State -.SKU01-2-2 Relationship Function Parameters There are common parameters associated with the various relationship functions: dimName. the Sample Basic outline and a second. 8-2 Hyperion . genLevNum.. Any valid single member name or member combination (or a function that returns a single member or member combination)..San Francisco Product Family01 . The simpler outline includes: Market East Region .. Single dimension name specification. genLevNum1.Group 01-1 -.California -. A value of 0 or a negative integer defines a level number. In this chapter.SKU01-2-1 -. genLevNumX. dimNameX mbrName.SKU01-1-1 --SKU01-1-2 . A positive integer defines a generation number.Buffalo .

Function @ANCESTVAL Returns The value of a specified ancestor of the current member being calculated. Multi-dimensional parent-level data for the current member being calculated. The level number of the current member combination for the specified dimension. The associated attribute value from the specified numeric or date attribute dimension. @ATTRIBUTEBVAL @ATTRIBUTESVAL @ATTRIBUTEVAL @CURGEN @CURLEV @GEN @LEV @MDANCESTVAL @MDPARENTVAL @PARENTVAL @SANCESTVAL @SPARENTVAL @XREF Hyperion 8-3 . The generation number of the current member combination for the specified dimension. Parent-level data based on the shared parent value of the current member being calculated. The generation number of the specified member. Values incorporated from a different Essbase database. Multi-dimensional ancestor-level value for the current member being calculated. The level number of the specified member. The parent value along the specified dimension for the member being calculated Ancestor-level data based on the shared ancestor value of the current member being calculated.Hyperion Essbase Calc Scripts Relationship Functions 8 Summary of Relationship Functions This table summarizes the Relationship Functions. Each function is also described. The associated attribute value from the specified string attribute dimension. in this chapter. in detail. The associated attribute value from the specified boolean attribute dimension.

Consolidated results must be calculated for Sales by Product before the SKU Share calculation occurs. mbrName]) Notes The returned value will be the value for the specified generation (or level) of the dimension and member combination. For the Albany of illustrative outline. Example In this example.Group01-2 --.2. @ANCESTVAL(Market. therefore.8 Relationship Functions Hyperion Essbase Calc Scripts @ANCESTVAL The @ANCESTVAL() function returns the ancestor values of a specified member combination. SKU Share is derived by taking Sales in each SKU as a percentage of its product family.-1.Sales) refers to the Sales value of level 1 of the current member’s Market hierarchy. For example. Syntax @ANCESTVAL (dimName.2.5 47. Families are at generation 2.4 100. This example produces the following results: Sales SKU01-1-1 SKU01-1-2 . this function returns the value of East->Sales. this function returns the value of “New York State”->Sales. @ANCESTVAL(Market.0 26.Sales) refers to the Sales value of generation 2 of the current member’s Market hierarchy. genLevNum [. For the Albany of illustrative outline.5 21. each descendant of family is calculated as a percentage its specific generation 2 ancestor.9 25.Sales).Group01-1 SKU01-2-1 SKU01-2-2 . "SKU Share" = Sales % @ANCESTVAL(Product.Family01 510 520 1030 430 500 930 1960 SKU Share 26.5 52.00 8-4 Hyperion .

Example The Product dimension is associated with the Caffeinated Boolean attribute dimension. as shown in the following example: Product {Caffeinated} 100 100-10 {Caffeinated:True} 100-20 {Caffeinated:True} 100-30 {Caffeinated:False} 200 200-10 {Caffeinated:True} 200-20 {Caffeinated:True} 200-30 {Caffeinated:False} 200-40 {Caffeinated:False} Caffeinated Attribute {Type: Boolean} True False For the current member of the base dimension Product.Hyperion Essbase Calc Scripts Relationship Functions 8 @ATTRIBUTEBVAL For the current member being calculated. Caffeinated. the function @ATTRIBUTEBVAL(Caffeinated) returns the associated attribute value from the Boolean attribute dimension. Syntax @ATTRIBUTEBVAL(attDimName) attDimName . The following table shows the value that would be returned: Current Member 100-10 100-20 100-30 100 Return Value True True False #MISSING Hyperion 8-5 . the @ATTRIBUTEBVAL() function returns the associated attribute value from the specified Boolean attribute dimension.The name of a Boolean attribute dimension.

Only level 0 members of attribute dimensions can be associated as attributes of members of a base dimension. numeric. @ATTRIBUTEBVAL returns #MISSING. or date attribute. 8-6 Hyperion .8 Relationship Functions Hyperion Essbase Calc Scripts 200-10 200-20 200-30 200-40 200 Product True True False False #MISSING #MISSING Notes The @ATTRIBUTEBVAL function works only with Boolean attribute dimensions. If no attribute is associated with the member being calculated or if the attribute associated with the member is a text.

Hyperion Essbase Calc Scripts Relationship Functions 8 @ATTRIBUTESVAL For the current member being calculated. Pkg Type. Syntax @ATTRIBUTESVAL(attDimName) attDimName . as shown in the following example: Product {Pkg Type} 100 100-10 {Pkg 100-20 {Pkg 100-30 {Pkg 200 200-10 {Pkg 200-20 {Pkg 200-30 {Pkg 200-40 {Pkg Pkg Type Attribute Bottle Can Type:Can} Type:Can} Type:Bottle} Type:Bottle} Type:Bottle} Type:Bottle} Type:Bottle} {Type: Text} For the current member of the base dimension.The name of a text attribute dimension. the function @ATTRIBUTESVAL("Pkg Type") returns the associated attribute value from the text attribute dimension. The following table shows the value that would be returned: Current Member 100-10 100-20 100-30 100 Return Value Can Can Bottle (empty string) Hyperion 8-7 . The Product dimension is associated with the Pkg Type text attribute dimension. Product. the @ATTRIBUTESVAL() function returns the associated attribute value from the specified text attribute dimension. Example This example is based on the Sample Basic database.

Only level 0 members of attribute dimensions can be associated as attributes of members of a base dimension.8 Relationship Functions Hyperion Essbase Calc Scripts 200-10 200-20 200-30 200-40 200 Product Bottle Bottle Bottle Bottle (empty string) (empty string) Notes The @ATTRIBUTESVAL function works only with text attribute dimensions. @ATTRIBUTESVAL returns an empty string. 8-8 Hyperion . Boolean. If no attribute is associated with the member being calculated or if the attribute associated with the member is a numeric. or date attribute.

for the current member being calculated.Single dimension specification for a numeric or date attribute dimension. Example The following example is based on the Sample Basic database: "Profit Per Ounce" = Profit/@ATTRIBUTEVAL(Ounces). 1970. When the @ATTRIBUTEVAL function is used with a date attribute dimension. For example. @ATTRIBUTEVAL returns #MISSING. @ATTRIBUTEVAL returns the associated attribute from the Ounces numeric attribute dimension. if the member being calculated is Cola and if the Ounces attribute value associated with Cola is 12. the @ATTRIBUTEVAL() function returns the associated attribute value from the specified numeric or date attribute dimension. @ATTRIBUTEVAL returns 12. Syntax @ATTRIBUTEVAL(attDimName) attDimName . January 1. In this formula.75 Cola Notes The @ATTRIBUTEVAL function works only with numeric and date attribute dimensions. This example produces the following results: Profit ======== 4593 Profit Per Ounce ================ 382. If there is no attribute associated with the member being calculated. Hyperion 8-9 . Only level 0 members of attribute dimensions can be associated as attributes of members of a base dimension. Essbase converts the date string to the number of seconds elapsed since midnight.Hyperion Essbase Calc Scripts Relationship Functions 8 @ATTRIBUTEVAL For the current member being calculated. or if the attribute associated with the member is a text attribute.

Syntax @CURGEN(dimName) Example In the Sample Basic database: @CURGEN(Year)produces the following results: Current Member Year Qtr2 Oct Value 1 2 3 8-10 Hyperion .8 Relationship Functions Hyperion Essbase Calc Scripts @CURGEN The @CURGEN() function returns the generation number of the current member combination for the specified dimension. This number represents the number of members separating the current member from the top-most member of the dimension.

Hyperion Essbase Calc Scripts Relationship Functions 8 @CURLEV The @CURLEV() function returns the level number of the current member combination for the specified dimension. Syntax @CURLEV(dimName) Example In the Sample Basic database: @CURLEV(Year) produces the following results: Current Member Year Qtr3 Aug Value 2 1 0 Hyperion 8-11 . This number represents the number of members that separates the current member from its bottommost descendant.

Syntax @GEN(mbrName) Example In the Sample Basic database: @GEN(Year) @GEN(Qtr3) 1 2 8-12 Hyperion .8 Relationship Functions Hyperion Essbase Calc Scripts @GEN The @GEN() function returns the generation number of the specified member.

Hyperion Essbase Calc Scripts Relationship Functions 8 @LEV The @LEV() function returns the level number of the specified member. Syntax @LEV(mbrName) Example In the Sample Basic database: Function @LEV(Margin) @LEV("New York") Level Returned 1 0 Hyperion 8-13 .

Syntax @MDANCESTVAL(dimCount. this function returns the value of “East Region”->Family01->Sales. dimNameX. You must specify a genLevNum for every dimName specified.. Product. 2.8 Relationship Functions Hyperion Essbase Calc Scripts @MDANCESTVAL The @MDANCESTVAL() function returns ancestor-level data from multiple dimensions based on the current member being calculated. Marketing). 2. Market. Example Marketing expenses are captured at the Product Family and Region level in a product planning application.. The Marketing Expense data must be allocated down to each Product code and city based on Sales. Notes @MDANCESTVAL(2. 2. Sales)) * @MDANCESTVAL(2. Sales) refers to the Sales value found by navigating to generation 2 of the current member’s Market hierarchy and to generation 2 of the current member’s Product hierarchy. 2.mbrName]) dimCount . Product. genLevNumX [. 2. dimName1. which produces the following (partial) results: Sales Albany SKU01-1-1 SKU01-1-2 SKU01-2-1 SKU01-2-2 East Region Family01 300 200 400 100 2000 Marketing 60 40 80 20 400 8-14 Hyperion . For the Albany->SKU01-1-2 of illustrative outline. Market. Market. Product. 2.Integer value that defines the number of dimensions from which ancestor values are being returned. genLevNum1. The Marketing Expense value of 400 for East Region and product Family01 is allocated down to each Product code and city with the following formula: Marketing = (Sales / @MDANCESTVAL(2.

Hyperion Essbase Calc Scripts Relationship Functions 8 @MDPARENTVAL The @MDPARENTVAL() function returns parent-level data from multiple dimensions based on the current member being calculated. Marketing).. Product. dimName1. this function returns the value of “New York State”>Group01-1->Sales. The Marketing Expense data must be allocated down to each Product Group Code and state based on Sales. Sales)) * @MDPARENTVAL(2. Market. Example Marketing expenses are captured at the Product Family and Region level in a product planning application. Product. Notes @MDPARENTVAL(2. Market..mbrName]) numDim . dimNameX [. The Marketing Expense value of 200 for East Region and product Family01 is allocated down to each Product code and city with the following formula: Marketing = (Sales / @MDPARENTVAL(2.Integer value that defines the number of dimensions from which parent values are being returned. Market.. Syntax @MDPARENTVAL(numDim. which produces the following (partial) results: Sales New York State Group01-1 Group01-2 Connecticut Group01-1 Group01-2 East Region Family01 300 200 100 400 1000 Marketing 60 40 20 80 200 Hyperion 8-15 . For the Albany->SKU01-1-2 of illustrative outline. Sales) refers to the Sales value found by navigating to the current member’s parent in Market hierarchy and to the parent in Product hierarchy. Product.

For example. this function returns the value of “New York State”->Sales. @PARENTVAL(Market. mbrName]) Notes The returned value will be that of the parent along the specified dimension and member combination.Sales). Example The formula calculates Market Share Sales value for each Market member as a percentage of Sales for its Market dimension parent. For Albany of illustrative outline.Sales) refers to the Sales value of the parent of the current member’s Market hierarchy.8 Relationship Functions Hyperion Essbase Calc Scripts @PARENTVAL The @PARENTVAL() function returns the parent value along the specified dimension for the member being calculated. Syntax @PARENTVAL (dimName [. "Market Share" = Sales % @PARENTVAL(Market. produces the following results: Sales Albany Buffalo New York State Los Angeles San Francisco California Market 360 240 600 1000 100 300 400 60 40 60 100 Market Share 25 75 40 8-16 Hyperion .

Syntax @SANCESTVAL (rootMbr. mbrName]) rootMbr . The following Product hierarchy is defined: Product 100 100-10 100-20 200 200-10 200-20 Diet ~ 100-10 SHARED 200-10 SHARED Caffeine Free ~ 100-20 SHARED 200-20 SHARED Hyperion 8-17 . The Marketing Expense data must be allocated down to each Product code based on Sales contribution.Hyperion Essbase Calc Scripts Relationship Functions 8 @SANCESTVAL The @SANCESTVAL() function returns ancestor-level data based on the shared ancestor value of the current member being calculated.genLevNum [.Defines a member that is used to search for the nearest occurrence of an ancestor of a shared member. Example Marketing expenses are captured at the Product Category levels in a product planning application. The Product categories are defined as ancestors that contain shared members as children.

which produces the following result: Sales 100-10 100-20 100 200-10 200-30 200 100-10 200-10 Diet 100-20 200-30 Caffeine Free 200 400 600 300 100 400 13. Sales)) * @SANCESTVAL(Product. 2.5 50 300 200 500 12. 2.8 Relationship Functions Hyperion Essbase Calc Scripts The Marketing Expense value is allocated down to each Product code with the following formula: Marketing = (Sales / @SANCESTVAL(Product.7 40 100 400 900 37.5 26. Marketing).7 #Missing Marketing 37. 8-18 Hyperion .5 12.3 #Missing Notes The time required for retrieval and calculation may be significantly longer if this function is in a formula attached to a member tagged as Dynamic Calc or Dynamic Calc and Store.5 13.3 26.

Syntax @SPARENTVAL(RootMbr [. The following Product hierarchy is defined: Product 100 100-10 100-20 200 200-10 200-20 Diet ~ 100-10 200-10 Caffeine Free ~ 100-20 200-20 SHARED SHARED SHARED SHARED The Marketing Expense value is allocated down to each Product code with the following calc script: FIX (@LVLMBRS(Products. Hyperion 8-19 . Marketing = (Sales / @SPARENTVAL(Product. The Marketing Expense data must be allocated down to each Product code based on Sales contribution. Marketing). mbrName]) RootMbr .0). Example Marketing expenses are captured at the Product Category (Diet and Caffeine Free) levels in a product planning application.Sales)) * @SPARENTVAL(Product. The Product categories are defined as parents that contain shared members as children.Defines a member that is used to search for the nearest occurrence of a parent of a shared member. ENDFIX.Hyperion Essbase Calc Scripts Relationship Functions 8 @SPARENTVAL The @SPARENTVAL() function returns parent-level data based on the shared parent value of the current member being calculated.

3 26.5 12.7 40 Notes The time required for retrieval and calculation may be significantly longer if this function is in a formula attached to a member tagged as Dynamic Calc or Dynamic Calc and Store.7 #Missing 37.5 13.8 Relationship Functions which produces the following result: Sales 100-10 100-20 100 200-10 200-30 200 100-10 200-10 Diet 100-20 200-30 Caffeine Free 200 400 600 300 100 400 100 400 900 300 200 500 Hyperion Essbase Calc Scripts Marketing 37. 8-20 Hyperion .5 50 13.5 26.3 #Missing 12.

How @XREF works The @XREF function retrieves values from a data source to be used in a calculation on a data target. The data source is described by a location alias.A location alias for the data source. The data source and data target outlines can be different. mbrList . Location aliases are set by the database administrator at the database level using Essbase Application Manager. username.A comma-delimited list of member names that qualify the @XREF query. or the API. and password. mbrList]) locationAlias . Point of view: the member combination currently being calculated on the data target (that is. on a different machine than the data target). the member combination that identifies the left hand side of a calculation). The members you specify for mbrList are sent to the data source in addition to the members in the current point of view in the data target. Syntax @XREF (locationAlias [. application. The following terminology is used to describe the @XREF function: Data target: the database on which the current calculation is running (that is. The data source then constructs a member combination. possibly remote database.Hyperion Essbase Calc Scripts Relationship Functions 8 @XREF The @XREF function is a cross-database function that allows a calculation taking place in one Essbase database to incorporate values from a different. The location alias specifies a server. This database may be remote (that is. the database on which the @XREF call originates). database. Data source: the database that is queried by the @XREF function. using in order of precedence: • • • The members specified in mbrList The members in the current point of view The top member in any unspecified dimensions in the data source Hyperion 8-21 . ESSCMD.

consider the following two databases: Main Database Year Qtr1 Qtr2 Measures Sales Units Product 100 100-10 100-20 Market East West Scenario Budget Forecast Inflation Rates Database (Location Alias: InflatDB) Year Qtr1 Qtr2 Assumptions Inflation Deflation = Inflation * . In this example.US).5 (Dynamic Calc) Country US Canada Europe The following formula is associated with the Main Database: Units = Units * @XREF(InflatDB.Inflation.8 Relationship Functions Hyperion Essbase Calc Scripts Example 1 For this example. Essbase calculates the following member combinations: Units->Qtr1->100-10->East->Budget = Units->Qtr1->100-10->East>Budget * Inflation->Qtr1->US Units->Qtr2->100-10->East->Budget = Units->Qtr2->100-10->East>Budget * Inflation->Qtr2->US and so on. 8-22 Hyperion .

this formula sets Inventory for Jan in 1999 to the Inventory value for Dec from 1998. Hyperion H H H H This formula would return two data values.0)). since the current point of view calls for only one data cell Inventory->West.Hyperion Essbase Calc Scripts Relationship Functions 8 Example 2 The following formula modifies the point of view on the data target: 1999->Jan->Inventory = @XREF(sourceDB. Jan:Mar).January). California. For example. If the cube on the data source (sourceDB) contains data only from 1998. Assume that the data target contains the member Jan. while the data source (sourceDB) contains the member January. one for Inventory in California and one for Inventory in Oregon. Example 3 The following formula defines a specific point of view on the data target: Sales->Jan = @XREF(sourceDB. the following formula is not valid: West->Inventory = @XREF(SourceDb. The member list cannot contain functions that return more than one member. 8-23 . @LEVMBRS(Market. The member list cannot contain ranges. This formula simply maps the member in the data target (Jan) with its corresponding member in the data source (January). consider the following formula: West->Inventory = @XREF(SourceDb. For example. Essbase returns an error message. Notes Essbase returns an error message if the members supplied in mbrList do not exist in the data source. and pulls Sales->January from sourceDB. However. the following formula is not valid: West->Inventory = @XREF(SourceDb. Oregon). The number of data cells queried on the data source must match the number of data cells expected on the data target.Dec). For example.

the following formula would calculate the sum of the sales of all red products and would assign the result to member RedThings: RedThings->Sales = @XREF(SourceDb. Defining a Location Alias The @XREF command uses a location alias name to identify the data source. the data target). @XREF can query all types of members supported by the Essbase server. For example. username and password to be assigned to the alias name. Hyperion . Average). data in the source database may change. Red. For example. if the data source classifies products based on a color attribute. the following formula calculates RedThings as the average sales of all red products: RedThings->Sales = @XREF(SourceDb. application. To define a location alias: In the server window of the Essbase Application Manager. select the application and database that accesses the source data (that is. Over the course of an @XREF calculation.8 Relationship Functions Hyperion Essbase Calc Scripts mbrList can contain attribute members. You need database designer privileges to maintain location alias definitions. @XREF does not incorporate changes made after the beginning of the calculation. Red). 8-24 H H H H 1) mbrList can contain attribute operators. Keep in mind that all performance considerations that apply to dynamic and attribute calculations also apply to @XREF queries that depend on dynamic and attribute members. A location alias is set at the database level and specifies the server. For example. members retrieved from a data source can be Dynamic Calc members as well as attribute members.

type the server name or IP address for the remote database.Hyperion Essbase Calc Scripts 2) Relationship Functions 8 Select Database / Location Aliases. ✍ Hyperion 8-25 . type the database name for the remote database. In the Database text box. Type the User name and Password in the respective text boxes. The location alias is added to the alias list: 6) 7) 8) 9) Click OK. Click Set. type the application name for the remote database. Use the Alias name in the @XREF formula. In the Application text box. In the Server text box. type the alias name for the remote database. The Location Aliases dialog displays: 3) 4) 5) In the Alias text box.

Create a calc script to allocate Corporate Expenses for all individual products to each product. Retrieve from the Essbase database into this sheet. Corporate Expenses are loaded at the product family level (for example. run the CSAncest calc script. based on percentage of individual product sales to total sales. These corporate expenses are to be allocated to each product. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSAncest SS_Ancest. 3) 4) 5) 6) 7) 8) 9) 8-26 Hyperion . Switch to the Calc&Retrieve sheet.8 Relationship Functions Hyperion Essbase Calc Scripts Exercise 8-1: Applying Relationship Function (@ANCESTVAL) In this exercise. clear all data from the HLandS1 database. Retrieve from the Essbase database into this sheet. Save the new script as CSAncest. based on percentage of individual product sales to total sales. 2000 Product Family). Open the SS_Ancest spreadsheet. you create a calc script that allocates Corporate Expenses for all individual products. 1000 Product Family. Close the spreadsheet. Are the values in the “Check your results” column the same as the retrieved results? If not. Notice that the values in the “Check your results” column are not calculated. For this exercise. modify the CSAncest calc script and rerun the calculation until all pink cells are populated with correct results.xls 1) 2) From Essbase Application Manager. From the Calc&Retrieve sheet. Lock and send the data in the Lock&Send sheet to the HLandS1 database.

Are the results in the “Average Inventory” column as expected? If not. Switch to the Calc&Retrieve sheet. you create a calc script that calculates the average inventory for each market. The average inventory for a Market member is calculated by averaging the ending inventory for each child member of that Market member. modify the CSCmbr calc script and rerun the calculation until these values are correct. Retrieve into this sheet. Perform a retrieval. The average inventory for a Market member is calculated by averaging the ending inventory for each child member of that Market member. Create a calc script to calculate the average inventory for each market. clear all data from the HLandS2 database.xls 1) 2) From Essbase Application Manager. Save the new script as CSCrmbr. Lock and send the data in the Lock&Send sheet to the HLandS1 database. Notice that the values “Average Inventory” column are #Missing. For this exercise. 3) 4) 5) 6) 7) 8) Hyperion 8-27 . Close the spreadsheet. From the Calc&Retrieve sheet. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSCrmbr SS_Currmbr. Open the SS_Currmbr spreadsheet. run the CSCrmbr calc script.Hyperion Essbase Calc Scripts Relationship Functions 8 Exercise 8-2: Applying Relationship Function (@CHILDREN) In this exercise.

Alias Server Application Database User name Password Type. COGS Localhost CALC COGS trnadmin Hyperion 5) 6) Click OK.xls 1) 2) From Essbase Application Manager. The COGS database contains. you create a calc script that calculates the Cost of Goods Sold for individual products. In the Location Aliases window. From the main menu. For this exercise. clear all data from the HLandS1 database.8 Relationship Functions Hyperion Essbase Calc Scripts Exercise 8-3: Applying Relationship Function (@XREF) In this exercise. select CALC:HLANDS1. 8-28 Hyperion . which have been loaded at the Product level. select Database / Location Aliases. Review the structure of the Calc:COGS database. for each product. the costs of goods sold as percentage of that product's sales.... type the following: In Field. you use the following files: Database CALC:HLandS1 CALC:COGS Calc Script (new) Spreadsheet CSXref SS_Xref. Set up Location Alias 3) 4) In the server window. The actual cost of goods is then calculated by multiplying these COGS percentages by the actual sales amounts.. The Location Aliases window displays.

Switch to the Calc&Retrieve sheet. run the CSXref calc script. Retrieve into this sheet. Are the results in the COGS column as expected? If not. Close the spreadsheet. Lock and send the data in the Lock&Send sheet to the HLandS1 database. Save the new script as CSXref. Test the Calc Script 8) 9) Open the SS_Xref spreadsheet. 10) 11) 12) 13) Hyperion 8-29 .Hyperion Essbase Calc Scripts Relationship Functions 8 Create the Calc Script 7) Create a calc script for the HLandS1 database to calculate the Cost of Goods Sold for individual products. Perform a retrieval and notice the results in the COGS column. which have been loaded at the Product level. modify the CSXref calc script and rerun the calculation until these values are correct. The Actual cost of goods is calculated by multiplying the COGS percentages (found in the COGS database) by the Actual Sales amounts. Notice that the values in the COGS column display #Missing. From the Calc&Retrieve sheet.

You can use these functions to refer to another value in a data series. that is. 8-30 Hyperion . these functions are dependent on the current member's position.8 Relationship Functions Hyperion Essbase Calc Scripts Unit Summary Relationship functions look up specific values within the database based on current cell location and a series of parameters. Relationship functions have an implicit current member argument.

) The value of the Population attribute for the current member. Hyperion 8-31 . the value of 100->Massachusetts. For current member “Diet Cola”->Massachusetts. check your understanding by responding to the following questions: 1) For each of the following situations.Hyperion Essbase Calc Scripts Relationship Functions 8 þ Check Your Understanding Now that you have completed the chapter. identify the Relationship function that you would use to retrieve the required value. the value of 100->East. The level number of the current member. Use the Sample Basic outline. (Multiple solutions may be correct for some of these answers. A value from another database. For current member “Diet Cola”->Massachusetts.

) @ATTRIBUTEVAL The value of the Population attribute for the current member. For current member “Diet Cola”->Massachusetts. identify the Relationship function that you would use to retrieve the required value. @MDPARENTVAL @XREF @CURLEV @PARENTVAL 8-32 Hyperion . The level number of the current member.8 Relationship Functions þ Check Your Understanding Solutions 1) Hyperion Essbase Calc Scripts For each of the following situations. Use the Sample Basic outline. A value from another database. the value of 100->Massachusetts. (Multiple solutions may be correct for some of these answers. For current member “Diet Cola”->Massachusetts. the value of 100->East.

you will be able to: • • Explain the purpose and use of Range and Financial Functions to generate member lists Practice using the Range and Financial Functions in a series of incremental exercises .9 Range and Financial Functions Chapter Objectives By the end of this chapter.

Essbase uses the level 0 members from the dimension set as Time. Range and Financial Function Parameters There are common parameters associated with the various Range and Financial Functions: mbrName rangeList Specifies a single member. this parameter indicates how missing and zero values are to be processed. Financial functions never return a value. member set functions. if rangeList is not specified. SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH Used in conjunction with an expList. A positive integer defines a generation number. you cannot apply any operator directly to the function. When an optional parameter. or range functions from the same dimension. A value of 0 or a negative integer defines a level number. these functions calculate a series of values internally based on the range specified.Includes in the operation all values specified in expList regardless of their content SKIPMISSING . across which the accumulation occurs. Optional comma-delimited list of members.Ignores all #MISSING values SKIPZERO . Thus.9 Range and Financial Functions Hyperion Essbase Calc Scripts Using Range and Financial Functions Range functions take a range of members as an argument. dimName1. Rather than return a single value. DimNameX genLevNum An integer value that defines the generation or level number from which the ancestor value is returned. they internally calculate a series of values based on the range specified and write the results to a range of cells. rather. 9-2 Hyperion .Ignores all 0 and #MISSING values dimName.Ignores all 0 values SKIPBOTH . Single dimension name specification. SKIPNONE .

The average value of the specified member across the specified range. The maximum value of the specified member across the specified range of members. The accumulation of principal and interest on a single payment over time. Each function is also described. Amount of compound interest on a series of periodic deposits. The depreciation amount per period that an asset may be depreciated using the declining balance method. @AVGRANGE @COMPOUND @COMPOUNDGROWTH @CURRMBRRANGE @DECLINE @DISCOUNT @GROWTH @INTEREST @IRR @MAXRANGE @MAXSRANGE @MDSHIFT @MINRANGE Hyperion 9-3 . The amount of simple interest of a value at the specified rate. in this chapter. A member list based on the relative position of the current member being calculated. The discounted value at the beginning of the first period for amounts at end each period. The Internal Rate of Return on a cash flow. A series of data values that are copied from shifted multiple dimension ranges. The maximum value of the specified member across the specified range of members allowing for skipping of #MISSING and/or 0 values.Hyperion Essbase Calc Scripts Range and Financial Functions 9 Summary of Range and Financial Functions This table summarizes the Range (and Financial) Functions. Function @ACCUM Returns Accumulated total values across the specified range. in detail. The minimum value of the specified member across the specified range of members. A series of values that represent a linear growth of an initial value across the specified range.

The amount per period that an asset in the current period may be depreciated using the sum of the years’ digits method. The summation of all the values of the specified member across the specified range. @NEXT @NEXTS @NPV @PRIOR @PRIORS @PTD @SHIFT @SLN @SUMRANGE @SYD 9-4 Hyperion . The amount per period that an asset in the current period may be depreciated using a straight-line depreciation method. The period-to-date values of members in the dimension tagged as Time. The specified subsequent cell value of the range for the specified member providing the option to skip #MISSING and/or zero values. The specified previous cell value of the range for the specified member. The specified subsequent cell value of the range for the specified member. The specified subsequent or previous cell value of the range for the specified member.9 Range and Financial Functions Hyperion Essbase Calc Scripts Function @MINSRANGE Returns The minimum value of the specified member across the specified range of members allowing for skipping of #MISSING and/or 0 values. The specified subsequent cell value of the range for the specified member providing the option to skip #MISSING and/or zero values. The Net Present Value of an investment based on the series of payments and income.

FY1992:FY1995). up to the current member in the dimension of which rangeList is a part. Hyperion 9-5 .500 5.500 3.000 2.000 #MI 0 #MI 1.500 1. This example produces the following results: FY1990 FY1991 FY1992 FY1993 FY1994 FY1995 Asset Accum_Asset 9. rangeList]) Example In this example.000 1. Accum_Asset is calculated using the following formula: "Accum Asset" = @ACCUM(Asset.Hyperion Essbase Calc Scripts Range and Financial Functions 9 @ACCUM The @ACCUM() function accumulates the values of mbrName within rangeList. @SIBLINGS). to ensure correct results. Syntax @ACCUM (mbrName [.000 0 1. consider the order in which Essbase sorts the generated member list. If you use a Essbase member set function to generate a member list for the rangeList parameter (for example.000 The results show that the values for Asset are accumulated starting with FY1992 and the accumulated values are placed in Accum_Asset for FY1992 through FY1995: Notes @ACCUM accepts the @ATTRIBUTE member set function as a member range.

Syntax @AVGRANGE(SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. West=@AVGRANGE(SKIPNONE.Sales. rangeList]) Example The following example is based on the Sample Basic database. mbrName [.@CHILDREN(West)).9 Range and Financial Functions Hyperion Essbase Calc Scripts @AVGRANGE The @AVGRANGE() function returns the average value of the specified member across the specified range. 9-6 Hyperion . This example produces the following (partial) results: Jan California Oregon Washington Utah Nevada West 100 200 300 400 500 300 Feb 100 200 300 400 #Missing 200 Mar 100 200 0 400 500 240 Notes The @AVGRANGE function accepts the @ATTRIBUTE member set function as a member range.

Syntax @COMPOUND(balanceMbr. Essbase uses the level 0 members from the dimension tagged as Time.0525 2.8144 FY1995 0.000 273. variable name. If balanceMbr is a member.0525.If rangeList is not specified. then Essbase assumes balanceMbr to be a single deposit in the first member of rangeList.Single member specification representing the beginning balance across a range of periods. across a series of fiscal years: "Compound Interest"= @COMPOUND(Deposit. then it is assumed to be a series of deposits.0525 0 288.FY1991:FY1995). Example The following example determines the compound interest of a series of deposits.0525 0 110.Hyperion Essbase Calc Scripts Range and Financial Functions 9 @COMPOUND The @COMPOUND() function compiles the amount of a compound interest based on the balances of the specified member at the specified rate across the specified range. based on a credit rate of 0.1897 Notes If balanceMbr is a single value.5125 FY1994 0. Hyperion 9-7 . rangeList]) balanceMbr . rateMbrConst [. rateMbrConst . rangeList represents the range over which the interest is compounded.Single member specification."Credit Rate". or a range. This example produces the following results: FY1991 Credit Rate Deposit Compound Interest 0. This is equivalent to entering the value in the first member in the rangeList followed by zeros.0525 3.0525 0 0 FY1992 0.000 105 FY1993 0. or numeric expression in decimal form that represents the interest rate per time period specified in the rangeList.

Example The following example determines the compound growth of Principal Amount based on Growth Rate across a series of fiscal years. "Growth"= @COMPOUNDGROWTH("Principal".0525 2331.Member specification representing the initial value to be compounded. Syntax @COMPOUNDGROWTH(principalMbr. or expression which provides a constant value. rangeList]) principalMbr . This example produces the following results: FY1991 FY1992 FY1993 FY1994 FY1995 FY1996 Principal Rate Growth 2000 0.0525 2718.0525 2215.25 0."Rate". variable name. The input line must be a single deposit.FY1991:FY1996). 9-8 Hyperion .10 0.9 Range and Financial Functions Hyperion Essbase Calc Scripts @COMPOUNDGROWTH The @COMPOUNDGROWTH() function calculates a series of values that represent a compound growth of the first nonzero value in the specified member across the specified range of members. rateMbrConst .71 Notes You can change the growth rate from period to period by placing a nonzero value in the current period's rateMbrConst cell.83 0.Single member specification. rateMbrConst [.0525 2583.0525 2454.0525 2105 0.51 0.

Syntax @CURRMBRRANGE(dimName. Hyperion 9-9 . genLevNum.Defines whether the range list to be returned is based on a generation or a level within the dimension. startOffset Defines the first member in the range to be returned: • • A null value indicates the first member of the specified genLevNum. [startOffset]. • 0 for the member currently being calculated. An integer value returns the member name relative to the current member being calculated: • Negative value for a prior member.{GEN|LEV}.Integer value that defines the absolute generation or level number of the range list to be returned. • • A null value returns the last member of the specified genLevNum. The startOffset and endOffset parameters create a subset of this list. An integer value indicates the member relative to the current member being calculated: • Negative value for a prior member. endOffset Defines the last member in the range to be returned. • positive value for a subsequent member. • 0 for the member currently being calculated. The first three parameters of this function (dimName. {GEN|LEV}.genLevNum) provide a member range list. • positive value for a subsequent member. genLevNum .Hyperion Essbase Calc Scripts Range and Financial Functions 9 @CURRMBRRANGE The @CURRMBRRANGE() function generates a member list that is based on the relative position of the current member being calculated. [endOffset]) GEN|LEV .

Jul.0. In this example. Feb) (Jan.1) Current Member Jan Feb Mar Returns (Jan. Consider the following statement: @CURRMBRRANGE(Year. Mar. Mar) (Jan. Feb. Sep. Dec). Feb.9 Range and Financial Functions Hyperion Essbase Calc Scripts Example 1 The following examples use the Sample Basic database. Oct. Feb. Apr) 9-10 Hyperion . Feb) (Jan.LEV. Mar) (Feb. Mar. Apr) Consider the following statement: @CURRMBRRANGE(Year. Mar. Aug. Apr.0) Current Member Jan Feb Mar Apr Returns (Jan) (Jan. Nov.-1. Feb. the full range list contains the level 0 members of the Year dimension (Jan.LEV. May.0.. Jun.

and @SHIFT. . 1. . this function can be used only within range and financial functions."Opening Inventory". and dividing the result by the number of periods to date plus one period. This example produces the following result: Jan Opening Inventory Average Inventory 100 Feb 110 Mar 120 Apr 130 . LEV. specifies that the member after the current member being calculated is included in each average operation. "Average Inventory" = @AVGRANGE(SKIPNONE.Hyperion Essbase Calc Scripts Range and Financial Functions 9 Example 2 Average Inventory is calculated by summing opening inventories from the first month of the year next month. The values for Nov and Dec are the same since there is no member after Dec in the range list. @COMPOUND. the average operations always begin at the first member of the range list. . 155 155 Since a null value is specified for startOffset. Notes You cannot use the @CURRMBRRANGE function in a FIX statement. 1)). such as @AVGRANGE. @MAXRANGE. Currently. 0.@CURRMBRRANGE(Year. Hyperion 9-11 . . Nov 200 Dec 210 105 110 115 120 . Jan. The endOffset parameter. .

or numeric expression that provides a constant value. lifeMbrConst. salvageMbrConst . factorMbrConst [. This value represents the value of the asset at the end of the depreciation.2.Single member specification.Life. variable name. or numeric expression that provides a constant value. For example.9 Range and Financial Functions Hyperion Essbase Calc Scripts @DECLINE The @DECLINE() function calculates the amount per period that an asset in the current period may be depreciated for the specified period using the declining balance method.Single member specification representing the starting value of the asset(s). or numeric expression that provides a constant value.160 FY1993 0 0 0 1. This value represents the number of periods over which the asset is depreciated. Syntax @DECLINE (costMbr. factorMbrConst . set factorMbrConst to 2. This value represents the factor by which the asset is depreciated. rangeList]) costMbr . lifeMbrConst . "Decline Dep" = @DECLINE(Asset.296 FY1994 0 0 0 778 9-12 Hyperion . variable name.Residual.Single member specification.FY1991:FY1994). variable name. Example The following example calculates the depreciation of Asset for the specified series of fiscal years. to calculate a double declining balance.600 FY1992 0 0 0 2. This example produces the following results: FY1991 Asset Residual Life Decline Dep 9. salvageMbrConst.000 750 5 3.Single member specification.

and then that same percentage is applied to the undepreciated amount in subsequent years. rather than to the original cost.Method of accelerated depreciation.Hyperion Essbase Calc Scripts Range and Financial Functions 9 Notes More than one asset can be input and depreciated across the specified range. Hyperion 9-13 . Double-Declining Balance Depreciation Method . in which double the Declining Balance Depreciation Method amount is taken the first year. The function calculates each asset separately. Declining Balance Depreciation Method .A rapid depreciation method in which a percentage rate is applied to the undepreciated balance.

00 0.FY1991:FY1995). variable name.00 0. rangeList]) cashMbr . The value represents the rate per period which cashMbr is discounted.38 FY1992 1000.05 907. Syntax @DISCOUNT (cashMbr.03 FY1993 1000. It is a decimal value.00 0.00 0. rateMbrConst . or numeric expression which provides a constant value.84 FY1994 1000.05 863.Member specification representing the value(s) you want to discount from the last period in rangeList to the current period.70 FY1995 1000.05 822."Credit Rate".53 Notes More than one value can be discounted simultaneously in this manner. 9-14 Hyperion .Member specification. This example produces the following results: FY1991 Cash Credit Rate Discount 1000. "Discount" = @DISCOUNT(Cash.05 783. Example The following example discounts the values in Cash by the rates in Credit Rate and places the results in Discount Amount for each fiscal year.9 Range and Financial Functions Hyperion Essbase Calc Scripts @DISCOUNT The @DISCOUNT() function calculates the discounted value at the beginning of the first period for amounts at end each period.00 0.05 952. not a percent. rateMbrConst [.

using the rate found in Growth Rate for each fiscal year. "Amount"=@GROWTH("Principal". Example The following example calculates the growth of Principal. The first nonzero value encountered is the initial value."Growth Rate".050 1.480 Hyperion 9-15 .07 0.000 FY1994 0 FY1995 0 FY1996 0 0.280 1.1).200 1. variable name.Single member specification that represents the initial value of the value to grow. rateMbrConst .380 1.000 FY1992 0 FY1993 2.1 0.08 0. The results are placed in Growth Amount. Other principalMbr values after the first are ignored. This example produces the following results: FY1991 Principal Amount Growth Rate Growth Amount 1.08 0. Syntax @GROWTH(principalMbr.1 1.Hyperion Essbase Calc Scripts Range and Financial Functions 9 @GROWTH The @GROWTH() function calculates a series of values that represent a linear growth of an initial value across the specified range. rangeList]) principalMbr .05 0.120 1. rateMbrConst [.FY1991:FY1996).Single member specification. or numeric expression providing a constant value that represents the decimal growth rate to be applied (for example. 10% = .

The interest is calculated for each time period in the specified range. or numeric expression providing a constant value.00 -112. Example This example calculates the interest for Balance. If the value specified by balanceMbr is negative.Single member specification. variable name.1125 0.065 FY1992 3000 0. variable name. the interest rate applied is the value specified by balanceMbr.065 FY1996 -6000 0.9 Range and Financial Functions Hyperion Essbase Calc Scripts @INTEREST The @INTEREST() function calculates the simple interest of a value at the specified rate. or numeric expression providing a constant value. The results are placed in Amount for each fiscal year. The value must be a decimal number corresponding to a percentage value. If the value specified by balanceMbr is positive.1125 0."Borrow Rate". "Amount" = @INTEREST(Balance. the interest rate applied is the value specified by creditrateMbrConst.Single member specification. creditrateMbrConst .1125 130.1125 0.065 FY1995 9000.00 0.50 195.1125 0. borrowrateMbrConst [.FY1991:FY1996).Single member specification representing the balance at the time the interest is calculated.00 585. creditrateMbrConst. The value must be a decimal number that corresponds to a percentage.00 195. rangeList]) balanceMbr .065 0. using Credit Rate for positive balances and using Borrow Rate for negative balances. borrowrateMbrConst .1125 0.00 -675. FY1991 Balance Credit Rate Borrow Rate Amount 2000 0."Credit Rate".065 FY1994 3000 0.065 FY1993 -1000 0. Syntax @INTEREST(balanceMbr.00 9-16 Hyperion .

Hyperion Essbase Calc Scripts

Range and Financial Functions

9

@IRR

The @IRR() function calculates the Internal Rate of Return on a cash flow that must contain at least one investment (negative) and one income (positive) value.

Syntax

@IRR(cashflowMbr, discountFlag[, rangeList]) cashflowMbr Single member specification. discountFlag Member specification, variable name, or numeric expression providing a constant value of either 1 or 0. discountFlag indicates whether the function should discount from the first period. 1 means do not discount from the first period.

Example

Example This example calculates the Internal Rate of Return (Return) on a cash flow (Cash).

Return = @IRR(Cash,0,FY1991:FY1996);

**This example produces the following results:
**

FY1991 Cash Return (1,000) 0.41 FY1992 500 0.41 FY1993 500 0.41 FY1994 500 0.41 FY1995 500 0.41 FY1996 500 0.41

Notes

Essbase returns #MISSING from calculator function @IRR if all cash flows are zero.

Hyperion

9-17

9

Range and Financial Functions

Hyperion Essbase Calc Scripts

@IRR provides an initial guess of 0.07. This cannot be changed, in contrast to similar functions in Excel. Because results depend in part on the initial guess, any difference in the initial guess may result in a different result. Even if both Excel and Essbase start with the same initial guess, results may differ. This is because there may be more than one solution to an equation, and the algorithm stops looking when it finds a valid solution. Which solution is found first may differ based on the algorithm. Although leading or trailing zeros do not matter in a mathematical context, the algorithm may behave differently and find a different root because of the presence of leading or trailing zeros. If you need identical solutions regardless of the presence of leading or trailing zeros, you may wish to create a custom-defined function to handle these issues.

9-18

Hyperion

Hyperion Essbase Calc Scripts

Range and Financial Functions

9

@MAXRANGE

The @MAXRANGE() function returns the maximum value of the specified member across the specified range of members.

Syntax

@MAXRANGE (mbrName [ ,rangeList])

Example

In the Sample Basic database: Qtr1 = @MAXRANGE(Sales,@CHILDREN(Qtr1)); This example produces the following results:

Jan Sales 678 Feb 645 Mar 675 Qtr1 678

Notes

Depending on the values in the list, @MAXRANGE may return a zero(0) or #MISSING value. For full control over skipping or inclusion of zero(0) and #MISSING values, it is recommended to use the @MAXSRANGE function instead of the @MAXRANGE function.

Hyperion

9-19

9

Range and Financial Functions

Hyperion Essbase Calc Scripts

@MAXSRANGE

The @MAXSRANGE() function returns the maximum value of the specified member across the specified range of members. @MAXSRANGE enables skipping of #MISSING and 0 values, in contrast with the @MAXRANGE function, which cannot ignore these values.

Syntax

@MAXSRANGE (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH, mbrName [ ,rangeList])

Examples

For both examples, assume a database similar to Sample Basic. Example 1

COGS( Qtr1_Max = @MAXSRANGE(SKIPBOTH, COGS, Jan:Mar);) Other_Exp( Qtr1_Min = @MAXSRANGE(SKIPBOTH, Other_Exp, Jan:Mar);)

**This example ignores #MISSING and 0 values and produces the following results:
**

Jan Other_Exp COGS -500 0 Feb #MISSING 1500 Mar -250 2300 Qtr1_Max --500 1500

Example 2

Qtr1_Max = @MAXSRANGE (SKIPNONE, OtherInc_Exp, @CHILDREN(Qtr1));

**produces the following results:
**

Jan Other_Exp COGS -500 0 Feb #MISSING 1500 Mar -250 2300 Qtr1_Max 0 0

9-20

Hyperion

Hyperion Essbase Calc Scripts

Range and Financial Functions

9

Notes

@MAXSRANGE (SKIPNONE, mbrName, rangeList) is equivalent to @MAXRANGE mbrName, (rangeList). #MISSING values are considered to be greater than negative data values and less than positive data values. If the data being calculated includes only negative and #MISSING values, @MAXSRANGE returns #MISSING. For all members, @MAXSRANGE returns the value calculated for the specified member and range list.

Hyperion

9-21

9

Range and Financial Functions

Hyperion Essbase Calc Scripts

@MDSHIFT

The @MDSHIFT() function shifts a series of data values across multiple dimension ranges.

Syntax

@MDSHIFT (mbrName, shiftCnt1, dimName1, [range1], . . . shiftCntX, dimNameX, [rangeX]) shiftCnt1...shiftCntX - Integer that defines the number of member positions to shift. range1 . . . rangeX - A valid member name, a comma-delimited list of member names, member set functions, and range functions from the same dimension. If the range list is comma delimited, then the list must be enclosed in parentheses.

Example

The Budget figures for Ending Inventory need to be calculated by taking Prior Year->Opening Inventory results as a starting point:

FIX (Budget) "Ending Inventory" = @MDSHIFT("Opening Inventory", 1, Year, , -1, Scenario,); ENDFIX

In this example, range1 is not specified, so Essbase defaults to the level 0 members of the Year dimension, which was specified as the dimName1 parameter. Since range2 is also not specified, Essbase defaults to the level 0 members of the Scenario dimension, which was specified as the dimName2 parameter. This example produces the following (partial) results:

Jan Prior Year Opening Inventory Ending Inventory 110 Feb 120 Mar 130

Budget

120

130

140

9-22

Hyperion

Hyperion Essbase Calc Scripts

Range and Financial Functions

9

@MINRANGE

The @MINRANGE() function returns the minimum value of the specified member across the specified range of members.

Syntax

@MINRANGE (mbrName [ ,rangeList])

Example

In the Sample Basic database:

Qtr1 = @MINRANGE(Sales,Jan:Mar);

**This example produces the following results:
**

Jan Sales 678 Feb 645 Mar 675 Qtr1 645

Notes

Depending on the values in the list, @MINRANGE may return a zero(0) or #MISSING value. For full control over skipping or inclusion of zero(0) and #MISSING values, it is recommended to use the @MINSRANGE function instead of the @MINRANGE function.

Hyperion

9-23

9

Range and Financial Functions

Hyperion Essbase Calc Scripts

@MINSRANGE

The @MINSRANGE() function returns the minimum value of mbrName across rangeList. @MINSRANGE enables skipping of #MISSING and 0 values, in contrast with the @MINRANGE function, which always includes these values in the calculation.

Syntax

@MINSRANGE (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH, mbrName [,rangeList])

Examples

For both examples, assume a database similar to Sample Basic. Example 1

COGS( Qtr1_Min = @MINSRANGE(SKIPBOTH, COGS, Jan:Mar);) Other_Exp( Qtr1_Min = @MINSRANGE(SKIPBOTH, Other_Exp, Jan:Mar);)

**This example ignores the 0 value for Mar and produces the following results:
**

Jan COGS Other_Exp #MISSING 500 Feb 1500 350 Mar 2300 0 Qtr1_Min 1500 350

Example 2

COGS( Qtr1_Min = @MINSRANGE(SKIPNONE, COGS, Jan:Mar);) Other_Exp( Qtr1_Min = @MINSRANGE(SKIPNONE, Other_Exp, Jan:Mar);)

This example does not ignore the 0 value in the calculation. This example produces the following results:

Jan COGS Other_Exp #MISSING 500 Feb 1500 350 Mar 2300 0 Qtr1_Min #Missing 0

9-24

Hyperion

Iif the data being calculated includes only positive and #MISSING values. rangeList) is equivalent to @MINRANGE (mbrName. Hyperion 9-25 . rangeList).Hyperion Essbase Calc Scripts Range and Financial Functions 9 Notes @MINSRANGE (SKIPNONE. #MISSING values are considered to be less than positive data values and more than negative data values. @MINSRANGE returns #MISSING. mbrName.

retaining all other members identical to the current member. @NEXT cannot operate outside the given range. Next Cash for each month is derived by taking the Cash value for the following month.Feb. Using a negative value for n has the same effect as using the matching positive value in the @PRIOR function.). the level 0 members from the dimension tagged as Time are used (Jan. which provides the next member in the range.9 Range and Financial Functions Hyperion Essbase Calc Scripts @NEXT The @NEXT() function returns the nth cell value in the sequence rangeList from mbrName. the default is 1.Mar.2). Since rangeList is not specified. "Next Cash" = @NEXT(Cash). Example In this example. Since n is not specified. “Two Cash” = @NEXT(Cash . This example produces the following results: Jan Cash Next Cash Two Cash Feb 100 90 120 Mar 90 120 110 Apr 120 110 150 May 110 150 100 Jun 150 100 #MI 100 #MI #MI Notes If you do not specify n. 9-26 Hyperion . rangeList]) n . . Syntax @NEXT (mbrName [.signed integer.. n. then the default is set to 1. which provides the next member in the range..

Cash)..Mar.signed integer. Hyperion 9-27 . Next Cash for each month is derived by taking the Cash value for the following month and ignoring both #MISSING and zero values. If you do not specify n.rangeList]) n . @NEXTS works within a designated range and retains all other members identical to the current member. Cash. "Next Cash" = @NEXTS(SKIPBOTH. then a default value of 1 is assumed. the level 0 members from the dimension set as Time are used (Jan. Jan Cash Next Cash Two Cash 1100 1000 1000 Feb #MI 1000 1300 Mar 1000 1300 1400 Apr 1300 1400 #MI May 0 1400 #MI Jun 1400 #MI #MI Notes Using a negative value for n has the same effect as using the matching positive value in @PRIORS. "Two Cash" = @NEXTS(SKIPBOTH. the default is 1.). @NEXTS provides the option to skip #MISSING. Also.. Syntax @NEXTS(SKIPNONE | SKIPMISSING | SKIPZERO | | SKIPBOTH mbrName[. which returns the next prior member from the lowest level of the dimension set as Time in the database outline.Hyperion Essbase Calc Scripts Range and Financial Functions 9 @NEXTS The @NEXTS() function returns the nth cell value in the sequence rangeList from the mbrName.Feb. or both #MISSING and zero values. Example In this example. 2). which provides the next member in the range. Because n is not specified. because rangeList is not specified.n. zero..

05 1547.Member specification providing a series of numeric values. variable name. rangeList]) cashflowMbr .62 1547. variable name.9 Range and Financial Functions Hyperion Essbase Calc Scripts @NPV The @NPV() function calculates the Net Present Value of an investment based on the series of payments (negative values) and income (positive values). Rate.Single member specification.000) .62 1547.62 1547. or numeric expression. 0. 1 means do not discount from the first period. Value is calculated with the following formula: Value = @NPV(Cash. Syntax @NPV (cashflowMbr. FY1991:FY1996). or numeric expression set to 0 or 1 to indicate whether the function should discount from the first period. Example In this example. discountFlag .62 1547. providing a constant value.62 FY1992 500 FY1993 500 FY1994 500 FY1995 500 FY1996 500 9-28 Hyperion . rateMbrConst.62 1547.Single member specification. This example produces the following report: FY1991 Cash Rate Value (1. discountFlag [. rateMbrConst .

signed integer. If you do not specify n. 2). Prev Inventory for each month is derived by taking the Inventory value from the previous month. Example In this example. which returns the next prior member from the lowest level of the dimension tagged as Time in the database outline. Hyperion 9-29 . rangeList]) n . Syntax @PRIOR (mbrName [. Prev2 = @PRIOR(Value. then a default value of 1 is assumed. n. Prev = @PRIOR(Value). This example produces the following results: Jan Value Prev Prev2 1100 #MI #MI Feb 1200 1100 #MI Mar 1300 1200 1100 Apr 1400 1300 1200 May 1500 1400 1300 Jun 1600 1500 1400 Notes Using a negative value for n has the same effect as using the matching positive value in the @NEXT function.Hyperion Essbase Calc Scripts Range and Financial Functions 9 @PRIOR The @PRIOR() function returns the nth previous cell member from mbrName in rangeList.

"Prev" = @PRIORS(SKIPBOTH. zero. the default is 1. 9-30 Hyperion . rangeList]) n .). @PRIORS works within the designated range.Mar. the level 0 members from the dimension are set as Time used as (Jan. which returns the next prior member from the lowest level of the dimension set as Time in the database outline. which provides the next prior member in the range.n. Because n is not specified.2).signed integer. Example In this example. If you do not specify n. then a default value of 1 is assumed. Syntax @PRIORS(SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH mbrName[. This example produces the following results: Jan Value Prev Prev2 1100 #MI #MI Feb #MI 1100 #MI Mar 1300 1100 #MI Apr 1400 1300 1100 May 0 1400 1300 Jun 1600 1400 1300 Notes Using a negative value for n has the same effect as using the matching positive value in the @NEXTS function. Also. Prev Inventory for each month is derived by taking the Inventory value from the previous month and ignoring #MISSING and zero values. @PRIORS provides options to skip #MISSING.Feb.Value.Value). "Prev2" = @PRIORS(SKIPBOTH.9 Range and Financial Functions Hyperion Essbase Calc Scripts @PRIORS The @PRIORS() function returns the nth previous cell member from mbrName in the rangeList. All other dimensions assume the same members as the current member.. or both #MISSING and zero values. because rangeList is not specified...

Ending Inventory is tagged time balance .Last. Example In this example. YTD and QTD.Range of members from the dimension tagged as Time. Opening Inventory is tagged time balance . Syntax @PTD (timePeriodList) timePeriodList . data is summed unless Accounts are tagged as "First" or "Last". By default. QTD = @PTD(Apr:May). assume that the Year dimension in the Sample Basic database outline contains two additional members. which returns the period’s first and last value.First. This example produces the following results: Sales Jan Feb Mar Qtr1 Apr May Jun Qtr2 QTD YTD 1000 1000 1000 3000 1000 1000 1000 3000 2000 5000 Opening Inventory 1000 1100 1200 3000 1300 1400 1500 3000 1300 1000 Ending Inventory 1100 1200 1300 3000 1400 1500 1600 3000 1500 1500 Hyperion 9-31 . YTD = @PTD(Jan:May).Hyperion Essbase Calc Scripts Range and Financial Functions 9 @PTD The @PTD() function calculates the period-to-date values of members in the dimension tagged as Time. respectively.

based on n. depending on the database state when the call occurs (that is. The direction of shift is wholly based on n. Next Avl Asset for each month is derived by taking the Asset value from two months following the current month because 2 is specified as the n parameter. retaining all other members identical to the current member.1).signed integer.9 Range and Financial Functions Hyperion Essbase Calc Scripts @SHIFT The @SHIFT() function returns the nth cell value in the sequence rangeList from mbrName.n. the level 0 members from the dimension tagged as Time are used. with positive n values producing an effect equivalent to @NEXT and negative values of n producing an equivalent effect to @PRIOR. "Prev" = @SHIFT(Value.-1). This example produces the following results: Jan Value Prev Next 1100 #MI 1200 Feb 1200 1100 1300 Mar 1300 1200 1400 Apr 1400 1300 1500 May 1500 1400 1600 Jun 1600 1500 #MI Notes This function gets either the prior or next (nth past or future value in rangeList) value of mbrName. "Next" = @SHIFT(Value. 9-32 Hyperion . Example In this example. self-documenting name than @NEXT or @PRIOR when the value for n is a variable and may change from positive to negative. Prev Asset for each month is derived by taking the Asset value from the previous month because -1 is specified as the n parameter. Since rangeList is not specified for either formula. Syntax @SHIFT (mbrName [. when the usage is likely to be NEXT and/or PRIOR). rangeList]) n . @SHIFT is provided as a more appropriate.

Single member specification representing an input asset for the current period. This example produces the following results: FY1991 Asset Residual Life SLN Dep 9000 750 5 1650 1650 1650 1650 1650 #MI FY1992 FY1993 FY1994 FY1995 FY1996 Notes More than one asset may be depreciated over the range.FY1991:FY1996). salvageMbrConst . calculated across a range of periods.Life. the salvage value of the asset (Residual).Single member specification. salvageMbrConst. Syntax @SLN(costMbr.Hyperion Essbase Calc Scripts Range and Financial Functions 9 @SLN The @SLN() function calculates the amount per period that an asset in the current period may be depreciated. variable name.Residual. Example In this example.Single member specification. lifeMbrConst . "SLN Dep" = @SLN(Asset. This value represents the value of the asset in the current period at the end of the useful life of the asset. or numeric expression representing the useful life of the asset. Hyperion 9-33 . lifeMbrConst [. variable name. providing a constant numeric value. rangeList]) costMbr . or numeric expression. the depreciation for each year is calculated by taking into account the initial asset (Asset). Straight line depreciation calculates the depreciation of an asset assuming it will depreciate an equal amount of value each year. and the life of the asset (Life). It uses a straight-line depreciation method.

Syntax @SUMRANGE(mbrName [.9 Range and Financial Functions Hyperion Essbase Calc Scripts @SUMRANGE The @SUMRANGE() function returns the summation of all the values of the specified member across the specified range. This example produces the following (partial) results: Sales Jan Feb Mar Qtr1 Apr May Jun Qtr2 Partial Year 400 100 100 100 300 100 100 100 300 9-34 Hyperion . Assume that the Year dimension contains an additional member. "Partial Year"=@SUMRANGE("New York". rangeList]) Example The following example is based on the Sample Basic database. Partial Year.Feb:May).

Hyperion 9-35 . Example In this example. This example produces the following results: FY1991 Asset Residual Life SYD Dep 9000 750 5 2750 2200 1650 1100 550 #MI FY1992 FY1993 FY1994 FY1995 FY1996 Notes More than one asset may be depreciated over the range. salvageMbrConst.Single member specification. or numeric expression. across a range of periods. the depreciation for each year is calculated by taking into account the initial asset (Asset). and the life of the asset (Life). Sum of years’ digits calculates depreciation of an asset by assuming higher depreciation charges in the early years of an asset's life. providing a constant numeric value. This value is the value of the asset in the current period after the useful life of the asset.Hyperion Essbase Calc Scripts Range and Financial Functions 9 @SYD The @SYD() function calculates the amount per period that an asset in the current period may be depreciated. variable name. or numeric expression representing the useful life of the asset. salvageMbrConst .Single member specification. the salvage value of the asset (Residual). rangeList]) costMbr . SYD Dep"=@SYD(Asset. variable name.Single member specification representing an input asset for the current period.FY1991:FY1996). Syntax @SYD (costMbr. The depreciation method used is sum of the years’ digits. lifeMbrConst [.Life.Residual. lifeMbrConst .

Are the values in the yellow cells as expected? If not. The values in yellow have not been calculated. Retrieve into this sheet.xls 1) 2) From Essbase Application Manager. Create a calc script to calculate opening inventory and inventory additions. 3) 4) 5) 6) 7) 8) 9-36 Hyperion . revise the CSPrior calc script and rerun the calculation until the yellow cells contain the expected results. run the CSPrior calc script. Close the spreadsheet.9 Range and Financial Functions Hyperion Essbase Calc Scripts Exercise 9-1: Applying Range Functions (@PRIOR) In this exercise. The opening inventory value is the ending inventory for the previous month. Perform a retrieval and notice the calculation results within the yellow cells. January opening inventory is difference between January’s ending inventory and additions. For this exercise. Save the new script as CSPrior. The opening inventory value is the ending inventory for the previous month. January opening inventory is difference between January’s ending inventory and additions. Additions are the difference between ending and opening inventory for the month. From the Calc&Retrieve sheet. Open the SS_Prior spreadsheet. Lock and send the data in the Lock&Send sheet to the HLandS2 database. Switch to the Calc&Retrieve sheet. clear all data from the HLandS2 database. Additions are the difference between ending and opening inventory for the month. you create a calc script that calculates opening inventory and inventory additions. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSPrior SS_Prior.

000 to purchase the capability to produce the "4000 Product Family". Compare the ROI results with the values in the “Expected Res” sheet.000 to purchase the capability to produce the "4000 Product Family". clear all data from the HLandS2 database. The values in yellow have not been calculated.xls 1) From Essbase Application Manager. Database Calc Script (new) Spreadsheet CALC:HLandS2 CSIrr SS_Irr. 2) 3) 4) 5) 6) 7) 8) Hyperion 9-37 . Open the SS_Irr spreadsheet. Lock and send the data in the Lock&Send sheet to the HLandS2 database. From the Calc&Retrieve sheet. Switch to the Calc&Retrieve sheet. Close the spreadsheet. Save the new script as CSIrr. Hook Line and Sinker invested $38. Create a calc script to calculate the internal rate of return on an investment. Hook Line and Sinker invested $38. Perform a retrieval and notice the ROI calculation results. If they are not the same. In 1997. The ROI is calculated using this product family’s profits for the subsequent years.Hyperion Essbase Calc Scripts Range and Financial Functions 9 Exercise 9-2: Applying Financial Functions (@IRR) In this exercise. In 1997. Retrieve into this sheet. modify the CSIrr calc script and rerun the calculation until you get the expected results. run the CSIrr calc script. The ROI is calculated using the product line profits for the subsequent years. you create a calc script that calculates the internal rate of return on an investment.

these functions calculate a series of values internally based on the range specified. Rather than return a single value. Financial functions execute specialized financial calculations.9 Range and Financial Functions Hyperion Essbase Calc Scripts Unit Summary Range and Financial functions perform mathematical operations on a range of values. 9-38 Hyperion .

identify the Range (Financial) function that you would use to retrieve the required value. (Multiple solutions may be correct for some of these answers.) What the value of sales for the month in which sales is largest? What is the value of sales three months after the month currently being processed? What is the average amount of monthly sales? What is the amount of compound interest for a series of debt payments? What is the internal rate of return on an investment? Hyperion 9-39 . Use the Sample Basic outline. check your understanding by responding to the following questions: 1) For each of the following situations.Hyperion Essbase Calc Scripts Range and Financial Functions 9 þ Check Your Understanding Now that you have completed the chapter.

Use the Sample Basic outline.9 Range and Financial Functions þ Check Your Understanding Solutions 1) Hyperion Essbase Calc Scripts For each of the following situations. identify the Range (Financial) function that you would use to retrieve the required value. (Multiple solutions may be correct for some of these answers.) @MAXRANGE What the value of sales for the month in which sales is largest? What is the value of sales three months after the month currently being processed? What is the average amount of monthly sales? What is the amount of compound interest for a series of debt payments? What is the internal rate of return on an investment? @NEXT @AVGRANGE @COMPOUND @IRR 9-40 Hyperion .

10 Allocation Functions Chapter Objectives By the end of this chapter. you will be able to: • • Explain the purpose and use of Allocation functions to generate member lists Practice using the Allocation functions in a series of incremental exercises .

If amount is a cross-dimensional member. In addition. @DESCENDANTS(Product)). basisMbr A value. If amount is a member. member. member set functions. 10-2 Hyperion . or cross-dimensional member that contains the values that provide the basis for the allocation. roundMbr The member or cross-dimensional member to which rounding errors are added. into which value(s) from amount are allocated. the member must be from the dimension to which allocationRange belongs. the @MDALLOCATE function has an extra set of parameters to identify the dimensions that are used to distribute the amount. The values are allocated across child members in one or more dimensions. allocationRange A comma-delimited list of members.10 Allocation Functions Hyperion Essbase Calc Scripts Using Allocation Functions Allocation functions allocate values that are input at the parent level. member. These functions consolidate the common tasks that are required to perform allocations in Essbase. or range functions from the same dimension. at least one of its members must be from the dimension to which allocationRange belongs. or cross-dimensional member that contains the value to be allocated into allocationRange. The method you specify determines how the basis data is used. @CHILDREN(Total Expenses) rather than from multiple levels (for example. The value may also be a constant. The parameters that are common to both allocation functions are described here. based on specified criteria. The member (or at least one member of a cross-dimensional member) must be included in allocationRange. amount A value. allocationRange should be from only one level (for example. Common Parameters The allocation functions share a common set of parameters.

and stores #MISSING for values in allocationRange for which the basisMbr is zero. percent Takes a percentage value from basisMbr for each member in allocationRange and applies the percentage value to amount: amount * (@CURRMBR()->basisMbr * . One of the following: Uses basisMbr to calculate a percentage share. SKIPNONE: Includes all cells. You must specify a SKIP parameter only for spread. and stores #MISSING for values in allocationRange for which the basisMbr is zero (0) or #MISSING. and stores #MISSING for values in allocationRange for which the basisMbr is missing. The percentage share is calculated by dividing the value in basisMbr for the current member in allocationRange by the sum across the allocationRange for that basis member: amount * (@CURRMBR()->basisMbr/ @SUM(allocationRange-> basisMbr) share spread Spreads amount across allocationRange: amount * (1/@COUNT(SKIP.01) add Takes the value from basisMbr for each member of allocationRange and adds the value to amount: amount + @CURRMBR()->basisMbr subtract Takes the value from basisMbr for each member of allocationRange and subtracts the value from amount: amount . SKIPZERO: Excludes all zero (0) values in basisMbr.@CURRMBR()->basisMbr multiply Takes the value from basisMbr for each member of allocationRange and multiplies the value by amount: amount * @CURRMBR()->basisMbr divide Takes the value from basisMbr for each member of allocationRange and divides the value by amount: amount/@CURRMBR()->basisMbr Hyperion 10-3 .Hyperion Essbase Calc Scripts method Allocation Functions 10 The expression that determines how values are allocated. allocationRange)) SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH: Values to be ignored during calculation of the spread. SKIPMISSING: Excludes all #MISSING values in basisMbr. SKIPBOTH: Excludes all zero (0) values and all #MISSING values.

If you specify roundAmt. You may also specify roundError. which is an expression that specifies where rounding errors should be placed. which must be included in allocationRange. You must specify numDigits if you specify roundAmt. #MISSING is treated as the lowest value in a list. roundErr. If numDigits is greater than 0. Essbase discards rounding errors. The default value for numDigits is 0. If numDigits is a negative value.10 Allocation Functions round noRound roundAmt. the allocated values are rounded to the specified number of decimal places. roundErr may be one of the following: errorsToHigh Adds rounding errors to the member with the highest allocated value. adds rounding errors to the first value in allocationRange. errorsToLow errorsToMbr 10-4 Hyperion . adds rounding errors to the first value in allocationRange. noRound is the default Indicates that you want to round the allocated values. If numDigits is 0. the allocated values are rounded to the nearest integer. Adds rounding errors to the specified roundMbr. rounding errors are added to the first #MISSING value in the list. roundErr]] Hyperion Essbase Calc Scripts One of the following: No rounding. An expression that specifies where rounding errors should be placed. Adds rounding errors to the member with the lowest allocated value. If you do not specify roundErr. [numDigits [. numDigits An integer that represents the number of decimal places to round to. you also may specify numDigits to indicate the number of decimal places to which to round. the allocated values are rounded to a power of 10. if multiple values are #MISSING. If allocated values are identical. If allocated values are identical.

Each function is also described. @MDALLOCATE Hyperion 10-5 . in this chapter. Function @ALLOCATE Used to generate a list containing Allocates values that are input at an upper level to lower-level members.Hyperion Essbase Calc Scripts Allocation Functions 10 Summary of Allocation Functions This table summarizes the Allocation Functions. in detail. Allocates values that are input at an upper level to lower-level members in multiple dimensions.

10 Allocation Functions Hyperion Essbase Calc Scripts @ALLOCATE The @ALLOCATE() function allocates values that are input at an upper level to lower-level members. round [. and “Budget” for budget expenses. @CHILDREN("Total Expenses"). numDigits][. for the prior year's actual expenses. methodParams] [. You need to allocate values to each expense category (to each child of Total Expenses).. ENDFIX This example produces the following (partial) results: PY Actual Marketing Payroll Misc Total Expenses 5000 4000 1000 10000 Budget 3500 2800 700 7000 Notes If no member or cross-dimensional member is from the dimension to which allocationRange belongs. [roundMbr]. basisMbr. allocationRange. Syntax @ALLOCATE (amount. Essbase displays a warning message.method [.share). roundErr]]) Example Consider the following example. The Essbase outline contains a Scenario dimension with two members. For example."PY Actual". Data values of 7000 is loaded into Budget->Total Expenses for Jan. You can specify a rounding parameter for allocated values and account for rounding errors. you can allocate values loaded to a parent member to all of that member's children. The allocation for each of child of Total Expenses is based on the child's share of actual expenses for the prior year (PY Actual): FIX("Total Expenses") Budget = @ALLOCATE(Budget->"Total Expenses". “PY Actual”. 10-6 Hyperion . The allocation is based upon a specified share or spread of another variable.

it cannot be a Dynamic Calc member. they calculate a series of values internally based on the range specified. Hyperion 10-7 . FIX on the member to which the allocation amount is loaded..Hyperion Essbase Calc Scripts Allocation Functions 10 If the amount parameter is a loaded value. for example. When you use @ALLOCATE in a calculation script. your formula should look like this: Member Name = @ALLOCATE (.. If you use @ALLOCATE in a member formula.) This is because allocation functions never return a value. use it within a FIX statement. using it may improve calculation performance. Although FIX is not required. rather.

[roundMbr].. basisMbr.10 Allocation Functions Hyperion Essbase Calc Scripts @MDALLOCATE The @MDALLOCATE function allocates values that are input at an upper level to lower-level members in multiple dimensions. The allocation is based upon a specified share or spread of another variable. methodParams] [. You can specify a rounding parameter for allocated values and account for rounding errors. @CHILDREN(East). share). allocationRange1. roundErr]]) Additional Parameters The additional parameters for the @MDALLOCATE function are: Ndim The number of dimensions across which values are allocated.. method [.. You need to allocate this total budgeted amount across each expense category for each child of East.@CHILDREN("Total Expenses"). or range functions from the multiple dimensions into which values from amount are allocated. Syntax @MDALLOCATE (amount.. allocationRange1.2. round [. ENDFIX 10-8 Hyperion . allocationRangeN. A data value of 2200 is loaded to Budget->Total Expenses->East for Jan and Colas.. The allocation for each child of East is based on the child's share of Total Expenses->Actual: FIX("Total Expenses") Budget = @MDALLOCATE(Budget->"Total Expenses"->East. allocationRangeN Comma-delimited lists of members. numDigits][. Actual. Ndim. Example Consider the following example from the Sample Basic database. member set functions.

If the amount parameter is a loaded value. use it within a FIX statement. it cannot be a Dynamic Calc member. Essbase may return error messages during the calculation. If you have very large allocationRange lists. When you use @MDALLOCATE in a calculation script. FIX on the member to which the allocation amount is loaded. using it may decrease calculation time. Colas: Marketing Payroll Misc Total Expenses 400 400 400 400 400 Actual New York Massachusetts Florida Connecticut New Hampshire East 100 100 100 100 100 200 200 200 200 200 100 100 100 100 100 500 110 110 110 110 110 1000 220 220 220 220 220 500 110 110 110 110 110 2000 #MI #MI #MI #MI #MI Budget New York Massachusetts Florida Connecticut New Hampshire East #MI #MI #MI 2200 Notes If no member or cross-dimensional member is from the dimension to which allocationRange belongs. you may need to raise the number for CALCLOCKBLOCK DEFAULT or use CALCLOCKBLOCK HIGH in your calculation script. Essbase displays a warning message. Hyperion 10-9 . Although FIX is not required.Hyperion Essbase Calc Scripts Allocation Functions 10 This example produces the following results for Jan. If you receive error messages. for example.

Switch to the Calc&Retrieve sheet. From the Calc&Retrieve sheet. Close the spreadsheet. For this exercise. Perform a retrieval and compare the “Total Expenses” results to those in the “Expected Results” column. Open the SS_Alloc spreadsheet. Save the new script as CSAlloc.xls 1) 2) From Essbase Application Manager. clear all data from the HLandS2 database. Lock and send the data in the Lock&Send sheet to the HLandS2 database. Do the Essbase results match those in the “Expected Results” column? If not. Create a calc script to calculate the budgeted total expenses for Western market for January 2000. 3) 4) 5) 6) 7) 8) 10-10 Hyperion . run the CSAlloc calc script. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSAlloc SS_Alloc. Retrieve into this sheet. you create a calc script that calculates the budgeted total expenses for Western market for January 2000. The “1999 Actual”-“West” and “2000 Budget” values have not been calculated.10 Allocation Functions Hyperion Essbase Calc Scripts Exercise 10-1: Applying Allocation Functions In this exercise. modify the CSAlloc calc script and rerun the calculation until you get the expected results. The budgeted total expenses are 5% greater than the actual total expenses for January 1999 and are distributed to the individual expense accounts in the same ratios as the actual January 1999 expenses. The budgeted total expenses are 5% greater than the actual total expenses for January 1999 and are distributed to the individual expense accounts in the same ratios as the actual January 1999 expenses.

share Divides the amount among members of the allocation range using basisMbr to calculate a percentage share. Adds the amount to the basisMbr for each member of allocationRange. The values are allocated across child members in one or more dimensions. Subtracts the amount from the basisMbr for each member of allocationRange. Divides the amount by the basisMbr for each member of allocationRange. Multiplies the amount to the basisMbr for each member of allocationRange. based on specified criteria. spread percent add subtract multiply divide Hyperion 10-11 . Treats the amount as a percentage value which is applied to basisMbr corresponding to the allocationRange member. There are several allocation methods that may be used. Divides the amount evenly across all members of allocationRange.Hyperion Essbase Calc Scripts Allocation Functions 10 Unit Summary Allocation functions allocate values that are input at the parent level.

Next year’s budget adveristing expense for each individual product is a 10% increase over this year ’s actual advertising expense. Each individual product’s budgeted advertising expense will be decreased by $500 over this year’s actual. d. The total budget expense is known for all products and is to be evenly distributed to individual products (each individual product is to receive the same amount of budget). e. The total budget expense is known for all products and is to be allocated to individual products in the same proportion this year’s actual advertising expense for each product. check your understanding by responding to the following questions: The value for advertising expense for next year budget is to be allocated to individual products. Which allocation method would be most appropriate in each of the following situations? a. 10-12 Hyperion . b.10 Allocation Functions þ Check Your Understanding 1) Hyperion Essbase Calc Scripts Now that you have completed the chapter. Each individual product’s budgeted advertising expense will be increased by $500 over this year’s actual. c.

d. • subtract b. c. • share The total budget expense is known for all products and is to be evenly distributed to individual products (each individual product is to receive the same amount of budget). e. • spread Next year’s budget adveristing expense for each individual product is a 10% increase over this year ’s actual advertising expense. • percent (or share) Each individual product’s budgeted advertising expense will be increased by $500 over this year’s actual. Which allocation method would be most appropriate in each of the following situations? a. • add Each individual product’s budgeted advertising expense will be decreased by $500 over this year’s actual. Hyperion 10-13 .Hyperion Essbase Calc Scripts Allocation Functions 10 þ Check Your Understanding Solutions 1) The value for advertising expense for next year budget is to be allocated to individual products. The total budget expense is known for all products and is to be allocated to individual products in the same proportion this year’s actual advertising expense for each product.

10 Allocation Functions Hyperion Essbase Calc Scripts 10-14 Hyperion .

11 Forecasting Functions Chapter Objectives By the end of this chapter. you will be able to: • • Explain the purpose and use of Forecasting functions to generate member lists Practice using the Forecasting functions in a series of incremental exercises .

Essbase uses the level 0 members from the dimension tagged as Time. A valid member name. If rangeList is not specified. Forecasting functions are often used in planning. and range functions from the same dimension. analysis. or calculating future values. and modeling applications. interpolating. member set functions. rangelist 11-2 Hyperion . or a function that returns a single member or member combination. a comma-delimited list of member names. Forecasting Function Parameters There are common parameters associated with the various Forecasting functions mbrName Any valid single member name or member combination.11 Forecasting Functions Hyperion Essbase Calc Scripts Using Forecasting Functions Forecasting functions manipulate data for the purpose of smoothing.

in detail. A moving n-term sum of an input data set and provides several options that control how values are assigned to members that precede the n-term parameter.1. A moving n-term median of an input data set.Hyperion Essbase Calc Scripts Forecasting Functions 11 Summary of Forecasting Functions This table summarizes the Forecasting Functions. A moving n-term maximum of an input data set. Each function is also described. Function @MOVAVG @MOVMAX @MOVMED @MOVMIN @MOVSUM * @MOVSUMX * Calculates A moving n-term average of an input data set. A moving n-term sum of an input data set. Hyperion 11-3 . in this chapter. Future values based on curve-fitting to historical values. A moving n-term minimum of an input data set. @SPLINE @TREND * New in Essbase XTD Release 6.5. A smoothing spline to a set of data points.

The remaining values represent the trailing average for each group of three values. 11-4 Hyperion . Essbase averages three values at a time for the moving average. Mar. Assume that the Measures dimension contains an additional member. In this example. The first two values (Jan. Each term in the set is replaced by a trailing mean of n terms. The value for Mar represents the trailing average of Jan. "Mov Avg" = @MOVAVG(Sales. Mov Avg.Feb) for Mov Avg and the first two values for Sales are the same. and Apr. The value for Apr represents the trailing average of Feb.Jan:Jun). This example produces the following results: Sales Jan Feb Mar Apr May Jun 100 110 120 130 140 150 Mov Avg 100 110 110 120 130 140 In this example. Syntax @MOVAVG (mbrName [.A positive integer value that represents the number of values to average. The default is 3. the @MOVAVG function smooths sales data for the first six months of the year (Jan through Jun). Feb.3. rangeList]]) n . and Mar. Example The following example is based on the Sample Basic database. n [.11 Forecasting Functions Hyperion Essbase Calc Scripts @MOVAVG The @MOVAVG() function applies a moving n-term average to an input data set. and the first terms (the n-1 terms) are copies of the input data. @MOVAVG modifies a data set for smoothing purposes.

using it may improve calculation performance.Hyperion Essbase Calc Scripts Forecasting Functions 11 Notes The @MOVAVG function calculates a trailing. rather than a centered. When you use @MOVAVG in a calculation script. see the online Technical Reference topic for the member set function you are using. use it within a FIX statement. consider the order in which Essbase sorts the generated member list. @SIBLINGS). If you use a Essbase member set function to generate a member list for the rangeList parameter (for example. Although FIX is not required. the @MOVAVG function skips #MISSING values and decreases the denominator accordingly. For example: Trailing Average 1 2 3 2 Centered Average 1 2 2 3 While calculating the moving average. For more information. to ensure correct results. if one value out of three is #MISSING. Essbase adds the remaining two values and divides the sum by two. average. you may need to increase the size of the calculator cache. Hyperion 11-5 . For example. When you use @MOVAVG across a large range in a sparse dimension.

Example The following example is based on the Sample Basic database. Syntax @MOVMAX (mbrName [. The default is 3. The value for Apr represents the trailing maximum of Feb. Essbase uses three values at a time to calculate the moving maximum.December). The first two values (Jan. In this example. October . Mar. 11-6 Hyperion .11 Forecasting Functions Hyperion Essbase Calc Scripts @MOVMAX The @MOVMAX() function applies a moving n-term maximum (highest number) to an input data set.3. This example produces the following results: Sales Jan Feb Mar Apr May Jun 551 641 586 630 612 747 Mov Max 551 641 641 641 630 747 In this example. Feb. The remaining values represent the trailing maximum for each group of three values. Mov Max. and the first terms (the n-1 terms) are copies of the input data. "Mov Max" = @MOVMAX(Sales. Assume that the Measures dimension contains an additional member.Jan:Jun).Feb) for Mov Max and the first two values for Sales are the same. the @MOVMAX function smooths sales data for the first six months of the year (Jan through Jun). n [. rangeList]]) n . @MOVMAX modifies a data set for smoothing purposes.A positive integer value that represents the number of values that are used to calculate the moving maximum. and Apr. and Mar. Each term in the set is replaced by a trailing maximum of n terms. The value for Mar represents the trailing maximum of Jan. The results of @MOVMAX can be used with the @TREND function to forecast maximum sales data for a holiday season (for example.

to ensure correct results. use it within a FIX statement. When you use @MOVMAX in a calculation script. Hyperion 11-7 . using it may improve calculation performance. @SIBLINGS). For example: Trailing Maximum 1 2 3 3 Centered Maximum 1 2 3 3 While calculating the moving maximum. rather than a centered. For example.Hyperion Essbase Calc Scripts Forecasting Functions 11 Notes The @MOVMAX function calculates a trailing. If you use a Essbase member set function to generate a member list for the rangeList parameter (for example. consider the order in which Essbase sorts the generated member list. Although FIX is not required. @MOVMAX skips #MISSING values. if one value out of four is #MISSING. When you use @MOVMAX across a large range in a sparse dimension. you may need to increase the size of the calculator cache. maximum. @MOVMAX calculates the maximum of the remaining three values.

Feb.3. and Apr. the @MOVMED function smooths sales data for the first six months of the year (Jan through Jun). Mar.Feb) for Mov Med are the same as the first two values for Sales. The value for Apr represents the trailing median of Feb.Jan:Jun). and Mar. Each term in the list is replaced by a trailing median of n terms. 11-8 Hyperion . Syntax @MOVMED (mbrName [. Assume that the Measures dimension contains an additional member. Essbase uses three values at a time to calculate the moving median. n [. rangeList]]) n . In this example. Mov Med. and the first terms (the n-1 terms) are copies of the input data. The value for Mar represents the trailing median of Jan. Example The following example is based on the Sample Basic database. This example produces the following results: Sales Jan Feb Mar Apr May Jun 551 641 586 630 612 747 Mov Med 551 641 586 630 612 630 In this example.A positive integer value that represents the number of values that are used to calculate the moving median. The remaining values represent the trailing median of each group of three values. The first two values (Jan. @MOVMED modifies a data set for smoothing purposes. The default is 3. "Mov Med" = @MOVMED(Sales.11 Forecasting Functions Hyperion Essbase Calc Scripts @MOVMED The @MOVMED() function applies a moving n-term median (middle number) to an input data set.

the @MOVMED function skips #MISSING values. For example: Trailing Median 1 2 3 2 Centered Median 1 2 2 3 If the group of values being used to calculate the median contains an even number of values. rather than a centered. if one value out of four is #MISSING. you may need to increase the size of the calculator cache. For example. When you use @MOVMED across a large range in a sparse dimension. Although FIX is not required. median. @MOVMED calculates the median of the remaining three values. consider the order in which Essbase sorts the generated member list.Hyperion Essbase Calc Scripts Forecasting Functions 11 Notes While calculating the moving median. the @MOVMED function averages the two numbers in the middle. The @MOVMED function calculates a trailing. use it within a FIX statement. If you use a Essbase member set function to generate a member list for the rangeList parameter (for example. using it may improve calculation performance. @SIBLINGS). When you use @MOVMED in a calculation script. Hyperion 11-9 . to ensure correct results.

This example produces the following results: Sales Jan Feb Mar Apr May Jun 551 641 586 630 612 747 Mov Min 551 641 551 586 586 612 In this example.Jan:Jun). Example The following example is based on the Sample Basic database. 11-10 Hyperion . and the first terms (the n-1 terms) are copies of the input data. Assume that the Measures dimension contains an additional member. @MOVMIN modifies a data set for smoothing purposes.3. The remaining values represent the trailing minimum for each group of three values. The value for Mar represents the trailing minimum of Jan. The default is 3. and Mar. and Apr.A positive integer value that represents the number of values that are used to calculate the moving minimum. "Mov Min" = @MOVMIN(Sales.Feb) for Mov Min and the first two values for Sales are the same. n [. Mov Min. Each term in the list is replaced by a trailing minimum of n terms. The first two values (Jan. The value for Apr represents the trailing minimum of Feb. Mar. Syntax @MOVMIN (mbrName [. Essbase uses three values at a time to calculate the moving minimum. the @MOVMIN function smooths sales data for the first six months of the year (Jan through Jun). In this example. rangeList]]) n . Feb.11 Forecasting Functions Hyperion Essbase Calc Scripts @MOVMIN The @MOVMIN() function applies a moving n-term minimum (lowest number) to an input data set.

if one value out of four is #MISSING. When you use @MOVMIN in a calculation script. you may need to increase the size of the calculator cache. For example: Trailing Minimum 1 2 3 2 Centered Minimum 1 2 2 3 If you use a Essbase member set function to generate a member list for the rangeList parameter (for example. @SIBLINGS). to ensure correct results. the @MOVMIN function skips #MISSING values.Hyperion Essbase Calc Scripts Forecasting Functions 11 Notes While calculating the moving minimum. When you use @MOVMIN across a large range in a sparse dimension. The @MOVMIN function calculates a trailing. For example. rather than a centered. consider the order in which Essbase sorts the generated member list. Although FIX is not required. minimum. using it may improve calculation performance. use it within a FIX statement. Hyperion 11-11 . @MOVMIN calculates the minimum of the remaining three values.

Jan:Jun). @MOVSUM modifies a data set for smoothing purposes. The value for Mar represents the trailing sum of Jan. Each term of the set is replaced by a trailing sum of n terms. Example The following example is based on the Sample Basic database. Feb. "Mov Sum" = @MOVSUM(Sales. Mar. Essbase uses three values at a time to calculate the moving sum. This example produces the following results: Sales Jan Feb Mar Apr May Jun 551 641 586 630 612 747 Mov Sum 551 641 1778 1857 1828 1989 In this example.3.Feb) for Mov Sum and the first two values for Sales are the same. The remaining values represent the trailing minimum for each group of three values. Syntax @MOVSUM (mbrName [. The value for Apr represents the trailing sum of Feb. The first two values (Jan. rangeList]]) n . and Mar. 11-12 Hyperion .11 Forecasting Functions Hyperion Essbase Calc Scripts @MOVSUM The @MOVSUM function applies a moving n-term sum to an input data set. The default is 3.A positive integer value that represents the number of values that are used to calculate the moving minimum. and the first terms (the n-1 terms) are copies of the input data. the @MOVSUM function smooths sales data for the first six months of the year (Jan through Jun). Mov Sum. Assume that the Measures dimension contains an additional member. n [. In this example. and Apr.

Essbase adds the remaining two values. to ensure correct results. sum.Hyperion Essbase Calc Scripts Forecasting Functions 11 Notes The @MOVSUM function calculates a trailing. @SIBLINGS). you may need to increase the size of the calculator cache. If you use an Essbase member set function to generate a member list for the rangeList parameter (for example. consider the order in which Essbase sorts the generated member list. rather than a centered. For example: Trailing Sum 1 2 3 6 1 Centered Sum 2 3 3 While calculating the moving sum. if one value out of three is #MISSING. use it within a FIX statement. Hyperion 11-13 . Although FIX is not required. @MOVSUM skips #MISSING values. When you use @MOVSUM across a large range in a sparse dimension. using it may improve calculation performance. When you use @MOVSUM in a calculation script. For example.

mbrName [.Jan:Jun).Sales.A positive integer value that represents the number of values that are used to calculate the moving minimum.Sales. @MOVSUMX provides several options that control how values are assigned to members that precede the n-term parameter.Copies the member value into the new member until the n value is reached. Unlike @MOVSUM.3.11 Forecasting Functions Hyperion Essbase Calc Scripts @MOVSUMX The @MOVSUMX function applies a moving n-term sum to an input data set. then it will begin summing the value.Sets the member value to #MISSING until the n value is reached. This duplicates the behavior of the @MOVSUM function. When the n value is reached. regardless of whether the n value is reached or not. Syntax @MOVSUMX(COPYFORWARD | TRAILMISSING | TRAILSUM.Jan:Jun).3.Sums the trailing values. SumTrail = @MOVSUMX (TRAILSUM. Produce the following results: Sales Jan Feb Mar Apr May Jun 551 641 586 630 612 747 SumCopy 551 641 1778 1857 1828 1989 SumMiss #Missing #Missing 1778 1857 1828 1989 SumTrail 551 1192 1778 1857 1828 1989 11-14 Hyperion .Jan:Jun).rangelist]] ) COPYFORWARD . @MOVSUMX modifies a data set for smoothing purposes.Sales. then it will begin summing the value. Example SumCopy = @MOVSUMX (COPYFORWARD. OLAP Server begins summing just those values n . SumMiss = @MOVSUMX (TRAILMISSING. TRAILMISSING .3.n[. The default is 3. TRAILSUM .

The default independent variable values are 0. s [. The default value is 1. and so on.82 724. s .1. This example produces the following results: Sales Jan Feb Mar Apr May Jun 645 675 712 756 890 912 Sales Spline 632.2.29 852. XmbrName [.3. Example The following example is based on the Sample Basic database.82 Hyperion 11-15 .44 919. The formula calculates the spline of Sales values for Jan through Jun.89 675. rangeList]]]) YmbrName A valid single member name that contains the dependent variable values used (when crossed with rangeList) to construct the spline.A zero (0) or positive value that determines the smoothness parameter. A spline is a mathematical curve that smooths or interpolates data. based on a smoothness parameter of 2.2.Jan:Jun). "Sales Spline" = @SPLINE(Sales.A valid single member name that contains the independent variable values used (when crossed with rangeList) to construct the spline.Hyperion Essbase Calc Scripts Forecasting Functions 11 @SPLINE The @SPLINE() function applies a smoothing spline to a set of data points.0. XmbrName . Syntax @SPLINE (YmbrName [. Assume that the Measures dimension contains an additional member..74 784. Sales Spline.

Jul). where it would be impractical to use a single approximating polynomial. If rangeList contains gaps in the data (for example: Jan.11 Forecasting Functions Hyperion Essbase Calc Scripts Notes Splines are smooth piecewise polynomials that can be used to represent functions over large intervals. be sure to specify XmbrName (for example: 0. Feb. you may need to increase the size of the calculator cache. to ensure correct results. Increasing s results in a smoother spline but a less exact approximation of the initial data. a spline that fits the initial data exactly. Although using FIX is not required. If you use a Essbase member set function to generate a member list for the rangeList parameter (for example. The @SPLINE function skips #MISSING values in YmbrName and XmbrName.1. in the result. The @SPLINE function calculates a smoothing cubic spline for (n > 0). Setting the smoothness parameter (s) to 0 produces an interpolating spline.6) so that correct results are returned. that is. use it within a FIX statement. Essbase replaces the #MISSING values of YmbrName with the spline values. View the algorithm for the smoothing spline. 11-16 Hyperion . Jun. When you use @SPLINE in a calculation script.5. Mar. it may improve calculation performance. consider the order in which Essbase sorts the generated member list. When you use @SPLINE across a large range in a sparse dimension. rangeList must contain at least two values.2. @SIBLINGS).

If you do not specify Xlist. for example.. choose the forecasting method to be used (for example. and predicts values for a future observation. YforecastList. Xlist may contain a value for associated time periods. Syntax @TREND (Ylist.Hyperion Essbase Calc Scripts Forecasting Functions 11 @TREND The @TREND() function calculates future values based on curve-fitting to historical values. method parameters] [. and specify certain data filters. the values are assumed to be as follows: {(last value in Xlist + 1). errorList Member list that represents the differences between the data points in Ylist and the data points on the line or curve (as specified for method). (last value in Xlist + 2). [Xlist].3.} up to (last value in Xlist + the number of values in YforecastList) Hyperion 11-17 . and so on. YfilterN [. [XforecastList]. the default variable values are 1. fits a curve). parameters]][. You can use weights to assign credibility coefficients to particular observations. Yfilter1 [. The @TREND procedure considers a number of observations. for the linear regression method only. An expression list that contains underlying variable values. up to the number of values in Ylist. . Xlist weightList An expression list that contains weights for the data points in Ylist. If you do not specify XforecastList. For example. parameters]] [. linear regression). Xfilter1 [.XfilterN [. [weightList]. If values in weightList are #MISSING. parameters]] [.2. Weights for methods other than linear regression are ignored. XforecastList Expression list that contains the underlying variable values for which the forecasting is sought. for each sales figure in Ylist. Negative weights are replaced with their absolute values.. report errors of the curve fitting. constructs a mathematical model of the process based on these observations (that is.parameters]]) Parameters Ylist An expression list that contains known observations. sales figures over a period of time. the default is 1. method[. [errorList].

the weights are equal to 1 by default. In general. SES [. c2=0. This is a three-parameter weight system and a linear model with a multiplicative seasonal component.2.T]. or decrease the weight if the corresponding observation is an outlier or is unreliable. specify the new period with XforecastList. triple exponential smoothing (Holt-Winters method) with optional parameters c1.3). not member names. c2=0.11 Forecasting Functions Hyperion Essbase Calc Scripts If you forecast consecutively from where Ylist stops.c1]. YforecastList A member list into which the forecast values are placed. Method parameters vary depending on the method: LR [. you do not need to specify XforecastList.1. c3=0. single exponential smoothing with parameter c (default c=0.c2] . method A choice among: • • • • LR (linear regression) SES (single exponential smoothing) DES (double exponential smoothing) TES (triple exponential smoothing).c3] 11-18 Hyperion .2. Increasing this parameter gives more weight to early observations than to later ones. c2. You might want to increase the weight if the corresponding observation is important. If you want to move the forecasting period forward. The first parameter controls weight distribution for the intercept. Method parameters must be numeric values. where [t] is the length of the period.2).c1].c] DES [[.c2] TES [[[[. using the single parameter c. T (default c1=0. T=1). double exponential smoothing (Holt's method) with optional parameters c1.05. the second parameter controls weight distribution for the slope of the line fit.t] standard linear regression with possible weights assigned to each data point and an optional seasonal adjustment period [t]. c3. This is a two-parameter weight system and a linear subsequent approximation scheme. c2 (default c1=0. This method uses its own weight system.

This example produces the following results: Sales Jan Feb Mar Apr May Jun Jul Aug 2339 2298 2313 2332 2319 2318... YfilterN Use one or more of the following filter methods to scale Ylist: YLOG[.. The method used is linear regression with no seasonal adjustment.LR).Hyperion Essbase Calc Scripts Forecasting Functions 11 Xfilter1. XfilterN Use one or more of the following filter methods to scale Xlist: XLOG[..c] YPOW[.. based on the trend of the sales from January through April.c] Yfilter1.). It forecasts sales data for May through December. Sales(@TREND(Jan:Apr.4 2317.c] Example The following example is based on the Sample Basic database.c] logarithmic change with shift c (x' = log(x+c)) (default c=1) exponential change with shift c (x' = exp(x+c)) (default c=0) power change with power c (x' = x^c) (default c=2) XEXP[.2 Hyperion 11-19 .c] XPOW[.c] logarithmic change with shift c (y' = log(y+c)) (default c=1) exponential change with shift c (y' = exp(y+c)) (default c=0) power change with power c (y' = y^c) (default c=2) YEXP[.May:Dec..8 2317...

input data cannot contain #MISSING values. see the online Technical Reference topic for the member set function you are using. Ylist. T/2). to ensure correct results. For more information. If you use a Essbase member set function to generate a member list for this function. XforecastList and YforecastList should contain the same number of values. T/5. With these methods. weightList. T (for example. Essbase places strict requirements on the input data.4 2314. 11-20 Hyperion . not in outline formulas. The XforecastList parameters should also contain multiples of the interval. if you specify Xlist. with the interval (step) being a whole fraction of the period. @TREND ignores #MISSING values during calculation of the trend. The method and filter parameters must be numbers only.8 Notes The @TREND function can be used only in calculation scripts. Also.6 2316 2315. functions and member names are not allowed. When you use the LR method with seasonal adjustments or when you use the TES method. and errorList should contain the same number of values. (for example. the data must be equidistant. consider the order in which Essbase sorts the generated member list. @SIBLINGS).11 Forecasting Functions Hyperion Essbase Calc Scripts Sep Oct Nov Dec 2316. In a calculation script. Xlist. you must associate the @TREND formula with a member.

xls 1) 2) From Essbase Application Manager. Switch to the Calc&Retrieve sheet. From the Calc&Retrieve sheet. The budgeted sales are predicted using a linear regression of actual sales for 1997. modify the CSTrend calc script and rerun the calculation until you get the expected results. run the CSTrend calc script. Open the SS_Trend spreadsheet. Save the new script as CSTrend. clear all data from the HLandS2 database. The 2000 Budget values have not been calculated. The budgeted sales are predicted using a linear regression of actual sales for 1997. 1998 and 1999. Lock and send the data in the Lock&Send sheet to the HLandS2 database. For this exercise. Retrieve into this sheet. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSTrend SS_Trend. 1998 and 1999. West. Perform a retrieval and review the results in the “2000 Budget” column. 3) 4) 5) 6) 7) 8) Hyperion 11-21 . Do the Essbase results match your expectations? If not. South and Central) for 2000. South and Central) for 2000.Hyperion Essbase Calc Scripts Forecasting Functions 11 Exercise 11-1: Applying Forecasting Functions In this exercise. you create a calc script that forecasts the budgeted sales for the four sales regions (East. Create a calc script to calculate the budgeted sales for the four sales regions (East. West. Close the spreadsheet.

analysis. or calculating future values. 11-22 Hyperion .11 Forecasting Functions Hyperion Essbase Calc Scripts Unit Summary Forecasting functions manipulate data for the purpose of smoothing. Forecasting functions are often used in planning. and modeling applications. interpolating.

you will be able to: • • Explain the purpose and use of Statistical functions to generate member lists Practice using the Statistical functions in a series of incremental exercises .12 Statistical Functions Chapter Objectives By the end of this chapter.

12 Statistical Functions Hyperion Essbase Calc Scripts Generating Lists Using Statistical Functions Statistical functions calculate advanced statistical values. explist2 SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH 12-2 Hyperion . SKIPNONE . These functions are often used in sales and marketing applications. functions. Used in conjunction with an expList parameter. A positive integer defines a generation number. such as correlation or variance. A value of 0 or a negative integer defines a level number. Comma-delimited list of members.Ignores all 0 values SKIPBOTH .Ignores all 0 and #MISSING values expList. all of which return numeric values. An integer value that defines the generation or level number from which the ancestor value is returned. expList1. Specifies a single member. Statistical Function Parameters There are common parameters associated with the various Statistical functions: dimName mbrName genLevNum Single dimension name specification. variable names.Ignores all #MISSING values SKIPZERO .Includes in the operation all values specified in expList regardless of their content SKIPMISSING . and numeric expressions. this parameter indicates how missing and zero values are to be processed.

in detail. The standard deviation of the specified member across the specified data set that represents a sample of a population. The mode of the specified data set. The statistical variance of a specified data set that represents a population. Each function is also described.Hyperion Essbase Calc Scripts Statistical Functions 12 Summary of Statistical Functions This table summarizes the Statistical Functions. in this chapter. @COUNT @MEDIAN @MODE @RANK @STDEV @STDEVP @STDEVRANGE @VARIANCE @VARIANCEP Hyperion 12-3 . The standard deviation of a specified data set that represents a sample of a population. Function @CORRELATION Returns The correlation coefficient between two parallel data sets. The standard deviation of a specified data set that represents a population. The median of the specified data set. The number of data values in the specified data set. The statistical variance of a specified data set that represents a sample of a population. The rank of the specified members or the specified value among the values in the specified data set.

@CHILDREN(Qtr2))) . expList1. Because the calculation script fixes on Jun.12 Statistical Functions Hyperion Essbase Calc Scripts @CORRELATION The @CORRELATION() function returns the correlation coefficient between two parallel data sets (expList1 and expList2). This example uses the @RANGE function to generate expList1 and expList2: FIX(June) "Sales Correl"=@CORRELATION(SKIPNONE. the results are placed in Sales Correl->Jun. ENDFIX This example produces the following results: Sales Jan Feb Mar Apr May Jun Sales Correl 678 645 675 712 756 890 #MI #MI #MI #MI #MI 0. Syntax @CORRELATION (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. expList2) Example The following example is based on the Sample Basic database.200368468 12-4 Hyperion .@RANGE(Sales. The calculation script calculates the correlation coefficient for a set of members (Sales for the children of Qtr1 and Qtr2). Sales Correl.@CHILDREN(Qtr1)). Assume that the Measures dimension contains an additional member. The correlation coefficient determines the relationship between two data sets. @RANGE(Sales.

(2) contain only #MISSING values. unless SKIPMISSING or SKIPBOTH is specified. or (3) have a standard deviation of 0 (all values are constant). If expList1 and expList2 have different numbers of data points. both values are deleted before calculation.) SKIPZERO and SKIPBOTH work similarly. If a value in expList1 is #MISSING. (That is. The @CORRELATION function returns #MISSING if expList1 and expList2 (1) are empty.Hyperion Essbase Calc Scripts Statistical Functions 12 Notes The expList1 and expList2 parameters must have the same number of data points. The @CORRELATION function treats #MISSING values as zero (0) values. @CORRELATION returns #MISSING. the value's corresponding value in expList2 is treated as #MISSING. to ensure correct results. consider the order in which Essbase sorts the generated member list. The @CORRELATION function returns values from -1 to 1. and SKIPMISSING is specified. Hyperion 12-5 . If you use a Essbase member set function to generate a member list for this function (for example. @SIBLINGS).

@RANGE(Sales. Syntax @COUNT (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH.12 Statistical Functions Hyperion Essbase Calc Scripts @COUNT The @COUNT() function returns the number of data values in the specified data set. Assume that the Measures dimension contains an additional member. the #MI values are skipped during the product count. expList) Example Example The following example is based on the Sample Basic database. ENDFIX This example produces the following report. Prod Count.@CHILDREN(Product))). Since SKIPMISSING is specified in the calculation script. 12-6 Hyperion . Actual Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product Prod Count Product 678 #MI 663 587 #MI 2479 3 Budget 640 530 510 620 #MI 2300 4 Notes The @COUNT function always returns an integer greater than or equal to 0. This example calculates the count of all products for which a data value exists and uses the @RANGE function to generate expList: FIX(Product) "Prod Count" = @COUNT(SKIPMISSING.

to calculate Median->Product->Budget. Hyperion 12-7 . the remaining four products create an even-numbered data set.Hyperion Essbase Calc Scripts Statistical Functions 12 @MEDIAN The @MEDIAN() function returns the median (the middle number) of the specified data set. This example calculates the median sales values for all products and uses the @RANGE function to generate expList: FIX (Product) Median = @MEDIAN(SKIPBOTH. the #MI values are skipped.@RANGE(Sales. expList) Example The following example is based on the Sample Basic database.@CHILDREN(Product))). and half are smaller. the two middle numbers in the set (530 and 620) are averaged to create the median (575). Half the numbers in the data set are larger than the median. Median. In the Budget scenario. Syntax @MEDIAN (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. Assume that the Measures dimension contains an additional member. ENDFIX This example produces the following results: Actual Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product Median Product 678 #MI 663 587 #MI 2479 663 Budget 640 530 510 620 #MI 2300 575 Because SKIPBOTH is specified in the calculation script.

to cross Sales with the children of 100). When you use @MEDIAN in a calculation script. When you use @MEDIAN across a large range in a sparse dimension. you may need to increase the size of the calculator cache. the @MEDIAN function calculates the average of the two middle numbers. When expList contains an even number of values. use it within a FIX statement. use the @RANGE function to cross the member with the list of members (for example. @MEDIAN treats #MISSING values as 0 unless SKIPMISSING or SKIPBOTH is specified. using it may improve calculation performance. @MEDIAN sorts expList in ascending order before calculating the median.12 Statistical Functions Hyperion Essbase Calc Scripts Notes If the member you are calculating and expList are not in the same dimension. 12-8 Hyperion . Although FIX is not required.

3] and chooses the value [2] as the mode. Essbase sorts the list as [1.1.3.@RANGE(Units.3.@CHILDREN(Central))). Central) "Mode" = @MODE(SKIPMISSING.3. expList) Example The following example calculates the mode of the units sold for the Central region and uses the @RANGE function to generate expList: FIX (Actual. ENDFIX This example produces the following results: Actual Units Illinois Ohio Wisconsin Missouri Iowa Colorado Central Mode Central 3 2 3 #MI 0 6 14 3 Notes When two or more values in expList occur at the same frequency.2. if expList contains [2. Syntax @MODE (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH.3].3.2.2. Hyperion 12-9 .2.3.Hyperion Essbase Calc Scripts Statistical Functions 12 @MODE The @MODE() function returns the mode (the most frequently occurring value) in the specified data set. Essbase sorts the list of values in ascending order and chooses the lowest value that occurs with the most frequency as the mode.2.3.2.2. For example.

If you specify SKIPMISSING or SKIPBOTH and all values in expList are #MISSING. @MODE returns #MISSING. use it within a FIX statement. 12-10 Hyperion .4.12 Statistical Functions Hyperion Essbase Calc Scripts If expList contains no duplicate values. using it may improve calculation performance. @MODE returns #MISSING unless SKIPMISSING or SKIPBOTH is specified. Although FIX is not required.14]. @MODE returns #MISSING.7. If you specify SKIPZERO or SKIPBOTH and all values in expList are 0. the @MODE function returns the smallest value in the list as the mode. If #MISSING is the mode of expList. you may need to increase the size of the calculator cache. @MODE returns 2 as the mode. For example. When you use @MODE across a large range in a sparse dimension. When you use @MODE in a calculation script.10. if expList contains [2.

@RANGE(Sales. Hyperion 12-11 .Hyperion Essbase Calc Scripts Statistical Functions 12 @RANK The @RANK() function returns the rank of the specified members or the specified value among the values in the specified data set. after SKIP processing.Sales. there are no values to compare. expList) value . Assume that the Measures dimension contains an additional member. The rank of a value identifies its position in the sorted data set (for example. This example produces the following report. Example The following example is based on the Sample Basic database.@LEVMBRS(Product.1))).either the member or member combination for which the rank is calculated. 4255. Since SKIPBOTH is specified in the formula. the @RANK function sorts the data set in descending order (for example. Syntax @RANK (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. Essbase ranks the sales values for a set of products: "Sales Rank" = @RANK(SKIPBOTH. Sales Rank. 1989 is ranked 5) An input value of #MISSING returns #MISSING. 6556. 9650. the #MI value for Sales->Diet Drinks is not included in the ranked list: Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks 678 551 663 587 #MI Sales Rank 1 4 2 3 #MI Notes After SKIP processing. 1989). 15341. #MISSING is also returned if. The rank of a value is equivalent to its position (its rank) in the sorted data set. 15341 is ranked 1. value. or a constant value for which the rank is calculated.

For example.2] Inserts [3] in the list [13. In this case.2.6.4.13].2] and then ranks: [5] has a rank of 1. [3] has a rank of 4. 12-12 Hyperion . Essbase inserts the constant value in the list and then ranks it accordingly. however.12 Statistical Functions Hyperion Essbase Calc Scripts The @RANK function assigns the same rank to duplicate values. the presence of duplicate values affects the rank numbers.4. if a list of values contains [2. Although using FIX is not required. [4] has a rank of 2. If value is a constant value and that value is not included in expList. if a list of values contains [2.3.4. When you use @RANK in a calculation script. For example. Essbase: • • • Sorts the list in descending order [13. Essbase first sorts the list [5.4.4. When you use @RANK across a large range in a sparse dimension. use it within a FIX statement. it may improve calculation performance. and [2] has a rank of 3. and you want to rank a value of [3] in this list. you may need to increase the size of the calculator cache.5].6.2.6.2] Ranks [3] in the list: in this case. no value has a rank of 4.

The calculation assumes that the data set represents a sample of a population. FIX (Product) "StdDev" = @STDEV(SKIPBOTH.@CHILDREN(Product))). Syntax @STDEV (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH.55 Hyperion 12-13 . Standard deviation is a measure of how widely values are dispersed from their mean (average).Hyperion Essbase Calc Scripts Statistical Functions 12 @STDEV The @STDEV() function calculates the standard deviation of the specified data set. expList) Example The following example is based on the Sample Basic database. ENDFIX This example produces the following results: Actual Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product StdDev Product 678 551 663 587 #MI 2479 60.73 Budget 640 530 510 620 #MI 2300 64. This example calculates the standard deviation (based on a sample of a population) of the sales values for all products. StdDev.@RANGE(Sales. Assume that the Measures dimension contains an additional member.

If you want expList to represent the entire population. @STDEV is calculated using the "nonbiased" or "n-1" method. the functions return similar values. The only difference between the functions is the SKIP parameter in the new @STDEV function. Although the old @STDDEV function is supported for migration purposes. @STDEV is the square root of the variance calculated for the same data set using @VARIANCE.12 Statistical Functions Hyperion Essbase Calc Scripts Notes The @STDEV function replaces the @STDDEV function. @STDEV assumes that expList represents a sample of a population. use @STDEVP. For large samples. 12-14 Hyperion . you can no longer select it in the Calc Script Editor or Formula Editor.

expList) Example The following example is based on the Sample Basic database. The calculation assumes that the data set represents the population. Syntax @STDEVP (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. ENDFIX This example produces the following results: Actual Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product StdDevP Product 678 551 663 587 #MI 2479 52.59 Budget 640 530 510 620 #MI 2300 55.@RANGE(Sales. For large samples.@CHILDREN(Product))). use @STDEV. Standard deviation is a measure of how widely values are dispersed from their mean (average).Hyperion Essbase Calc Scripts Statistical Functions 12 @STDEVP The @STDEVP() function calculates the standard deviation of the specified data set. StdDevP. Hyperion 12-15 . FIX (Product) "StdDevP" = @STDEVP(SKIPBOTH. If you want expList to represent a sample of a population. the functions return similar values. This example calculates the standard deviation (based on the entire population) of the sales values for all products.90 Notes @STDEVP assumes that expList represents the entire population. Assume that the Measures dimension contains an additional member.

@STDEVP is calculated using the "biased" or "n" method. 12-16 Hyperion .12 Statistical Functions Hyperion Essbase Calc Scripts @STDEVP is the square root of the variance calculated for the same data set using @VARIANCEP.

Any valid single member name or member combination. Standard deviation is a measure of how widely values are dispersed from their mean (average).Hyperion Essbase Calc Scripts Statistical Functions 12 @STDEVRANGE The @STDEVRANGE() function calculates the standard deviation of all values of the specified member across the specified data set. rangeList]) mbrName .55 Hyperion 12-17 . Assume that the Measures dimension contains an additional member. a comma-delimited list of member names. Essbase uses the level 0 members from the dimension tagged as Time. StdDev.A valid member name. mbrName [. The calculation assumes that the data set represents a sample of a population. ENDFIX This example produces the following results: Actual Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product StdDev Product 678 551 663 587 #MI 2479 60. If rangeList is not specified.@CHILDREN(Product)). Syntax @STDEVRANGE (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. and range functions from the same dimension. This example calculates the standard deviation (based on a sample of a population) of the sales values for all products.73 Budget 640 530 510 620 #MI 2300 64. FIX (Product) "StdDev" = @STDEVRANGE(SKIPBOTH. Example The following example is based on the Sample Basic database.Sales. or a function that returns a single member or member combination. rangeList . member set functions.

12-18 Hyperion . The only difference between the functions is the SKIP parameter in the new @STDEVRANGE function. Although the old @STDDEVRANGE function is supported for migration purposes. The specified mbrName is crossed with rangeList to obtain the sample across which the standard deviation is calculated. you can no longer select it in the Calc Script Editor or Formula Editor. @STDEVRANGE is calculated using the "unbiased" or "n-1" method.12 Statistical Functions Hyperion Essbase Calc Scripts Notes The @STDEVRANGE function replaces the @STDDEVRANGE function.

Assume that the Measures dimension contains an additional member. Variance is a measure of the dispersion of a set of data points around their mean (average) value. and calculates the variance of the sales values for a product family. FIX (Product) "SalesVar" = @VARIANCE(SKIPBOTH. SalesVar.58 Budget 640 530 510 620 #MI 2300 4166. Hyperion 12-19 .67 Notes @VARIANCE is different from @VAR. Syntax @VARIANCE (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. ENDFIX This example produces the following results: Actual Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product SalesVar Product 678 551 663 587 #MI 2479 3687. expList) Example The following example is based on the Sample Basic database. The calculation assumes that the data set represents a sample of a population. which calculates the variance (difference) between two members. This example uses the @RANGE function to generate expList.@CHILDREN(Product))).@RANGE(Sales.Hyperion Essbase Calc Scripts Statistical Functions 12 @VARIANCE The @VARIANCE() function calculates the statistical variance of the specified data set.

@VARIANCE assumes that expList represents a sample of the population. 12-20 Hyperion . If you want expList to represent the entire population. @VARIANCE is calculated with the "unbiased" or "n-1" method.12 Statistical Functions Hyperion Essbase Calc Scripts @VARIANCE is the square of the standard deviation calculated for the same data set using @STDEV. use @VARIANCEP.

Variance is a measure of the dispersion of a set of data points around their mean (average) value. which calculates the percent variance (difference) between two members. SalesVar. The calculation is based upon the entire population.@CHILDREN(Product))). expList) Example Example The following example is based on the Sample Basic database. Hyperion 12-21 . FIX (Product) "SalesVar" = @VARIANCEP(SKIPBOTH. ENDFIX This example produces the following results: Actual Sales Colas Root Beer Cream Soda Fruit Soda Diet Drinks Product SalesVar Product 678 551 663 587 #MI 2479 2765. Syntax @VARIANCEP (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH. This example uses the @RANGE function to generate expList and calculates the variance of the sales values for a product family.69 Budget 640 530 510 620 #MI 2300 3125.@RANGE(Sales. Assume that the Measures dimension contains an additional member.00 Notes @VARIANCEP is different from @VARPER.Hyperion Essbase Calc Scripts Statistical Functions 12 @VARIANCEP The @VARIANCEP() function calculates the statistical variance of the specified data set.

@VARIANCEP assumes that expList represents the entire population. 12-22 Hyperion . If you want expList to represent a sample of the population. @VARIANCEP is calculated using the "biased" or "n" method. use @VARIANCE.12 Statistical Functions Hyperion Essbase Calc Scripts @VARIANCEP is the square of the standard deviation calculated for the same data set using @STDEVP.

The Sales and Sales Rank for the states values have not been calculated.Hyperion Essbase Calc Scripts Statistical Functions 12 Exercise 12-1: Applying Statistical Functions In this exercise. run the CSRank calc script. you create a calc script to calculate the rank for the sales of each state. Do the “Sales Ranks” for the states appear correct? If not. Sales have been entered at the city level. Close the spreadsheet. Save the new script as CSRank. Sort the data in descending Sales order. Retrieve into this sheet. Perform a retrieval. Create a calc script to calculate the rank for the sales of each state. From the Calc&Retrieve sheet. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSRank SS_Rank. Switch to the Calc&Retrieve sheet. For this exercise. clear all data from the HLandS2 database. modify the CSRank calc script and rerun the calculation until you get the expected results. 2) 3) 4) 5) 6) 7) ✍ 8) Hyperion 12-23 . and determine if the Sales Ranks match this order. Sales have been entered at the city level. Open the SS_Rank spreadsheet.xls 1) From Essbase Application Manager. Lock and send the data in the Lock&Send sheet to the HLandS2 database.

12 Statistical Functions Hyperion Essbase Calc Scripts Unit Summary Statistical functions calculate advanced statistical values. 12-24 Hyperion . such as correlation or variance. These functions are often used in sales and marketing applications.

you will be able to: • • Explain the purpose and use of Date and Time functions to generate member lists Practice using the Date and Time functions in a series of incremental exercises .13 Date and Time Functions Chapter Objectives By the end of this chapter.

13 Date and Time Functions Hyperion Essbase Calc Scripts Using Date and Time Functions The date function converts date strings to numbers that can be used in calculation formulas. There is one Date and Time function. 13-2 Hyperion . which converts date strings to numbers. @TODATE.

The date string. calculates “New Marketing” as Marketing reduced by 10 percent. This example produces the following results: Marketing New Marketing 9 Intro Date_12-101996 200-30 10 200-40 Intro Date_10-011996 400-10 10 10 9 9 400-20 10 9 Hyperion 13-3 . either "mm-dd-yyyy" or "dd-mm-yyyy". Assume that the Measures dimension contains an additional member. This formula searches for members with an Intro Date attribute member that is later than 6-30-96 and. ENDIF. for those members. 1970."06-30-1996")) Marketing * . dateString .9. In order to process the formula.). Essbase converts the date strings to numbers before it calculates. dateString) formatString .Hyperion Essbase Calc Scripts Date and Time Functions 13 @TODATE The @TODATE() function converts date strings to numbers that can be used in calculation formulas. Syntax @TODATE (formatString. Example The following example is based on the Sample Basic database.The format of the date string. “New Marketing”. @TODATE converts date strings into the number of seconds elapsed since midnight. January 1. “New Marketing” (IF (@ATTRIBUTEVAL("Intro Date") > @TODATE("mm-dd-yyyy".

1970. @TODATE returns an error.13 Date and Time Functions Hyperion Essbase Calc Scripts Intro Date_07-261996 Intro Date_06-261996 200-20 10 9 300-10 10 9 300-20 300-30 Intro Date_04-011996 100-20 10 10 10 9 9 10 100-30 Intro Date_03-251996 Intro Date_09-271995 100-10 10 10 10 10 200-10 10 10 Notes If you specify a date string that is earlier than January 1. The latest date string supported by @TODATE is January 1. 13-4 Hyperion . 2038 (01-012038).

you create a calc script that calculates the budgeted marketing expense for New York in December 2000. 1997. For products introduced on or after January 1. the budgeted marketing expense will be an increase of 10%. 1997. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSTodate SS_ToDate. Do the 2000 Budget values match expected results? If not. Close the spreadsheet. Save the new script as CSTodate. Retrieve into this sheet. For products introduced prior to July 6. clear all data from the HLandS2 database. 2) 3) 4) 5) 6) 7) Hyperion 13-5 . run the CSTodate calc script. the budgeted marketing expense will be an increase of 10%. For this exercise. Lock and send the data in the Lock&Send sheet to the HLandS2 database. modify the CSTodate calc script and rerun the calculation until you get the expected results. the budgeted marketing expense will be a decrease of 10%. The budgeted marketing expenses are calculated in comparison to the actual marketing expenses for December 1999. For products introduced on or after January 1. The Budget 2000 Marketing values are not available. Perform a retrieval. For all other products. The budgeted marketing expenses are calculated in comparison to the actual marketing expenses for December 1999.Hyperion Essbase Calc Scripts Date and Time Functions 13 Exercise 13-1: Applying the Date & Time Function In this exercise. Create a calc script to calculate the budgeted marketing expense for New York in December 2000. the budgeted marketing expense is equal to the 1999 actual marketing expense. 1996. Open the SS_ToDate spreadsheet. Switch to the Calc&Retrieve sheet. For products introduced prior to July 6.xls 1) From Essbase Application Manager. 1996. For all other products. From the Calc&Retrieve sheet. the budgeted marketing expense will be a decrease of 10%. the budgeted marketing expense is equal to the 1999 actual marketing expense.

13 Date and Time Functions Hyperion Essbase Calc Scripts 13-6 Hyperion .

you will be able to: • • Explain the purpose and use of Miscellaneous functions to generate member lists Practice using the Miscellaneous functions in a series of incremental exercises .14 Miscellaneous Functions Chapter Objectives By the end of this chapter.

Using @CALCMODE.14 Miscellaneous Functions Hyperion Essbase Calc Scripts Using Miscellaneous Functions Essbase includes two types of miscellaneous functions. you can specifies whether Essbase calculates a formula in cell mode or block mode and whether Essbase calculates a formula bottom-up or top-down. Returns a character string that is the result of appending one character string to another character string. Summary of Miscellaneous Functions This table summarizes the Miscellaneous Functions. Each function is also described. @CONCATENATE and @SUBSTRING enable manipulation of character strings. Returns the requested substring of characters from an existing source string. in detail. @NAME @SUBSTRING 14-2 Hyperion . Passes the enclosed string or member name as a string to another function. Function @CALCMODE @CONCATENATE Enables the choice of an execution mode of a formula. in this chapter.

or database level using the configuration setting CALCMODE. Within one @CALCMODE specification. perform the instruction twice. To specify both types of modes.Turns on the cell calculation mode BLOCK . Syntax @CALCMODE (CELL|BLOCK|TOPDOWN|BOTTOMUP) CELL . you can specify only one option.Turns on the bottom-up calculation mode Notes @CALCMODE can control two types of modes: Whether a formula is calculated in block calculation or cell calculation mode when calculating formulas that contain certain functions (in particular the @ISMBR function) Whether a formula assigned to a sparse member is calculated in bottom-up or top-down mode Hyperion H H Cell and block modes are mutually exclusive. for example: @CALCMODE (CELL) @CALCMODE (TOPDOWN) You can also set CALCMODE BLOCK or CALCMODE BOTTOMUP at the server. Top-down and bottom-up modes are mutually exclusive.Hyperion Essbase Calc Scripts Miscellaneous Functions 14 @CALCMODE The @CALCMODE function enables the choice of an execution mode of a formula.Turns on the block calculation mode TOPDOWN . 14-3 . application.Turns on the top-down calculation mode BOTTOMUP .

Essbase groups the cells within a block and simultaneously calculates the cells in each group. See Example 4. a top-down calculation calculates the formula on all potential data blocks with the member. In contrast. Knowing When Essbase uses Cell or Block Mode and Topdown or Bottom-up Mode When Essbase compiles a formula. if the formula is to be calculated top-down. following the calculation order. Essbase determines which existing data blocks need to be calculated before it calculates the database. Although a top-down calculation is less efficient than a bottom-up calculation. Understanding Bottom-Up and Top-Down Calculation Modes Essbase uses one of two calculation methods to do a full calculation of a database outline: bottom-up calculation (the default) or top-down calculation. 14-4 Hyperion . it prints a message in the application log file explaining the mode of execution for the formula similar to the following message: Formula on member Profit % will be executed in CELL and TOPDOWN mode. If the database outline contains a complex member formula. Essbase performs a top-down calculation for that member. The calculation begins with the lowest existing block number and works up through each subsequent block until the last existing block is reached. Essbase then calculates only the blocks that need to be calculated during the full database calculation. but you must carefully consider data dependencies within the block to ensure that the resulting data is accurate. When a formula is compiled. in some cases top-down calculations are necessary to ensure that calculation results are correct. which is based on the order of the dense dimensions in the outline. A top-down calculation may be less efficient than a bottom-up calculation because more blocks may be calculated than is necessary. Essbase calculates each cell sequentially. Essbase logs a message in the application log file.14 Miscellaneous Functions Hyperion Essbase Calc Scripts Description Understanding Block Calculation and Cell Calculation Modes Using block calculation mode. Block calculation mode is fast. Using cell calculation mode. For a bottom-up calculation.

no message is written in the application log file. Understanding Data Dependency Issues With Block Calculation Mode Data dependency occurs if the accurate calculation of one or more members depends on another member or other on members being calculated previously. Essbase performs a topdown calculation because every possible combination of A must be examined to see whether B->D or C->D exists. for a simple formula such as A = B + C. Essbase uses cell calculation mode for formulas containing: @ANCEST @CURRMBR @ISMBR on a dense member @MDANCESTVAL @MDPARENTVAL @MDSHIFT @NEXT @PARENT @PARENTVAL @PRIOR @SANCESTVAL @SPARENTVAL @SHIFT Hyperion H H H H H H H H H H H H H For all other formulas. A is calculated only if B or C exists in the database. Most data dependency issues with block calculation mode occur when a formula contains IF ELSE or IF ELSEIF conditions. or database level using the configuration setting CALCMODE. when using the @PRIOR function. 14-5 . data dependencies can occur in other formulas. You can also set CALCMODE BLOCK or CALCMODE BOTTOMUP at the server. The dependency of the formula on B and C is known before the calculation is started. By default. By default. for example. Essbase uses block calculation mode by default. For a complex formula such as A = B->D + C->D. application. However.Hyperion Essbase Calc Scripts Miscellaneous Functions 14 When Essbase determines that the formula will be executed in block and bottom-up mode. Essbase does a bottomup calculation.

See Example 2. See Example 1. placing the members that satisfy the ELSEIF condition in the first group and the members that satisfy subsequent ELSEIF or ELSE conditions in the second group. Understanding Other Data Dependency Issues Data dependencies can occur in formulas that do not contain IF ELSE conditions. If a formula contains data dependencies.14 Miscellaneous Functions Hyperion Essbase Calc Scripts Data Dependency Issues With IF ELSE and IF ELSEIF When Essbase uses block calculation mode to calculate a formula that contains IF ELSE or IF ELSEIF conditions. The second group contains the members that satisfy the ELSE or ELSEIF conditions. Essbase simultaneously calculates the members in the first group before simultaneously calculating the members in the second group. Hyperion . Dependent members are in the second group. ensure that the following conditions are met: Members on which the accurate calculation of other members depends are in the first group. Essbase evaluates each ELSEIF condition. See Example 3 for an example of data dependency in a formula containing the @PRIOR function. 14-6 H H If an IF condition has multiple ELSEIF conditions. The first group contains the members that satisfy the IF condition. it separates the members being calculated into two groups.

"Budget Sales" ( @CALCMODE(BLOCK). Example 2. Time and Accounts.The time blocks are calculated sequentially (i. Feb. After calculating Feb.Hyperion Essbase Calc Scripts Miscellaneous Functions 14 Examples Example 1. and Example 3 illustrate use of the BLOCK and CELL options of the @CALCMODE function. Feb is the only member that satisfies the IF condition. The following formula is placed on the Budget Sales member of the Accounts dimension. Jan.e. Mar is assigned the new value for Feb (100) plus ten. Mar). IF(@ISMBR(Feb)) "Budget Sales"=100. Because this is a formula containing @ISMBR applied to a dense member (Budget Sales). Example 4 illustrates use of the BOTTOMUP and TOPDOWN options.Essbase calculates the members satisfying the IF condition first. by default Essbase uses cell calculation mode. In this example. Jan is assigned the pre-existing value for Feb (20) plus ten.) The following table shows the Budget Sales values before execution and compares the values that would be generated by running the calc script excluding and including the @Calcmode command: Before Execution Jan Feb Mar 10 20 30 Without @Calcmode 30 100 110 With @Calcmode 110 100 110 Without @Calcmode(Block) . ELSE "Budget Sales"=Feb+10.. With @Calcmode(Block) . You can use the @CALCMODE(BLOCK) function to specify block calculation mode for this formula. Example 1 Consider a database with two dense dimensions. Feb is assigned the new value (100). ENDIF. Hyperion 14-7 . Essbase calculates the members Jan and Mar to have the new value for Feb (100) plus ten.

ELSEIF(@ISMBR(Jan)) "Budget Sales"=Feb+10. followed by the members satisfying the ELSE condition. IF(@ISMBR(Mar)) "Budget Sales"=Feb+20.14 Miscellaneous Functions Example 2 Hyperion Essbase Calc Scripts Now consider the same database as in Example 1.The time blocks are calculated sequentially (i. Mar). Jan is assigned the pre-existing value for Feb (20) plus ten.. because this is a formula containing @ISMBR applied to a dense dimension member (Budget Sales). Feb. Hyperion Essbase calculates the members in the following order: Mar. You can use the @CALCMODE(BLOCK) function to specify block calculation mode for this formula. Feb is assigned the new value (100). followed by the members satisfying the ELSEIF condition. by default Essbase uses cell calculation mode. but we place the following formula on the Budget Sales member of the Accounts dimension. Mar is assigned the new value for Feb (100) plus twenty. As in Example 1. Jan. Jan. 14-8 Hyperion .Essbase calculates the members satisfying the IF condition first.) The following table shows the Budget Sales values before execution and compares the values that would be generated by running the calc script excluding and including the @Calcmode command: Before Execution Jan Feb Mar 10 20 30 Without @Calcmode 30 100 120 With @Calcmode 30 100 40 Without @Calcmode(Block) . In this example. ELSE "Budget Sales"=100.e. Feb. "Budget Sales" ( @CALCMODE(BLOCK). With @Calcmode(Block) . ENDIF.

Essbase calculates the members simultaneously. taking the previous month's Ending Inventory #MISSING value as 0 for all member combinations and adding 10. Hyperion 14-9 . and finally Mar is calculated. "Ending Inventory"="Opening Inventory".A block calculation mode is used. then Feb values are calculated using ending value for Jan.Values for Jan is calculated first.) The following table shows the inventory values before execution and compares the values that would be generated by running the calc script excluding and including the @Calcmode command: Before Execution Opening Jan Feb Mar #MI #MI #MI Ending #MI #MI #MI Without @Calcmode Opening 10 10 10 Ending 10 10 10 With @Calcmode Opening 10 20 30 Ending 10 20 30 Without @CALCMODE . “Opening Inventory”( @CALCMODE(CELL) "Opening Inventory"=@PRIOR("Ending Inventory")+10. With @CALCMODE .Hyperion Essbase Calc Scripts Example 3 Miscellaneous Functions 14 Consider the following calc script to calculate the members Opening Inventory and Ending Inventory using the @PRIOR function.

10 200*1. This top-down calculation calculates three values. This bottom-up calculation calculates two values. Budget=Actual*1.10. considering all potential combinations of Budget. @CALCMODE(TOPDOWN). calculating a formula top-down versus bottom-up may involve two issues: performance (reflecting the number of calculations that must be made) and accuracy.10 No calculation is performed 400*1. based on existing combinations of Budget. @CALCMODE(BOTTOMUP). with the following results: Before Execution Actual Jan Feb Mar #MI 200 400 Budget 50 #MI 450 After Execution Actual #MI 200 400 Budget #MI 220 440 #MISSING*1. with the following results: Before Execution Actual Jan Feb #MI 200 Budget 50 #MI After Execution Actual #MI 200 Budget #MI #MI #MISSING*1. Budget=Actual*1.10 Comment Mar 400 450 400 440 The following formula is calculated top-down.10 400*1.14 Miscellaneous Functions Example 4 Hyperion Essbase Calc Scripts Depending on the formula and the structure of the data.10 Comment 14-10 Hyperion . The following formula is calculated bottom-up.10. This example compares calculation results to illustrate both of these issues.

the result is Qtr1_Sales: @CONCATENATE(@CURRMBR(Year). The following function statement returns string values starting with the current member of the Year dimension. Syntax @CONCATENATE (String1. for example. for example.A string or member name. or a function that returns a string or single member name String2 . if the current members being calculated are Qtr1 and Sales. followed by the current member of the Measures dimension.@CURRMBR(Measures))) Hyperion 14-11 . you can nest multiple instances of the @CONCATENATE function. if the current member being calculated is 100-10. followed by an underscore. String2) String1 . @CONCATENATE("_".@CURRMBR(Product)) Example 2 To concatenate more than two strings. or a function that returns a string or single member name Examples The following examples are based on the Sample Basic database: Example 1 The following function statement puts the string Product in front of the name of the member currently being processed in the Measures dimension.A string or member name. the result is Product100-10: @CONCATENATE("Product".Hyperion Essbase Calc Scripts Miscellaneous Functions 14 @CONCATENATE The @CONCATENATE function returns a character string that is the result of appending one character string to another character string.

95 2. Example The following example is based on the Sample Basic database.95 Feb 1. dimension name. MonthName Jan Feb Mar Jan Feb Mar ProductId 100-10 100-10 100-10 100-20 100-20 100-20 Price 1. The @NAME function processes strings. or a string.00 2. 14-12 Hyperion . A user defined function is used to retrieving the price from the table below.98 2.95 2. It treats strings as values or array of values.14 Miscellaneous Functions Hyperion Essbase Calc Scripts @NAME The @NAME() function passes the enclosed string or member name as a string to another function.@NAME(@CURRMBR(Year))).05 Price = @J_GetPrice(@NAME(@CURRMBR(Product)).95 1.90 1.00 Mar 1.05 Notes Essbase does not support strings in functions. The following report illustrates the above example: Jan 100-10 100-20 1. The user defined function (J_GetPrice) takes two string parameters time and product name to return the price for each product.90 1. Syntax @NAME (mbrName) mbrName .98 1.Any valid single member name.

or a function that returns a string or a single member name StartPosition . EndPosition]) String .) Hyperion 14-13 .6) @SUBSTRING (@PARENT(Jan). The source string can be a text string or a member name.3. and so on. 1 corresponds to the second character. Essbase returns all remaining characters from the source string.2) @SUBSTRING ("200-21". Example The following examples are based on the Sample Basic database: Statement @SUBSTRING ("100-10". or it can result from a specified function that returns a text string or a single member name. 1 corresponds to the second character. and so on. Syntax @SUBSTRING (String. If EndPosition is not specified or is less than StartPosition. where 0 corresponds to the first character in String.A string or member name. StartPosition [.1) @SUBSTRING ("200-21".0. An integer greater than or equal to 0.The first position past the last character to be included in the substring.3) Result "00-10" "20" “0-2” “1” (The parent of Jan is Qtr1. An integer greater than or equal to 0.Beginning character position within String to include in the substring. where 0 corresponds to the first character in String. EndPosition .Hyperion Essbase Calc Scripts Miscellaneous Functions 14 @SUBSTRING The @SUBSTRING function returns the requested string of characters from an existing source string.

14 Miscellaneous Functions Hyperion Essbase Calc Scripts 14-14 Hyperion .

you will be able to: • Explore calc script options that improve efficiency and ensure accurate calculation results List data management tools used in calc scripts Describe the process of preparing for and creating calc scripts Determine whether IF or FIX is the most efficient way to isolate data in a calc script Illustrate how to use data management commands to prepare budget data Explain how to allocate high-level data to lower levels Demonstrate how to use cross-dimensional operators to perform market-share analysis • • • • • • . Tricks and Techniques Chapter Objectives By the end of this chapter.15 Tips.

It also. under many circumstances. calculate dense dimensions before sparse dimensions. FIX limits the number of blocks brought into memory. This minimizes the number of blocks processed on dense calculations. As additional calculations are performed. you may wish to experiment with various solutions in your environment to find the combination that works best for you. Tricks and Techniques Hyperion Essbase Calc Scripts Calc Script Design Considerations As you create calc scripts.15 Tips. Keep in mind that order of calculation is determined by the outline unless you override that order. blocks marked clean are not calculated. Intelligent Calcs Intelligent Calcs decrease the number of times a block is calculated.Actual) California = 120. and does not cause the creation of additional sparse blocks. Endfix 15-2 Hyperion . use the FIX command to ensure that Essbase creates only the required data blocks. For example: Fix(Colas. Essbase automatically creates a data block for every combination of sparse dimension members containing that member. Two-pass calculations Use of two-pass calculations ensures correct calculation of higher level blocks. and IF tests every block. IF or FIX As a general rule. If a block has been recently calculated. increases the number of database passes. use FIX instead of multiple IF statements on sparse blocks. Calculating or aggregating on a sparse dimension exponentially increases the number of blocks. a flag is set in the index node signifying that the block is clean. Blocks on equations When you assign a constant to a member on a sparse dimension. you find that there are many ways to create similar results. and that some ways are more efficient than others. Dense calculations before sparse calculations After a database has been loaded. However. Because you could inadvertently create thousands of data blocks using this method.Misc.

The more contact you have with the analyst. you may need to perform data management and rollup functions to ensure that the numbers work together. When you are sure that the individual calculations work correctly. Tricks and Techniques 15 Approaching Calc Scripts Solutions Although it is tempting to jump into coding a calc script by writing individual calculations. Often requirements are ambiguous. Communication As you develop a calc script. Business problem The most important part of a calc script is the part that does not show up in the application: the business problem. you save yourself time and unexpected results if you use the following method to develop calc scripts. you receive a written description of the problem to be solved. If actual sales increase by 10%. review the problem with the analyst who requested the calc script to make sure there are no ambiguities. calc scripts with fewer calculations run more efficiently. Individual calculations As a general rule. Affected data The two types of affected data are: data that is the subject of the calc script itself and data that is contextually dependent on the subject data. the less likely it is that you be required to redo your work. For example. Hyperion 15-3 . Ideally.Hyperion Essbase Calc Scripts Tips. you may find it easier to break complex calculations into individual calculations for testing purposes. should forecast sales for the same period be restated? Rollup considerations At what level in the outline do calculations occur? Is it necessary to roll up changes to higher levels? Is it necessary to push results down to lower levels? In addition to performing the basic calculations called for by the business problem. However. you can combine them and test for similar results. forecast data is dependent on actual sales data. and you do not discover problems until you are further along in the process. you should maintain contact with the analyst who requested it. After you review the descriptionwhich should be clear and specific.

. use FIX instead of multiple IF statements on sparse blocks. ENDFIX is often equivalent to: IF(@ISMBR(”New York”)) . However. FIX limits the number of blocks brought into memory.15 Tips. either structure could be used by using a Boolean function in a IF-structure or its corresponding Member Set function in the FIX-structure. ENDIF Boolean functions and the likely corresponding Member Set functions are: Boolean Function @ISANCEST @ISCHILD @ISDESC @ISGEN @ISIANCEST @ISICHILD @ISIDESC @ISIPARENT @ISISIBLING @ISLEV @ISPARENT @ISSAMEGEN @ISSAMELEV @ISSIBLING @ISUDA Member Set Function @ANCESTORS @CHILDREN @DESCENDANTS @GENMBRS @IANCESTORS @ICHILDREN @IDESCENDANTS @IALLANCESTORS @ISIBLINGS @LEVMBRS @PARENT @GENMBRS @LEVMBRS @SIBLINGS @UDA As a general rule. Tricks and Techniques Hyperion Essbase Calc Scripts IF vs FIX One consideration for isolating data is the choice between IF and FIX.. you may wish to experiment with various solutions in your environment to find the combination that works best for you. 15-4 Hyperion .. In many situations.. and IF tests every block. for example: FIX(“New York”) .

For this exercise. From Essbase Application Manager.xls. Review the outline for the HLandS2 database. not the increased commissions. The budgeted amount should reflect the original commissions for the current year. clear all data from the HLandS2 database. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSIf_Fix SS_If_Fix. Notice which members are affected and whether the dimensions containing those members are dense or sparse. Although IF and FIX provide the same results. you must perform two calculations for the Eastern region.xls 1) 2) 3) Open and review the data in spreadsheet SS_If_Fix. Rollup considerations There are no rollup considerations. Individual calculations Data for commissions should be copied from 1999 actuals to the 2000 budget. You must derive 2000 budget data for commissions. you need to consider density and efficiency when you choose the appropriate command. increasing all commissions for the 1999 actuals by 25%.Hyperion Essbase Calc Scripts Tips. Tricks and Techniques 15 Exercise 15-1: Isolating Data Using IF or FIX In the scenario. Business problem Make commission adjustments for the Eastern region. Hyperion 15-5 . Then actual commissions should be increased for the Eastern region by 25%. The 2000 budget is derived from unadjusted commissions for 1999 actuals. because data is at the lowest level. Affected data All 1999 actual data for commissions in the Eastern region is affected.

If all calculation requirements are not met. run the CSIF_Fix calc script. revise the calc script and rerun the calculation. consider whether to use IF or FIX on the specific data that you are calculating.15 Tips. Ensure that all calculation requirements are met. Lock and send the data in the Lock&Send sheet to the HLandS2 database. The retrieval may take a few minutes. 5) 6) 7) 8) 9) 15-6 Hyperion . connect to the Essbase server and select the Calc:HLandS2 database. From the Calc&Retrieve sheet. Save the calc script as CSIF_Fix. Perform a retrieval and notice the calculation results. Close the SS_If_Fix spreadsheet. In Microsoft Excel. When writing the calc script. Tricks and Techniques 4) Hyperion Essbase Calc Scripts Create a calc script using the Calc Script Editor.

For this exercise. Modify the calc script CSIf_Fix using the Calc Script Editor. The retrieval may take a few minutes. run the CSIfix2 calc script. In Microsoft Excel open spreadsheet SS_If_Fix. If all calculation requirements are not met.Hyperion Essbase Calc Scripts Tips. Tricks and Techniques 15 Exercise 15-1b: Isolating Data Using IF or FIX Time permitting. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS2 CSIf_Fix CSIfix2 SS_If_Fix.xls. redo the calc script for Exercise 15-1. Save the calc script as CSIfix2. review the event log to determine the length of time required to run the calc script CSIfix2. From the Calc&Retrieve sheet. Perform a retrieval and notice the calculation results. but replace IF statements with equivalent FIX statements. Which is more efficient for your environment? 4) 5) 6) 7) 8) 9) 10) Hyperion 15-7 . Lock and send the data in the Lock&Send sheet to the HLandS2 database. Replace IF statements with equivalent FIX statements. Clear all data from the HLandS2 database.xls 1) 2) 3) From Essbase Application Manager. and the FIX statements with equivalent IF statements. and the FIX statements with equivalent IF statements. Close the SS_If_Fix spreadsheet. From Essbase Application Manager. Ensure that all calculation requirements are met. revise the calc script and rerun the calculation. review the event log to determine the length of time required to run the calc script CSIf_Fix. and connect to the Essbase server and select the Calc:HLandS2 database.

@CHILDREN (West). Profit= Sales . A couple of examples follow. and does not account for shipping materials. or record keeping. Often the simplest solution is the most efficient.05. To cover all the expenses associated with shipping. 2. Where possible.{Other Expenses} . the second example ran 10% faster. ENDFIX But.5% of Profit.05. For example: At present Profit is calculated by consolidation operators within the outline as Margin less various costs. in tests with a small database.COGS . These costs include Freight which is loaded directly into the database at level 0. Since Profit is calculated by deducting the freight charge from Margin. They usually consume large amounts of resources. However Freight is currently only charged as the cost of shipping.Freight 15-8 Hyperion . Looping The need to use loops is very rare. Allocation vs Cross-Dimensional Operators When looking at the allocation of values from upper-level members to lower-level members. Tricks and Techniques Hyperion Essbase Calc Scripts Simpler is Usually Better Use the power of the OLAP structure to help create the simplest solution to your problem.share).. Therefore. solve simultaneous equations algebraically instead of using loops."1999 Actual". ENDFIX produces the same results as: FIX (@CHILDREN (West). the department overhead. it is often more efficient to use cross-dimensional operators instead of the @MDALLOCATE function. and should be avoided. the new policy is to charge a rate for freight of 1. both Freight and Profit are now unknown values in a simultaneous equation.15 Tips.@CHILDREN ("Total Expenses")) "2000 Budget"= "1999 Actual"*1. @CHILDREN ("Total Expenses"). For example: FIX ("Total Expenses") "2000 Budget"= @MDALLOCATE (West->"1999 Actual"->"Total Expenses"* 1.

Break) Profit = Sales .COGS . Tricks and Techniques 15 Profit = (Sales . Freight = Profit * . LOOP(10.015. But.Hyperion Essbase Calc Scripts and Freight = .015.015. ENDIF) ENDLOOP which produces the same results as: Profit = (Sales .COGS) / 1. Algebraic manipulation yields: Tips.COGS .Freight))-Freight) < 0.001) Break = 1.COGS . in tests with a small database. Two options for creating this calc script are: VAR Break = 0. Profit( IF (Profit<>#Missing AND @ABS((. Freight = Profit * .Freight.015.015 * Profit.{other expenses})/1.015*(Sales . Hyperion 15-9 . the second example ran over 90% faster.

freight costs must be allocated to each sale. Product and Market data must be rolled up to the highest level. For example.15 Tips. Business problem Calculate a line item for freight for each individual Product-Market combination. To show the true profit on a sale. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSAlloc2 SS_Alloc2. For this exercise. and must be allocated down to the individual Product-Market level. Rollup considerations To obtain accurate data for total Freight expense. Solution Write a calc script to calculate the freight expense for each Product-Market combination.xls 15-10 Hyperion . The allocation is based on the ratio of an individual sale to total sales.Market combination for budgeted freight is calculated based on this ratio. The Freight data is allocated to each combination of Product and Market. For each Product-Market develop a ratio of actual sales to total sales. Use cross-dimensional operators to define the formula. rather than at the individual transaction level. Individual calculations Calculation of lower level freight costs is based on a ratio of actual individual freight to actual total freight. total freight can be stored at an ancestor level. Budgeted freight expense is loaded at the highest level. Apply each ratio to the total freight costs to provide individual freight costs. Tricks and Techniques Hyperion Essbase Calc Scripts Exercise 15-2: Allocations Data can be loaded into high-level members of an Essbase database. Affected data Data from total budgeted freight that is loaded is used to provide an individual budgeted freight expense. Each Product.

Hyperion Essbase Calc Scripts 1) Tips. The retrieval may take a few minutes. Ensure that all calculation requirements are met. connect to the Essbase server and select the CALC:HLandS1 database. 2) 3) 4) 5) 6) 7) 8) 9) 10) Hyperion 15-11 . If not. Save your calc script as CSAlloc2. run the CSAlloc2 calc script. Tricks and Techniques 15 Review the outline for the HLandS1 database. Create your calc script using the Calc Script Editor. Perform a retrieval and notice the calculation results. revise the calc script and rerun the calculation. From the Calc&Retrieve sheet. From Essbase Application Manager. Note which data is affected and determine whether rollups must be completed before individual calculations. In Microsoft Excel. Lock and send the data in the Lock&Send sheet to the HLandS1 database. Close the SS_Alloc2 spreadsheet.xls. clear all data from the HLandS1 database. From Essbase Application Manager. Open and review the data in spreadsheet SS_Alloc2. review the event log to determine the length of time required to run the calc script CSAlloc2.

both on a category level (all Rods & Reels) and on an individual product level.xls 1) Review the data in spreadsheet SS_Share. Business problem Management is concerned with how well Rods & Reels are selling. Rollup considerations Because the calculation of the Products share is based upon total Products sales. Solution Write a calc script that calculates Product Share. Tricks and Techniques Hyperion Essbase Calc Scripts Exercise 15-3: Product Share Analysis Almost every business wants to know what products are its best sellers. Areas of the data must be isolated: sales data for individual products and sales data for total products. Affected data Total Products sales and the Rods and Reels member of the Products dimension's are affected or referenced by these calculations. 15-12 Hyperion . Calculate percentage of Rods & Reels sales to total product sales. Product Share is equal to a product or sales of a product line as a percentage of total product sales. These are within the Actual scenario. For this exercise. The Sales member of the dimension tagged as accounts in also affected. you use the following files: Database Calc Script (new) Spreadsheet CALC:HLandS1 CSShare SS_Share. Individual calculations Individual calculations consist of calculating a percentage of individual Rods & Reels sales by total Product sales. sales must be rolled up across the entire database for actuals. Use cross-dimensional operators to define the formula.15 Tips.

Do the calculated results match the expected results? If not. revise the calc script and rerun the calculation. From Essbase Application Manager. Save the calc script as CSShare. From the Calc&Retrieve sheet. open and review the data in spreadsheet SS_Share. Notice which data is affected. From Essbase Application Manager.Hyperion Essbase Calc Scripts 2) Tips.xls. Close the SS_Share spreadsheet. clear all data from the HLandS1 database. clear all data from the HLandS1 database. and determine whether rollups must be completed before individual calculations. Create a calc script using the Calc Script Editor. Connect to the Essbase server and select the CALC:HLandS1 database. In Microsoft Excel. 3) 4) 5) 6) 7) 8) 9) 10) 11) Hyperion 15-13 . Lock and send the data in the Lock&Send sheet to the HLandS1 database. Perform a retrieval and compare the retrieved calculation results to the results in the “Expected Results” column. run the CSShare calc script. Tricks and Techniques 15 Open the outline for the HLandS1 database.

Tricks and Techniques Hyperion Essbase Calc Scripts Unit Summary In previous units. you had the opportunity to review business problems and develop calc scripts to solve the problems. you looked at functions and commands in isolation or in small calc scripts that provided context. Careful planning and an understanding of the business problem are key to creating successful calc scripts.15 Tips. In this unit. The basic steps used to create calc scripts are as follows: Clarify the business problem Identify affected data Satisfy rollups requirements Create individual calculations 15-14 H H H H You created calc scripts (allocations. and market share analysis) to solve common business problems. budget creation. Hyperion .

In some cases.A Suggested Answers Possible Solutions • • Potential solutions to the exercises for the course are presented in this chapter. It is left up to you to test these solutions to determine which is the most efficient for your particular environment. . more than one solution is presented.

"Buffalo". Exercise 3-2: Running Calc Scripts SET MSG SUMMARY. Variance = @VAR (Actual.1. Commission ( IF ("Margin Percent" > 15) Commission = Sales * . ENDFIX Exercise 4-2: Focus Calculations using If / Else / Endif CALC DIM (Accounts).A Suggested Answers Hyperion Essbase Calc Scripts Exercise 3-1: Explore Calc Script Editor and Online Help CALC DIM (Accounts). “Pre Tax Profit”. Variance = @VAR (Actual. Exercise 3-3: Member Calculations and Mathematical Operators “Margin”.10. Variance = @VAR(Actual. "Jan 1999") Sales = Sales * 1. "Albany". CALC DIM (Accounts). ENDIF ) Exercise 4-3: Focus Calculations using Cross-Dimensional Operators Sales ( Budget->"Feb 1999"->Sales= Budget->"Jan 1999"->Sales*1. Exercise 4-1: Focus Calculations using Fix / EndFix FIX (Budget. Budget). “Regional Profit”. ) A-2 Hyperion .08. Budget). Budget). “Total Expenses”. ELSE Commission = Sales * .15.

ENDFIX Exercise 7-1: Applying Member Set Functions FIX (Budget) FIX(@IDESCENDANTS (East)) CALC DIM (Time.15. "2000". 2. ENDFIX "Corporate Expenses"= @ANCESTVAL (Products. Actual) FIX (Sales) Connecticut= @ROUND(@AVG(SKIPNONE.95. Budget) Sales( IF (@ISDESC (East) OR @ISDESC (West) ) Sales = Actual->"1999"*1.1. ENDIF. ENDFIX Exercise 8-1: Applying Relationship Function (@ANCESTVAL) FIX (Budget) FIX (Sales) CALC DIM (Time. Markets. ENDFIX ENDFIX Exercise 6-1: Using Boolean Functions FIX (Products. ENDFIX @IDESCENDANTS (East).Bridgeport:Waterbury). ELSE Sales = Actual->"1999"*. Products). Products).Hyperion Essbase Calc Scripts Suggested Answers A Exercise 5-1: Use Math Functions FIX ("Jan 1999"."Corporate Expenses") * Sales/@ANCESTVAL (Products.2). 2. ELSEIF (@ISDESC (South)) Sales = Actual->"1999"*1. Accounts. Sales). ENDFIX Hyperion A-3 .

"1997 Actual". ENDIF ) ENDFIX Exercise 9-2: Applying Financial Functions (@IRR) FIX("Total Year".A Suggested Answers Hyperion Essbase Calc Scripts Exercise 8-2: Applying Relationship Function (@CHILDREN) FIX (Jan. Markets. 1.0)) COGS COGS=Sales*(@XREF (COGS. "Ending Inventory".-1)) "Average Inventory" = @AVGRANGE (SKIPMISSING. ENDFIX ENDFIX Exercise 8-3: Applying Relationship Function (@XREF) FIX (Actual) COGS (IF (@ISLEV (Products. Additions="Ending Inventory" . ELSE "Opening Inventory" = @PRIOR("Ending Inventory"). @CHILDREN (@CURRMBR (Markets)))."1998 Actual". "2000 Actual") CALC DIM(Markets). ENDFIX A-4 Hyperion ."2000 Actual")."Opening Inventory". "1011-0010". @LVLMBRS(Products. "1999 Actual". COGS)). 0)) COGS=Sales*(@XREF (COGS. ENDFIX Exercise 9-1: Applying Range Functions (@PRIOR) FIX ("1999 Actual") "Opening Inventory" ( IF (@ISMBR (Jan)) "Opening Inventory"="Ending Inventory" .Additions. "4000 Product Family") Cash( IF (NOT(@ISMBR ("1997 Actual"))) Cash = Profit. ENDIF ) ROI=@IRR (Cash. ENDIF) ENDFIX OR FIX (Actual. COGS)). FIX(@IDESCENDANTS(Markets.

@LEVMBRS (Markets. Markets."1011-0000-1") CALC DIM(Markets). Jan. Sales. "1998 Actual"->"Total Year"->Sales. ENDFIX Exercise 11-1: Applying Forecasting Functions FIX ("1011-0000-1"... "1999 Actual"->"Total Year"). @LEVMBRS (Markets..share).1)) "Sales Rank"=@RANK (SKIPMISSING."1999 Actual". ENDFIX ENDFIX Hyperion A-5 .1))). Markets). ENDFIX FIX ("2000 Budget") CALC DIM (Accounts. ENDFIX FIX ("Total Expenses") "2000 Budget"= @MDALLOCATE (West->"1999 Actual"->"Total Expenses" * 1. 2. LR). @RANGE (Sales.) ENDFIX Exercise 12-1: Applying Statistical Functions FIX("1999 Actual". "2000 Budget"->"Total Year"->Sales.. "Total Year". "Sales Rank"( FIX (@LEVMBRS (Markets.05. @CHILDREN (West). Markets). @CHILDREN ("Total Expenses").Hyperion Essbase Calc Scripts Suggested Answers A Exercise 10-1: Applying Allocation Functions FIX ("1999 Actual") CALC DIM (Accounts.. 2)) Sales ( @TREND (@LIST("1997 Actual"->"Total Year"->Sales.

ENDIF) ENDFIX OR FIX ("2000 Budget") Commission ( IF (@ISIDESC (East)) Commission=Commission->"1999 Actual". FIX("2000 Budget" ) Marketing( IF (@ATTRIBUTEVAL ("IntroDate")>= @TODATE ("mm-dd-yyyy".25.25. "07-05-1996")) Marketing = "1999 Actual"->Marketing * . ELSE Marketing = "1999 Actual"->Marketing.9.A Suggested Answers Hyperion Essbase Calc Scripts Exercise 13-1: Applying the Date & Time Function FIX(Dec. ENDIF) Commission ( IF (@ISMBR ("1999 Actual")) Commission=Commission*1. ENDIF) ENDFIX A-6 Hyperion . ENDIF ) ENDFIX ENDFIX Exercise 15-1 & 15-1b: Isolating Data Using IF or FIX FIX (@IDESCENDANTS (East)) Commission ( IF (@ISMBR ("2000 Budget")) Commission=Commission->"1999 Actual". "01-01-1997")) Marketing = "1999 Actual"->Marketing * 1.1. ELSEIF (@ATTRIBUTEVAL ("IntroDate")<= @TODATE ("mm-dd-yyyy". "New York") CALC DIM(Products). ENDIF) ENDFIX FIX ("1999 Actual") Commission ( IF (@ISIDESC (East)) Commission=Commission*1.

Sales) CALC DIM (Time. Products). ENDFIX OR FIX (Actual.25.Sales) CALC DIM (Time. ENDFIX FIX (Budget.Hyperion Essbase Calc Scripts OR - Suggested Answers A Commission ( IF (@ISIDESC (East)) "2000 Budget"->Commission=Commission->"1999 Actual". "1999 Actual"->Commission= Commission->"1999 Actual"*1. Markets. @LEVMBRS(Markets. Products). 0). Markets. ENDFIX FIX (Budget) Freight=Sales->Actual / Sales->Actual->Markets->Products * Freight->Products->Markets. "1999 Actual"->Commission= Commission->"1999 Actual"*1. ENDFIX ENDFIX Hyperion A-7 . ) ENDFIX Exercise 15-2 : Allocations FIX (Actual. ENDFIX FIX (@IDESCENDANTS("2000 Product Family")) "Product Share"=Sales%Sales->Products. 0)) Freight=Sales->Actual / Sales->Actual->Markets->Products * Freight->Products->Markets. Products). ENDIF) OR FIX (@IDESCENDANTS (East)) Commission ( "2000 Budget"->Commission=Commission->"1999 Actual". ENDFIX Exercise 15-3 : Product Share Analysis FIX (Actual) FIX (Sales) CALC DIM (Time. Markets.25. @LEVMBRS(Products.

A Suggested Answers Hyperion Essbase Calc Scripts A-8 Hyperion .

They include • • • • Sample .Basic Calc .B Essbase Outlines The outlines used in for examples and exercises are detailed in this section.COGS .HLandS1 Calc .HLandS2 Calc .

B Essbase Outlines Hyperion Essbase Calc Scripts Sample .Basic outline is used to illustrate many of the examples in the descriptive material: Year (Dense) Qtr1 Jan Feb Mar Qtr2 Apr May Jun Qtr3 Jul Aug Sep Qtr4 Oct Nov Dec Measures (Dense) Profit Margin Sales COGS Total Expenses Marketing Payroll Misc Inventory Opening Inventory Additions Ending Inventory Ratios Margin % Profit % Profit per Ounce Product (Sparse) 100 Alias: Colas 100-10 100-20 100-30 Alias: Root Beer 200-10 200-20 200-30 200-40 Alias: Cream Soda 300-10 300-20 300-30 Alias: Fruit Soda 400-10 400-20 400-30 Alias: Diet Drinks 100-20 Shared 200-20 Shared 300-30 Shared 200 300 400 Diet B-2 Hyperion .Basic The Sample .

Basic (Continued) Market (Sparse) East New York Massachusetts Florida Connecticut New Hampshire West California Oregon Washington Utah Nevada South Texas Oklahoma Louisiana New Mexico Central Illinois Ohio Wisconsin Missouri Iowa Colorado Scenario (Dense) Actual Budget Variance Variance % Hyperion B-3 .Hyperion Essbase Calc Scripts Essbase Outlines B Sample .

B

Essbase Outlines

Hyperion Essbase Calc Scripts

**Sample - Basic (Attribute Dimensions)
**

Caffeinated (Attribute of Product) TRUE FALSE Ounces (Attribute of Product) 32 20 16 12 Pkg Type (Attribute of Product) Bottle Can Population (Attribute of Market) Small 3000000 6000000 Medium 9000000 12000000 15000000 18000000 Large 21000000 24000000 27000000 30000000 33000000 Intro Date (Attribute of Product) 3/25/96 4/1/96 9/27/95 7/26/96 12/10/96 6/26/96 10/1/96

B-4

Hyperion

Hyperion Essbase Calc Scripts

Essbase Outlines

B

Calc - HLandS1

The HLandS1 database is used for many of the exercises. The major differences from HLandS2 are in the structure of the Time and Scenarios dimensions. The Markets and Products dimensions are identical in each of these outlines.l

Time (Dense) 1997 Qtr1 1997 Jan-97 Feb-97 Mar-97 Qtr2 1997 Apr-97 May-97 Jun-97 Qtr3 1997 Jul-97 Aug-97 Sep-97 Qtr4 1997 Oct-97 Nov-97 Dec-97 1998 Qtr1 1998 Jan-98 Feb-98 Mar-98 Qtr2 1998 Apr-98 May-98 Jun-98 Qtr3 1998 Jul-98 Aug-98 Sep-98 Qtr4 1998 Oct-98 Nov-98 Dec-98 1999 Qtr1 1999 Jan-99 Feb-99 Mar-99 Qtr2 1999 Apr-99 May-99 Jun-99 Qtr3 1999 Jul-99 Aug-99 Sep-99 Qtr4 1999 Oct-99 Nov-99 Dec-99 2000 Qtr1 2000 Jan-00

Hyperion

B-5

B

Essbase Outlines

Feb-00 Mar-00 Qtr2 2000 Apr-00 May-00 Jun-00 Qtr3 2000 Jul-00 Aug-00 Sep-00 Qtr4 2000 Oct-00 Nov-00 Dec-00

Hyperion Essbase Calc Scripts

Accounts (Dense) Profit Pre Tax Profit Regional Profit Margin Sales COGS Total Expenses Freight Administration Payroll Marketing Miscellaneous Corporate Expenses Tax Inventory Opening Inventory Additions Ending Inventory Ratios Margin Percent Profit Percent Product Share Statistics Average Sales Commission Days of Sales Available Days Of Sales Adjusted Store Count Average Margin

B-6

Hyperion

Hyperion Essbase Calc Scripts

Essbase Outlines

B

**CALC - HLandS1 (Continued)
**

Scenario (Dense) Actual Budget Variance Variance Percent Percent

Markets (Sparse) East Connecticut Bridgeport Hartford Stamford Waterbury Maine Augusta Bangor Millinocket Portland Massachuset ts New Bedford Springfield Worcester New York Albany Buffalo Ithaca White Plains Rhode Island Jamestown Providence Quonochontaug West California Bakersfield Foster City Sacramento Half Moon Bay New Mexico Albuquerque Deming Sante Fe Oregon Condon Eugene Salem Washington Olympia Spokane Tacoma Walla Walla South Alabama Andalusia Birmingham Mobile

Hyperion

B-7

B

Essbase Outlines

Montgomery Florida Orlando Sarasota Tampa Georgia Athens Macon Valdosta Tennessee Memphis Murfreesboro Nashville Central Illinois Antioch Carbondale Cobden Rockford Wisconsin Green Bay La Crosse Milwaukee Neenah Wausau Texas Amarillo Austin Dallas Waco Missouri

Hyperion Essbase Calc Scripts

Cape Girardeau Kansas City Lebanon Sikeston St. Louis

B-8

Hyperion

Hyperion Essbase Calc Scripts

Essbase Outlines

B

**CALC - HLandS1 (Continued)
**

Products 1000 Product Family Crazy Horse 1011 1011-0000 1011-0000-1 1011-0000-2 1011-0000-3 1011-0010 1011-0020 1011-0030 1011-0040 Crazy Horse 1021 1021-0000 1021-0010 1021-0020 1021-0020-1 1021-0020-2 1021-0020-3 Crazy Horse 1031 1031-0000 1031-0020 1031-0030 1031-0040 1031-0050 1031-0050-1 1031-0050-2 1031-0050-3 1031-0070 1031-0070-1 1031-0070-2 1031-0090 Crazy Horse 1041 1041-0000 1041-0020 1041-0040 1041-0060 1041-0070 1041-0090 2000 Product Family Old Faithful 2011 2011-0000 2011-0000-1 2011-0000-2 2011-0000-3 2011-0000-4 2011-0000-5 2011-0000-6 2011-0010 2011-0010-1 2011-0010-2 2011-0010-3 2011-0010-4 2011-0010-5 2011-0010-6 Old Faithful 2021 2021-0000 2021-0010 Old Faithful 2031 2031-0000 2031-0000-1 2031-0000-2

Hyperion

B-9

B

Essbase Outlines

**Hyperion Essbase Calc Scripts
**

2031-0000-3 2031-0000-4 2031-0000-5 2031-0000-6 2031-0010 2031-0010-1 2031-0010-2 2031-0010-3 2031-0010-4 2031-0010-5 2031-0010-6

Old Faithful 2041 2041-0000 2041-0020 3000 Product Family Pomona 3011 3011-0000 3011-0010 3011-0020 3011-0030 3011-0040 Pomona 3021 3021-0000 3021-0010 3021-0030 Pomona 3031 3031-0000 3031-0030 3031-0020 3031-0040 Pomona 3041 3041-0000 3041-0020 3041-0040 3041-0060 Pomona 3051 3051-0000 3051-0000-1 3051-0000-2 3051-0000-3 3051-0000-4 3051-0020 3051-0020-1 3051-0020-2 4000 Product Family Shawnee 4011 4011-0000 4011-0010 4011-0020 Shawnee 4021 4021-0000 4021-0000-1 4021-0000-2 4021-0010 4021-0010-1 4021-0010-2 Shawnee 4031 4031-0000 4031-0000-1 4031-0000-2 4031-0010 4031-0010-1 4031-0010-2

B-10

Hyperion

Hyperion Essbase Calc Scripts

Essbase Outlines

B

Calc - HLandS2

The HLandS2 database is used for many of the exercises. The major differences from HLandS1 are in the structure of the Time and Scenarios dimensions. The Markets and Products dimensions are identical in each of these outlines.

Total Year Qtr1 Jan Feb Mar Qtr2 Apr May Jun Qtr3 Jul Aug Sep Qtr4 Oct Nov Dec

Accounts Profit Pre Tax Profit Regional Profit Margin Sales COGS Total Expenses Freight Administration Payroll Marketing Miscellaneous Corporate Expenses Tax Inventory Opening Inventory Additions Ending Inventory Average Inventory Ratios Margin Percent Profit Percent Product Share Statistics Average Sales Commission Days of Sales Available Days Of Sales Adjusted Store Count Sales Rank Average Margin Cash ROI

Hyperion

B-11

B Essbase Outlines Hyperion Essbase Calc Scripts CALC .HLandS2 (Continued) Scenario 1997 1997 Actual 1998 1998 Actual 1998 Budget 1999 1999 Actual 1999 Budget 2000 2000 Actual 2000 Budget Variances 1998 Actual VS 1999 Actual Percent Variance 1998 Budget VS 1999 Budget 1998 Actual VS 1998 Budget Markets (Sparse) East Connecticut Bridgeport Hartford Stamford Waterbury Maine Augusta Bangor Millinocket Portland Massachuset ts New Bedford Springfield Worcester New York Albany Buffalo Ithaca White Plains Rhode Island Jamestown Providence Quonochontaug West California Bakersfield Foster City Sacramento Half Moon Bay New Mexico Albuquerque Deming Sante Fe Oregon Condon Eugene Salem Washington Olympia B-12 Hyperion .

Hyperion Essbase Calc Scripts Spokane Tacoma Walla Walla South Alabama Andalusia Birmingham Mobile Montgomery Florida Orlando Sarasota Tampa Georgia Athens Macon Valdosta Tennessee Memphis Murfreesboro Nashville Central Illinois Antioch Carbondale Cobden Rockford Wisconsin Green Bay La Crosse Milwaukee Neenah Wausau Texas Amarillo Austin Dallas Waco Missouri Cape Girardeau Kansas City Lebanon Sikeston St. Louis Essbase Outlines B Hyperion B-13 .

B Essbase Outlines Hyperion Essbase Calc Scripts CALC .HLandS2 (Continued) Products 1000 Product Family Crazy Horse 1011 1011-0000 1011-0000-1 1011-0000-2 1011-0000-3 1011-0010 1011-0020 1011-0030 1011-0040 Crazy Horse 1021 1021-0000 1021-0010 1021-0020 1021-0020-1 1021-0020-2 1021-0020-3 Crazy Horse 1031 1031-0000 1031-0020 1031-0030 1031-0040 1031-0050 1031-0050-1 1031-0050-2 1031-0050-3 1031-0070 1031-0070-1 1031-0070-2 1031-0090 Crazy Horse 1041 1041-0000 1041-0020 1041-0040 1041-0060 1041-0070 1041-0090 2000 Product Family Old Faithful 2011 2011-0000 2011-0000-1 2011-0000-2 2011-0000-3 2011-0000-4 2011-0000-5 2011-0000-6 2011-0010 2011-0010-1 2011-0010-2 2011-0010-3 2011-0010-4 2011-0010-5 2011-0010-6 Old Faithful 2021 2021-0000 2021-0010 Old Faithful 2031 2031-0000 2031-0000-1 2031-0000-2 B-14 Hyperion .

Hyperion Essbase Calc Scripts Essbase Outlines 2031-0000-3 2031-0000-4 2031-0000-5 2031-0000-6 2031-0010 2031-0010-1 2031-0010-2 2031-0010-3 2031-0010-4 2031-0010-5 2031-0010-6 B Old Faithful 2041 2041-0000 2041-0020 3000 Product Family Pomona 3011 3011-0000 3011-0010 3011-0020 3011-0030 3011-0040 Pomona 3021 3021-0000 3021-0010 3021-0030 Pomona 3031 3031-0000 3031-0030 3031-0020 3031-0040 Pomona 3041 3041-0000 3041-0020 3041-0040 3041-0060 Pomona 3051 3051-0000 3051-0000-1 3051-0000-2 3051-0000-3 3051-0000-4 3051-0020 3051-0020-1 3051-0020-2 4000 Product Family Shawnee 4011 4011-0000 4011-0010 4011-0020 Shawnee 4021 4021-0000 4021-0000-1 4021-0000-2 4021-0010 4021-0010-1 4021-0010-2 Shawnee 4031 4031-0000 4031-0000-1 4031-0000-2 4031-0010 4031-0010-1 4031-0010-2 Hyperion B-15 .

HLandS2 (Attribute Dimension) IntroDate 1/1/90 7/5/96 7/6/96 10/13/98 B-16 Hyperion .B Essbase Outlines Hyperion Essbase Calc Scripts CALC .

Hyperion Essbase Calc Scripts Essbase Outlines B Calc .COGS Time (Dense) 1997 1998 1999 2000 Accounts COGS Hyperion B-17 .

COGS (Continued) Products 1000 Product Family Crazy Horse 1011 1011-0000 1011-0000-1 1011-0000-2 1011-0000-3 1011-0010 1011-0020 1011-0030 1011-0040 Crazy Horse 1021 1021-0000 1021-0010 1021-0020 1021-0020-1 1021-0020-2 1021-0020-3 Crazy Horse 1031 1031-0000 1031-0020 1031-0030 1031-0040 1031-0050 1031-0050-1 1031-0050-2 1031-0050-3 1031-0070 1031-0070-1 1031-0070-2 1031-0090 Crazy Horse 1041 1041-0000 1041-0020 1041-0040 1041-0060 1041-0070 1041-0090 2000 Product Family Old Faithful 2011 2011-0000 2011-0000-1 2011-0000-2 2011-0000-3 2011-0000-4 2011-0000-5 2011-0000-6 2011-0010 2011-0010-1 2011-0010-2 2011-0010-3 2011-0010-4 2011-0010-5 2011-0010-6 Old Faithful 2021 2021-0000 2021-0010 Old Faithful 2031 2031-0000 2031-0000-1 2031-0000-2 B-18 Hyperion .B Essbase Outlines Hyperion Essbase Calc Scripts Calc .

Hyperion Essbase Calc Scripts Essbase Outlines 2031-0000-3 2031-0000-4 2031-0000-5 2031-0000-6 2031-0010 2031-0010-1 2031-0010-2 2031-0010-3 2031-0010-4 2031-0010-5 2031-0010-6 B Old Faithful 2041 2041-0000 2041-0020 3000 Product Family Pomona 3011 3011-0000 3011-0010 3011-0020 3011-0030 3011-0040 Pomona 3021 3021-0000 3021-0010 3021-0030 Pomona 3031 3031-0000 3031-0030 3031-0020 3031-0040 Pomona 3041 3041-0000 3041-0020 3041-0040 3041-0060 Pomona 3051 3051-0000 3051-0000-1 3051-0000-2 3051-0000-3 3051-0000-4 3051-0020 3051-0020-1 3051-0020-2 4000 Product Family Shawnee 4011 4011-0000 4011-0010 4011-0020 Shawnee 4021 4021-0000 4021-0000-1 4021-0000-2 4021-0010 4021-0010-1 4021-0010-2 Shawnee 4031 4031-0000 4031-0000-1 4031-0000-2 4031-0010 4031-0010-1 4031-0010-2 Hyperion B-19 .

B Essbase Outlines Hyperion Essbase Calc Scripts B-20 Hyperion .

- 11 1 2 Essbase Adv
- Essbase Calc Script
- Hyperion Essbase
- calc
- Hyperion Planning - System 9
- hp_admin
- Calc Scripts for Mere Mortals
- Calculating Across Cubes Using @XREF
- Calculation Manager for Hyperion Planning Training Guide
- Hyperion Essbase 6_5 Bootcamp - Basic Training
- Hyperion Planning 11.1.2.3 Presentations
- Essbase Cac Script_Ex
- Hyperion Capital Asset Planning, Fusion Edition 11.1
- essmaxl
- HFM Overview 6
- HFM
- document.pdf
- Implementation ActivityGuideR9
- Open Data Unit Updated for SetDataWithPOV
- Essbase Tech Ref
- Guide to Essbase Cube Design
- esb dbag
- Hyperion Interview Questions
- EPMA Implementation Advanced Tips n Tricks POV Document
- Prior and MDshift Functions
- 38350275-Maxl-Overview
- R12.x Essential Activity Guide
- equity pickup
- Hyperion Planning Slides
- 23582944 Essbase Student Lab 1

Close Dialog## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Loading