216
Copyright © 2007, Mark Ostroff 516 Harry Truman Drive, Largo, MD 20774 All rights reserved. How’d You DO That? 8 th Edition Tips and Tricks Cookbook for Hyperion Intelligence and Hyperion System 9 BI+ Interactive Reporting Mark Ostroff Senior BI Solutions Consultant Hyperion Solutions

Hyperion Tips Cookbook 2007

  • Upload
    anonrj

  • View
    532

  • Download
    5

Embed Size (px)

Citation preview

Page 1: Hyperion Tips Cookbook 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

How’d You DO That?

8th

Edition

Tips and Tricks

Cookbook

for

Hyperion Intelligence

and

Hyperion System 9 BI+ Interactive Reporting

Mark Ostroff

Senior BI Solutions Consultant

Hyperion Solutions

Page 2: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

About the speaker

Mark Ostroff has nearly 30 years experience in the computer industry. He began programming

medical research data acquisition systems in Assembly Language and Fortran at the Johns

Hopkins School of Hygiene and Public Health using a PDP-12 mini-computer. He also helped

develop microcomputer device interfaces and database systems for use in the process control

industry. Mark then moved to building PC database applications using dBASE and Clipper.

These systems performed systems configuration management for the U.S. Navy, and project

tracking at IBM's COS Division.

Mark moved to the vendor side of the software industry when he joined Borland in 1989. Mark

worked at Borland as a Systems Engineer for nearly seven years. While employed at Borland,

Mark presented several times at the annual Borland Developer's Conference, at Comdex and at

numerous Delphi Client/Server seminars. In addition, he was one of the volunteers who helped

create the original Paradox-based "InTouch System" for the Friends of the Vietnam Veteran's

Memorial.

Mr. Ostroff has written numerous articles for the Paradox, Delphi and Web Informant magazines.

Mark has been a certified Delphi developer and trainer. He was also a co-author of the book,

Delphi in Depth, from Osbourne/McGraw-Hill.

Mark started at Brio Software in June 1997 and came over to Hyperion as part of the Brio

acquisition. He is currently employed as a Senior Business Intelligence Solutions Consultant

working with Strategic customers, with a focus on Federal Government accounts. He was the

original author of the Tips and Tricks column for the BrioCast, Brio's original electronic customer

newsletter. Mark was also a speaker at all previous Brio Users Conferences. He presented the

original Tips and Tricks cookbook for Pivots and Charts in 1999, followed by yearly updates to

the Tips Cookbook as well as other numerous sessions. These included the “Planning a Smooth

Migration to v6.x” and the “BQY Performance Optimization” white papers.

Each year, Mark has expanded his “Tips and Tricks Cookbook” to include more tips:

Brio/Hyperion Conference Hyperion Intelligence Versions Number of Tips

1999 v5.0 through v5.5.6 13

2000 v6.0 through v6.2.3 22

2001 v6.0 through v6.5.0 34

2002 v6.0 through v6.6.1 47

2003 No conference --

2004 v6.0 through v8.2 62

2005 v6.0 through v8.3 78

2006 v6.0 through System 9 v9.0.1 103

2007 v6.0 through System 9 v9.3 129

NOTE: Any version dependencies are listed in the individual tip. Unless specifically noted, all tips will work in any version equal to or higher than v6.0.

* Tips marked with an Asterisk are new for 2007.

** Tips marked with a Double-Asterisk are new for 2006.

Page 3: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

1 INTRODUCTION............................................................................................1

2 BASIC CONCEPTS .......................................................................................2

Be Creatively Lazy................................................................................................................................2

Plan Your Course..................................................................................................................................2

What do you need for the Trip? ..........................................................................................................5

Prepare Your Data................................................................................................................................9

Specific Design Considerations ..........................................................................................................11

Locking in the Knowledge..................................................................................................................13

3 QUERY SECTION TIPS...............................................................................15

Limiting a Show Values List ..............................................................................................................16

Creating Global Cascading Show Values Lists ................................................................................17

Chart / Pivot Labels with Special Characters ** .............................................................................18

Limit by Sub-Total..............................................................................................................................19

Joining Data with Different Levels of Detail ** ...............................................................................20

Creating Read-Only Computed Items ..............................................................................................22

Date-Stamping a Query......................................................................................................................24

“What’s Not” Query ...........................................................................................................................25

Variable Limit “What’s Not” Query *..............................................................................................26

Displaying Query Status.....................................................................................................................28

Controlling the Drill Path ..................................................................................................................30

Page 4: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

Incremental Drilling ...........................................................................................................................31

Partial Importing of Excel data ** ....................................................................................................33

Folder-Based Data Models .................................................................................................................35

4 OLAPQUERY SECTION TIPS.....................................................................36

OLAP Bar-Line Chart........................................................................................................................37

Suppress Null Rows and Columns.....................................................................................................39

5 RESULTS AND TABLE SECTION TIPS .....................................................41

“Union All” on Local Results.............................................................................................................42

Creating Fiscal Year based information ...........................................................................................44

Custom Sorting of a Chart Legend ...................................................................................................46

Sorting Text Months in Calendar Order ..........................................................................................47

Display Limit Values in Charts..........................................................................................................48

Display Limit Values in Pivots...........................................................................................................49

OR Limits in Local Results * .............................................................................................................50

Parsing Names.....................................................................................................................................51

Padding numbers to a fixed length **...............................................................................................52

Creating Range-based analysis ..........................................................................................................53

Creating Range-based analysis without ELSE **............................................................................54

Creating multi-contingency grouping / ranges.................................................................................55

Dimensionalized Facts ** ...................................................................................................................57

Analyzing “factless” data ...................................................................................................................58

Flattening data ** ...............................................................................................................................59

Page 5: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

Text Searches.......................................................................................................................................60

Count of Participants #1.....................................................................................................................61

Count of Participants #2.....................................................................................................................62

Qualified Sub-Totals #1......................................................................................................................63

Qualified Sub-Totals #2......................................................................................................................64

Qualified Sub-Totals #3......................................................................................................................65

Custom Sorting with Break Totals * .................................................................................................67

Median by Sub-Groups ** .................................................................................................................69

Std Dev Chart **.................................................................................................................................70

Good-Bad Chart **.............................................................................................................................71

Percent of Region ................................................................................................................................73

Charting Missing Data .......................................................................................................................74

Hiding columns from a Pivot or Chart .............................................................................................75

Top and Bottom N Analysis ...............................................................................................................76

Dense Ranking *..................................................................................................................................78

Random Sampling...............................................................................................................................79

Total Transactions and Current Balance .........................................................................................80

Formatting Chart Multi-labels ** .....................................................................................................82

Double Underlining in a Report ** ...................................................................................................83

Detail and Summary in One Display **............................................................................................84

6 CHART SECTION TIPS ...............................................................................85

Baseline Comparison Chart (with a fixed target) ............................................................................86

Page 6: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

Baseline Comparison Chart (with DB values)..................................................................................87

Baseline Comparison Chart (with DB averages)..............................................................................89

Chart Smoothing.................................................................................................................................91

Scatter Charts (pre v9.3) ....................................................................................................................92

Best-Fit Charts ....................................................................................................................................93

Spotlighting in a Chart .......................................................................................................................95

Waterfall Charts * ..............................................................................................................................96

Clustered Bar-Line Chart * ...............................................................................................................98

Bar-Line with Multiple Lines (v9.3) * ...............................................................................................99

Population Pyramid Chart *............................................................................................................101

Portion within a Category ................................................................................................................104

Creating alternate sort order in a Chart.........................................................................................105

Chart Design for Report Embedding ..............................................................................................106

7 PIVOT SECTION TIPS...............................................................................107

Variance Reporting...........................................................................................................................108

Adding textual annotations to a Pivot .............................................................................................109

Adding symbolic annotations to a Pivot..........................................................................................110

Displaying Performance Comparisons............................................................................................111

Convert Nulls to Zeros......................................................................................................................112

Creating alternate sort order in a Pivot..........................................................................................113

Demographic Analysis ......................................................................................................................114

Percent Decrease ...............................................................................................................................115

Page 7: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

Side Label-based Averages *............................................................................................................116

Gannt Charts (pre-v9.3) ...................................................................................................................117

Display Totals for Only Some Facts ................................................................................................119

Display Correct Totals for Computed Items ..................................................................................120

Weighted Ranking ............................................................................................................................121

Calculated Spotlighting in the Same Column **............................................................................122

Group Header Rows in a Pivot ** ...................................................................................................124

Fact-based Delta Trends...................................................................................................................126

Dimension-based Delta Trends ........................................................................................................128

Reporting the Break % of the Total................................................................................................129

Profit and Loss Reporting ................................................................................................................131

Preserving custom formatting when drilling ** .............................................................................132

8 REPORT SECTION TIPS...........................................................................134

Barcoded Labels **...........................................................................................................................135

Eliminating Error Messages in Calcs **.........................................................................................137

Maintaining relative position ...........................................................................................................138

Custom group summaries ................................................................................................................139

Group Summary in the Group Header **......................................................................................140

Break Totals in a single Table object ** .........................................................................................141

Cume in a Report * ...........................................................................................................................142

Pivot Cumes across Report Groups *..............................................................................................143

Formatted Totals (Simple) * ............................................................................................................145

Page 8: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

Formatted Totals (Robust) *............................................................................................................146

Group Spacing in a single Table object **......................................................................................148

Multi-Line Column Reports (using table objects)..........................................................................149

Multi-Line Column Reports (using field objects)...........................................................................150

Multi-Line fields (using JS codes for new line)...............................................................................151

Multi-Line fields (using word wrap formatting) ............................................................................153

Complex Narrative Reports .............................................................................................................154

Conditional Labels ............................................................................................................................155

Full-Row Spotlighting.......................................................................................................................156

Context-Sensitive Charts / Pivots ....................................................................................................159

Pivots from Multiple Queries (System 9) * .....................................................................................160

Pivots from Multiple Queries (Pre-System 9) *..............................................................................161

Displaying multiple charts / pivots on 1 page .................................................................................162

Per-Portion Charts on 1 page ..........................................................................................................163

Chart and Summary Data on 1 page...............................................................................................164

Easy Labels for Free-Form Fields ...................................................................................................165

Custom Display Format for Limits .................................................................................................166

Multi-Line Bar Chart (pre-v9.3)......................................................................................................167

Annotated Chart ...............................................................................................................................169

Grid Report * ....................................................................................................................................171

Page Numbers by Group Report * ..................................................................................................173

Calendar-style Reports.....................................................................................................................175

Page 9: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff • 516 Harry Truman Drive, Largo, MD 20774 • All rights reserved.

9 SCRIPTING TIPS.......................................................................................179

Formatted Export (pre-v8.5) **.......................................................................................................180

User-controlled Range-based analysis **........................................................................................182

Prompt Once for Multiple Queries *...............................................................................................184

Clear All Data Displays on Opening *.............................................................................................186

Zero-Footprint Report Creation *...................................................................................................187

10 DASHBOARD TIPS...............................................................................190

Bar-Line with Multiple Lines (pre-v9.3) **....................................................................................191

“No Data” Display Message ** ........................................................................................................194

Custom Colors (pre-v9.3) * ..............................................................................................................196

Custom Colors (v9.3) * .....................................................................................................................198

Fetching the Windows Username * .................................................................................................199

Tagging Listbox Selections *............................................................................................................200

Double-Click Drill from a Pivot *....................................................................................................201

On-the-Fly Dashboard Creation *...................................................................................................204

Page 10: Hyperion Tips Cookbook 2007

Tips Cookbook for Hyperion Intelligence / Interactive Reporting Solutions 2007

Copyright © 2007, Mark Ostroff Page 1

1 Introduction

These tips are designed to help you get the most out of the analysis features of Hyperion Intelligence and Hyperion System 9 Interactive Reporting (the v9.x equivalent of Hyperion Intelligence). In this “Tips and Tricks” paper, you will find a set of basic concepts, followed by specific tips laid out as a cookbook of individual “recipe” items. I used this cookbook format to let you bounce around and look for specific answers you may need at a given moment.

Over the years, this cookbook has expanded from a small handout of a baker’s dozen tips to this year’s 200+ page book with over 125 specific tips. My best tip ideas come from you, the users of Hyperion Intelligence and Hyperion System 9 Interactive Reporting. As long as you keep asking “how do I…?”, I will be able to continue the expansion of this book.

So, keep asking those questions. They are the fuel to my imagination.

Page 11: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 2

2 Basic Concepts

The idea behind this session is to provide you with more than just a set of working tips. I also hope to impart some of the basic thought processes that went into these tips. That way, you will be able to expand on what is presented here and create your own tips and enhancements.

Be Creatively Lazy

Find ways to let the computer do a lot of the work. Think globally. Think about creating reusable “components”. And think about what is the best processing location for the particular functionality you need to use.

Plan Your Course

Before you start developing pivots, charts or reports themselves, take a step back and think about what you are trying to accomplish. You may change the way you develop your reports entirely once you have gone through this process first.

Why is the way you present data important?

The idea is to provide insight into what is happening within your organization. You want your users to come to correct conclusions about what is happening so they can make quality decisions that have positive outcomes.

An extreme example may help to clarify this point. The date was January 28, 1986 and NASA had to make a crucial decision – whether to launch the shuttle Challenger. The predicted launch temperature was between 26° to 29° F. NASA asked Morton-Thiokol for advice.

The Morton-Thiokol engineers recommended that Challenger should NOT be launched. They even faxed 13 “charts” to NASA to support their recommendation. But they were overruled… with devastating consequences. What happened to their supporting evidence?

That is one of the questions asked by the Presidential Commission on the Space Shuttle Challenger Accident. Edward Tufte, an information design expert and professor at Yale, concluded that poor data presentation was to blame.

Decide for yourself. Here are a few of the “charts” that Morton-Thiokol engineers sent to NASA. (All information listed on this topic is public information from the Presidential Commission on the Space Shuttle Challenger Accident.)

Page 12: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 3

This was a data presentation created by engineers FOR engineers. Several big problems existed with these “charts”, including:

• “Words on a Wall” – Most people learn primarily by visual information, yet all the engineers supplied were words. They were forcing their audience to work to try to pick out the relevant information.

Page 13: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 4

• “Mixed Messages” – The clearest presentation of the data, the last chart, had conflicting information. They stated that O-ring temperature must be greater than 53°F, but then said that no “blow-by” existed as low as 47°.

As a result, upper management at Morton-Thiokol sent this summary to NASA.

Note the second point listed. “Temperature data not conclusive on predicting primary O-ring blow-by”. In reality, the temperature data told a clear story.

Edward Tufte concluded that a simple change to a graphical presentation of the temperature data would have resulted in a far different decision. See what you think.

Page 14: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 5

Your users’ decisions may not be as critical as this one was, but the health of your organization is indeed at stake. The following areas can be used as an outline of a useful strategy for effective data presentation.

Take the 30,000 Ft. View

Look at your analysis requirements from a business perspective, rather than the initial specifics of the pivot or chart you want to end up with. Business analytics involves gaining business value, not just reproducing existing management reports. Your design planning should take into account why the existing management reports are inadequate, and provide a solution that solves those problems as well as providing the actual reports. Use this opportunity to add value, not just recreate the same paper reports in an electronic form.

Static versus Analytic Reports

Part of the difference between older style solutions and a Hyperion solution is the ability to provide live, analytic reports. As such, you might need to look at some of the new capabilities in Hyperion Intelligence that give you more flexibility in this area.

For example, do you want to take advantage of the drill-to-detail and incremental drilling features? Do you want to create a live interactive data dashboard of Key Performance Indicators to replace or enhance the existing management reports? Will the SmartReport facility enable you to use embedded charts or pivots in a Report section to produce something you’ve always wanted to do but couldn’t in other tools? The answers to these types of questions will drastically affect how you develop your charts and pivots.

User Navigation Control

How much control do you want your user to have in navigating through these charts, pivots and reports? You might want to control how users can drill in the chart or pivot. Will they use drill anywhere or a pre-defined drill path? Can they drill into further detail? Do you want to provide double-click incremental drilling in your charts?

If you want to exercise even more control over your users, then you might want to embed these items in a Dashboard or Report section and hide the original charts and pivots altogether. Embedded items need to be designed slightly differently than items that will be directly manipulated by the user.

Do you want to use a Dashboard section to limit the value choices a user can select, or to provide a customized limit interface? You may need to make slight modifications to the way you build your query sections to support that design.

What do you need for the Trip?

Remember you are taking your users on a data journey. Like any good trip, you need to make sure you “pack” everything you’ll need. Once you have figured out the general usage plan for your reports, you need to analyze the specific BQY requirements to produce those results. Several specific areas you should consider are covered here.

Page 15: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 6

Data Requirements

To produce the right charts and pivots, you obviously need the right data to start with. Unfortunately, data sources in the real world don’t always provide the data in the format it is needed. You may need to manipulate the data in some way. This manipulation can be performed in Intelligence itself, but at times may best be performed in the database itself. Other times, you may have several different ways of grabbing the right data and need to analyze the costs and benefits of each approach.

Raw versus “Crafted” Data

One highly overlooked area is the power to manipulate the local data cache that resides in the Results section. Many difficult analysis tasks are eased when you take the raw data and craft it into a more useable form in the Results or Table section.

Creating reusable “components”

You may find yourself creating the same computed items over and over in your pivots, charts and reports. Try creating them once… in the Results or Table section. They are then available throughout the entire BQY document. You can do the same thing in the Query section as well. Creating computed items in the Query section adds the ability to use any of the functions available from your database.

Cross-row comparisons

The set orientation of SQL makes it difficult to build logic that compares information in one row with another. Hyperion’s Next() and Prior() functions provide the ability to create complex logic that depends on comparing data between rows. Combine a computed item using these functions with local sorting of the Results section to create controlled comparisons.

Grouping the data to provide ad-hoc organization

Your database may not be organized in the way you want to analyze it. You may have a large number of discreet values that you would like to break out into a set of ranges instead. Perhaps you only have a date field, but want to perform analysis based on years or quarters. Or perhaps you have years and quarters, but they are calendar based and you want to perform a fiscal year based analysis. All of these data organization problems can be addressed by using combinations of Computed Items, Grouping Columns and Date Groupings in the Results section.

Page 16: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 7

Transforming the data into a more useful form

Sometimes what you get out of your database is not in the most useable form. Data entry can be inconsistent. The data needs to be transformed into a consistent representation of values. You may need to split out what is stored as a single measure into multiple “dimensionalized facts” for the analysis you want to perform. Or you may want to transform a dimension into a measure. Or the values in a dimension may be too long to conveniently fit in a chart or pivot you plan to build. Instead, you’d like to use some kind of short-hand value computed from the actual ones. Computed Items using If-Then-Else logic can address these issues.

Preparing for expanding the data’s use

For example, say you want to create a Pivot with a count of the number of transactions for each item. You could drop the Customer_ID field into the data items area in the Pivot Outliner, right-click on the column and change the data function to be Count. Now, you want to add the dollar amounts and then expand the use of the Customer_ID count to calculate the average per transaction. In building the formula for the average, the Pivot will revert to the default data function of summing the Customer_ID as if it were a number to be added instead of an ID to be counted. This will not yield the correct average.

Back up a step to the Results section instead. Use a computed item to “translate” the Customer_ID into a true count. Simply define the formula as a 1. Then you can use this numeric field directly in the pivot to compute the correct number of transactions and as part of the formula to yield the correct average per transaction.

Where to Consolidate

The proper use of Computed Items in the Results or Table section depends on understanding how you want to consolidate your information. If the consolidation is based on the “raw” data, use the power of the Results/Table section.

Sometimes, however, you want to compare one consolidation with another. In these cases, you have several ways to accomplish this. You can use Computed Items that are created at the Chart or Pivot section itself if the comparison is to be used only in that chart or pivot. To create globally useful consolidation comparisons, start in the Results or Table section with Computed Items that summarize at the relevant group levels, then add another Computed Item to calculate the actual comparison. When you add this comparison item to a chart or pivot, change the data function from Sum to something appropriate to eliminate multiple counting.

Local versus Server Processing

People often overlook the power of their database to serve their reporting and analysis purposes. For example, one retailer wanted to graph the number and dollar amount of transactions per department on an hour-by-hour basis. They wanted to use this chart to estimate required staffing levels throughout the day based on actual sales history.

Page 17: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 8

The original query processing and chart generation took over 2 hours. This kind of response was clearly unacceptable. Two factors contributed to the amount of processing time. First, of course, they were fetching every single record of sales data for the given period, amounting to more than 100,000 rows. Then, the BQY report document had to process all those rows on the user’s desktop PC to produce the graphical consolidation that was the desired end result.

As a general rule, anything you do on the Query section is processed at the database server. Actions performed on any other section are executed by Intelligence itself. I showed them how they could speed up the processing by having their database perform the consolidation of the data instead of having Hy;perion do it. They only had to make a minor change to the query.

By default, Intelligence creates a simple Select statement from the Request line in the Query section. You can change this behavior by selecting the value(s) on the Request Line you want to consolidate, right-clicking and selecting the Data Function item from the speed menu which appears.

In this case, I had the retailer select the Sum function. This time, the entire process returned 52 rows and was finished in less than one minute.

Data Presentation Requirements

You also need to look at how you will present the data to your users. Drilling options will determine how you build the data model. Human factors engineering concepts affect which pivot or chart display options you use.

Drilling Requirements

If you want to use certain drilling options, they must be predefined in the data model itself. The ability to use pre-defined drill paths, drill-to-detail and incremental drilling all depend on the data model used by the query. They are not controlled in the individual chart or pivot. The ability to turn off drilling altogether is also found in the data model definition.

Flattening the Chart

Sometimes you can influence the data’s interpretation by the way in which it is presented visually to the user. A basic charting concept to leverage is to realize the visual difference between a 2-D and 3-D graphical presentation. While 3-D mode is the default for Intelligence charts, certain analysis tasks can be performed by first creating a 3-D chart, then flattening the chart to 2-D to create a layering effect.

The human mind will interpret the flattened result in a far different manner. You can create inferences about the data in 2-D that aren’t easily seen (if at all) in 3-D. This tips cookbook shows how you can use this difference to create spotlighting in charts and to show portions of the whole in multiple categories at once.

Embedding Requirements

Charts and pivots intended for embedding should be designed differently than items intended for direct manipulation. The unique requirements of each type of embedding need to be accounted for in your design.

Page 18: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 9

Embedding in a Dashboard section

Items to be embedded in a Dashboard section need to use short descriptions to provide meaningful information in a smaller display. Charts should not use auto-sizing, since your EIS item’s size should control the scaling of the chart elements. Users will not be able to change the size of items drilled to in embedded live pivots, so label length is of key importance in these pivots. You may want to use a combination of computed items in your data model along with pre-defined drill paths to keep the display readable.

Embedding in a Report section

Items used for SmartReport embedding in a Report section will probably be designed with exactly the opposite characteristics in mind. Realize that a chart or pivot embedded into a Report will become context-sensitive. It will only display the information that pertains to the report grouping within which the item is embedded. Thus, you will want to create a “global” pivot or chart with many more elements than you would display in a directly displayed item. Don’t worry about what the raw chart or pivot looks like. Design for what it will narrow down to when embedded in your report.

Scripting Requirements

Do you plan to use a Dashboard section to control what gets displayed? If so, you may need to design things a bit differently to support your scripting requirements. For example, it is easy in a chart or pivot to display only the top 5 items. But if you want the user to select how many items will display, you may want to provide a simple EIS screen to automate the process. To pull this off, you will need to create a Table section and build your chart or pivot off that Table section.

Why do you need a Table section? To code how many items get displayed, you need to be able to set a limit on the Rank. However, Intelligence doesn’t let you create a limit on a column based on an aggregate function. The Table section let’s you convert that aggregate column into a plain numeric one. Thus, the Table section will be required to create a limit on the rank. It’s the only way to provide programmatic control of how many of the top items get displayed.

Prepare Your Data

As was mentioned before, you will probably need to craft your data in some way before building your charts and pivots. You need to select which data crafting operations you will perform in which of three possible section types – the Query section, the Results section and (occasionally) one or more Table sections. Each type of section is appropriate for performing different types of data crafting tasks.

Page 19: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 10

The Query Section

The query section is where you create the basis for all drilling options. It is also the place where you should create your first level of aggregation of the data for summary analysis charts and pivots. Having the database perform much of the data aggregation will improve performance greatly. Server-based computed items are also defined here, as is special data retrieval query logic.

The Results Section

This is the section where you create your global items. Anything that you want to use in multiple sections should be created either here or in the query section that feeds it. These global items fall into several categories:

• Default Labels The column labels that appear in the Results section will be the default labels for all charts, pivots and reports built from this data. You can set these global default labels in either the Query or Results section.

• Default Formats Like column labels, the display format used in the Results section will be the default formatting for all charts, pivots and reports built from this data. These global default formats can only be set in the Results section.

• Global Computed Items Computed Items that need to appear in more than one section should be defined here in the Results section.

• Global Comparisons Like global computed items, comparisons that need to apply across multiple sections should be defined once in the Results section.

• Global Groupings Groupings that apply across multiple sections are just like other global items. They should be defined in the Results section.

• Global Transformations Global data transformations are a special type of Computed Item. The same rules apply for global transformations.

Table Sections

The Results section is actually a special, global type of Table section. The new Table section provides a way to built items that are less global than ones built within the Results section. It can also be used as a data staging area to enable various functions not possible before.

Semi-Global Items

A Table section can be used to create semi-global items using the same techniques used in the Results section to create global items. Items created in a Table section will only apply to those sections built from that Table section. In general, sections built using a Table section are isolated from certain changes that occur in the Results section that feeds the Table section.

Page 20: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 11

Data Staging

The Table section can be useful in those cases where you need to stage the data for a particular use. For example, you may want to limit which items a user can drill to but still want to allow Drill Anywhere to work. You can build your chart or pivot based on a Table section that only contains those columns you want the user to access. You also might need to create certain complex calculations in stages. Table sections built from other table Sections can be the answer.

Top N / Bottom N Analysis

Allowing users to easily select how many items to display usually involves creating a limit. However, Hyperion Intelligence will not allow a limit to be created on a Computed Item based on an aggregate calculation. Rank and Sum are such aggregate calculations. Enter the Table section. When a Computed Item column is added to a Table section, it is converted to the actual value derived from the computation. Since it is now a simple numeric value, a limit can now be applied to the Rank or Sum value in the Table section.

Report Section Refresh Control

To reduce the size of BQY files that contain multiple reports, the Report section is designed to work off the Results or Table sections. However, since they do not carry their own data cache, Report sections do not offer any Refresh Control options. You can create a version of this feature by using a Table section as the basis for your Report. You then create a dummy limit on the Table section to artificially start with zero rows in the display. When you want to refresh the Report section, simply set the dummy limit to “Ignore” (either manually or in JavaScript code).

Specific Design Considerations

When you finally get around to designing your charts, pivots and reports, these particular considerations should be foremost in your mind. They will help guide your design decisions.

Design Considerations for Charts

Available design choices for chart sections include the following:

• Global vs. Local Computed Items Think about the best place to create Computed Items before starting the Chart design. Remember that items computed locally in the Chart section only have available to them those fields that have been added to the Chart Outliner. Globally computed items can even include database server fields that are not included in the query itself (by using server-based computed items).

• Starting “raw” vs. starting with a Pivot Some charts may be easier to create by starting with a pivot and then selecting the “Chart this Pivot” menu item from the Insert menu.

Page 21: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 12

• 2-D vs. 3-D Weigh the different effects each chart type has on the interpretation of the data.

• Direct use vs. Embedded use Remember that charts destined for embedding should be designed with that purpose in mind. If you need two similar charts, one for embedding and one for direct use, create one chart, then duplicate it.

Design Considerations for Pivots

Design choices for pivot sections include the following:

• Global vs. Local Computed Items The same issues that pertain to computed items for charts apply to pivot sections as well.

• Starting “raw” vs. starting with a Chart Like pivots, starting with another section can be an easy way to create charts. In addition to making the creation of charts easier, it also allows for the creation of multiple “views” on the same data. This facilitates a broader range of data interpretation possibilities.

• Using base values vs. using Surface values By default, a pivot section reaches back to the Results or Tables section from which it was created for all computations. This can sometimes create what may look like strange values for certain computations.

For example, if you add the same fact a second time, you can right-click on the duplicate column and change the data function from “Sum” (the default) to something else, like “Max”. By default, the pivot will reach back to the original data rows and display the maximum single row value. This may not be what you wanted displayed. If you instead wanted to display the maximum sum as displayed on the pivot section itself, you will need to switch the pivot to “Use Surface Values” mode. Aggregate calculations will then look at the summarized data as it appears in the pivot section to perform the calculations.

• Direct use vs. Embedded use The same considerations that apply to charts apply to pivots as well.

Design Considerations for Reports

Use your imagination to think beyond simple reports. Available design choices for report sections include the following:

• Table vs. Free-form reporting Different design techniques are used to create these two fundamentally different report styles.

• Global vs. Local Computed Items In addition to the considerations mentioned for chart and pivot sections, report sections add a wrinkle all their own. If you click on a data field in a report and look in the Expression bar, you will see that all items in the report section are actually short embedded JavaScript routines.

Page 22: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 13

This provides report designers a huge amount of power, but it means that computed items defined in the report section will require a different syntax than globally computed items that reside in the Query, Results or Table sections. You will want to weigh the relative merits of simplicity versus power when deciding where to define computed items to be used in report sections.

• Creating tables from scratch vs. Embedding a Table section One easy way to create table-oriented reports with easily created computed items is to embed an existing Table section instead of designing a table object via the report section Outliner.

• Single Column vs. Multiple Columns The new report section supports creation of multi-column reports.

• Headers & Footers for Reports, Pages, Groups and Sub-Groups Remember that only headers for Groups and Sub-Groups are created automatically. You will need to specify all other headers and footers if you want to use them.

• Using the full power of the SmartReports feature

The SmartReports feature can do a whole lot more than embed charts and pivots into a report. Let your imagination run wild with the possibilities. Some ideas include:

o Printing multiple charts and pivots on 1 page

o Creating context-sensitive charts and pivots

o Alternate reporting styles

o Alternate ways to create computations

• Consider using a Dashboard Section as a “power report”

A Dashboard section with embedded charts, pivots and tables can provide an interactive reporting environment where users can select various parameter values to easily change the data view in the “report”.

Locking in the Knowledge

In addition to learning these techniques yourself, you’ll want to implement a plan of action to spread these ideas throughout your entire Hyperion Intelligence user community.

Teach the Thought Process

Most tips result from the application of few simple basic techniques. Help your users understand the logic behind these techniques, not just the specific solutions themselves.

Page 23: Hyperion Tips Cookbook 2007

Basic Concepts Solutions 2007

Copyright © 2007, Mark Ostroff Page 14

Take a Step Back

Help them focus on the basic design process first. For example, you want to get them thinking about crafting their data in the Query or Results sections before they try to build their charts or pivots. You also want them thinking beyond simple chart and pivot design and into how others could use these sections better.

1 + 1 > 2 (or, “The whole is greater than the sum of the parts”)

Help your users to realize that by focusing on basic techniques above specific point solutions, they will be able to go beyond those specific solutions the next time they need to design something. These basic techniques allow your designers to go far beyond any specific solution. By adding them together, they can produce documents with far greater power and usefulness.

Deploy the Techniques

Create some kind of automated mechanism to “get the word out” to your users. You could create an internal technology newsletter in either hard copy or electronic form. Internal web-based news groups and named email distribution lists are also effective ways to deploy the information in this session.

A more personal way of sharing information, as well as getting people more involved, is to form an internal users group. You could use the material in these session notes as the basis for your first one or two meetings. As the group grows in size, each meeting could have a section devoted to sharing new tips and ideas.

Solicit Additional Tips

Make sure you set up a way to keep feeding your knowledge base with new tip ideas. Get creative with incentives to reward useful tips. Have various users submit topic ideas for your next users group meeting.

Build in Regular Feedback

Keep the loop going. Present any tips sent in to the rest of the user community through the deployment mechanisms you have created.

And now, on to the tips recipes…

Page 24: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 15

3 Query Section Tips

The following tips are applied primarily within the Query section. The areas affected include the Request line as well as the data model design itself.

Page 25: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 16

Limiting a Show Values List

Purpose / Use: To provide users with what appears to be a wide-open ability to limit a

query, when the list of values is actually pre-limited before the user even

starts.

Sample File: Limiting a show values.bqy

Steps to Produce: To create pre-limited fields, you will build a query’s data model, and

then promote it to a read-only locked Master Data Model. You will then

apply any required “pre-limits” to the Master Data Model.

1) Build a regular data model as you normally would.

2) Promote the query’s data model to be a Master DataModel by using the DataModel |

Promote to Master DataModel menu selection.

3) In the Master DataModel section, add one or more limits to the Master design. In this

example, we created a limit where Region = Americas.

4) Any query built using this Master DataModel will inherit the limits already set, without

being able to change them or even see them.

NOTE: To keep the Master DataModel locked for web users, deploy the BQY in “Query and Analyze” mode (not in “DataModel and Analyze” mode).

Page 26: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 17

Creating Global Cascading Show Values Lists

Purpose / Use: To provide users with Show Values lists of values that automatically

limit the choices shown to only values that apply to previously selected

limit values.

Sample File: Cascading show values.bqy

Steps to Produce: To create cascading Show Values lists, you will build a query’s data

model, and then change the limit settings to show the minimum number

of available values.

Version Dependency: Cross-topic cascades require Hyperion Intelligence v8.2.0 or higher.

1) Build a regular data model as you normally would.

2) Add fields to the Limit line as you normally would. The limits can be from different

tables/topics. Right-click on each limit field and turn on the “Variable Limit” option.

3) Use the DataModel | DataModel Options menu, click on the Limits tab and select the

“Show minimum value set” radio button.

This setting automatically adds WHERE clauses based on previous limit selections (even

with fields from different tables) to the Show Values SQL to limit the values lists that are

displayed

NOTE: If Row-Level Security rules have been defined, the Show Values list may be further restricted for web-based users.

Page 27: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 18

Chart / Pivot Labels with Special Characters **

Purpose / Use: To provide labels in Charts or Pivots that contain non-text characters.

Sample File: Labels with Special Characters.bqy

Steps to Produce: The problem is that charts and pivots restrict what characters can be

used to rename an object. The solution is to modify the field name in the

Request Line object of the Query section.

1) Build a regular data model as you normally would.

2) Add fields to the Request line as you normally would.

3) In the Request line, right click on the data field for which you want to include special

characters. Select “Properties…” from the speed menu that appears.

4) In the dialog box that pops up, edit the value in the Name text box to include the desired

label description.

Page 28: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 19

Limit by Sub-Total

Purpose / Use: To provide a query result limited by a summary calculation rather than

just by a simple row value.

Sample File: Limit by sub-total.bqy

Steps to Produce: You build a query with a server-based summary computation, then drag

that computed item from the Request Line into the Limit line.

1) Build a regular data model as you normally would.

2) Add fields to the Request line as you normally would, including the data field upon

which you want to create the summary test.

3) In the Request line, right click on the data field for the test and change the data function

to be an appropriate summary operation (based on the type of test you want to use). In

this example, we select the Sum data function because we want to limit by sub-total.

4) Drag the summary field from the Request line into the Limit line. Set up the limit criteria

like any other normal limit.

This will create a SQL HAVING clause in the resulting query that gets sent to the

database server. The query will only return rows for the groups in the other fields where

the total for the group matches the limit criteria.

Page 29: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 20

Joining Data with Different Levels of Detail **

Purpose / Use: To join data from two different queries that are at different levels of

detail, while also preserving the detail data for other displays.

Sample File: Merging data with different granularities.bqy

Steps to Produce: A problem can exist when you have data and displays at different levels

of detail. For example, how do you chart both daily revenue trends and

monthly ad spends versus revenue when the revenue data is at a daily

level but the ad expenses are only tracked at the monthly level? Creative

use of queries and table sections are the key.

1) Build a regular query for the more detailed data (daily revenue in this example), sort on

the Date field and process it.

2) In the Results section, add the following Computed Item columns to provide summary

month-level aggregation of the detailed data:

Computed Item Name Formula

Monthly Revenue Sum ( Revenue, [Month_Number, Year] )

New if ( (Year != Prior(Year)) ||

( Month_Number != Prior(Month_Number)) ) {

1

} else {

0

}

The “Monthly Revenue” field needs to group the data by both month and year. The

Sum() method normally only allows for grouping on a single field. However, you can

supply an array of field names to create grouping on a combination of fields. Arrays are

defined using the square brackets.

Page 30: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 21

(Joining Data with Different Levels of Detail continued)

The “New” field will be used as a marker to provide a method for eliminating multiple

counts of the monthly summary data.

3) Insert a new Table section named Revenue Summary and add all the fields from the

Results, including the “Monthly Revenue” and “New” fields. (You may want to not use

the regular “Revenue” field for this summary table.)

4) In the Revenue Summary table, add a filter on the “New” field where the value equals a

1. This will set the table to display only one row per month, properly aggregating the

detail revenue data to the monthly level.

5) Build a second query for the less detailed data (monthly ad spend in this case).

6) In the lower portion of the section catalog, right-click and turn on the “Local Results”

option. Your list of tables should now look something like this:

7) Drag out the Revenue Summary local table onto the data model design. Join it to the rest

of the “normal” data model on the appropriate fields (in this case, Year and Month

Number).

8) Add the Monthly Revenue field from Revenue Summary to the Request Line of the

Query

9) Process the query and build your combined Ad Spend vs Revenue chart as you normally

would.

Page 31: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 22

Creating Read-Only Computed Items

Purpose / Use: To provide users with standard computed items that they can use but

not modify. This insures that all users have common computational

definitions.

Sample File: Read-only computed items.bqy

Steps to Produce: To create read-only computations, you will build one or more computed

items pre-defined in the query’s data model, and then promote the

query’s data model to a read-only locked Master Data Model.

1) Build a regular data model as you normally would.

2) Right-click on each topic in the title bar and promote it to be a meta-topic. (Computed

items in a data model can only be added to a meta-topic.)

3) Rename each meta-topic (if desired) by double-clicking on the meta-topic’s title bar and

changing the Topic Name property.

4) Select the meta-topic to which you want to add the computed items, then use the

DataModel | Add Meta Topic Item menu selection to define the new computed item(s).

Page 32: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 23

(Creating Read-Only Computed Items continued)

As shown in the previous screen shot, meta-topic computed items can be either server-

based or locally computed. Server items are based on what can be computed via SQL, and

are computed at the database server. Local items can use the full power of Hyperion

Intelligence’s JavaScript interpreter, but require all items in the computation to be included

on the Request Line. If a required field is not already present on the Request Line, adding

the local computed item to the Request Line will automatically add all fields needed by the

computation.

NOTE: To define a local meta-topic computed item, all columns referenced by the computed item’s formula must be present in the same meta-topic as the computed item. You can drag any fields needed from other tables into the meta-topic to support multi-table computed items. You may want to then hide that field from the topic in which it normally resides.

5) Once all computed items are defined, use the DataModel | DataModel View | Meta menu

selection to set the display to show only the meta-topics.

6) To make the items read-only, promote the query’s data model to be a Master DataModel by

using the DataModel | Promote to Master DataModel menu selection.

NOTE: To keep the Master DataModel locked for web users, deploy the BQY in “Query and Analyze” mode (not in “DataModel and Analyze” mode).

Page 33: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 24

Date-Stamping a Query

Purpose / Use: To provide information in reports that allow users to know when the

data was fetched from the database, rather than when the report is

viewed or printed.

Sample File: Date stamping.bqy

Steps to Produce: Add a server-based Computed Item to the query that adds the system

date and time to the columns added to the Results set.

1) Build a data model and query as you normally would.

2) Right-click on the Request Line of the query, and select “Add Computed Item” from the

speed menu.

3) Name the Computed Item “As Of” in the Name field in the dialog box that appears.

4) Click on the Functions… button in the dialog box. Select “Date Functions” from the

Function Categories column, and then select the appropriate date/time function for your

database connection.

5) To use the “As Of” field, simply drag it into the desired Chart, Pivot or Report area.

Page 34: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 25

“What’s Not” Query

Purpose / Use: To find out from the database what did not happen.

Sample File: Not sold.bqy

Steps to Produce: Add a limit based on a “not in” sub-query select.

1) Build a data model that includes one or more tables that would normally contain the absent

information.

2) Add a limit on the primary key join field by either double-clicking on the field, or dragging

it into the Limit Line.

3) In the Limit dialog box, click on the “Custom SQL” button.

4) Enter the SQL for a “not in” query that tells the database to fetch data from the primary

table where the linking field does not appear in the subordinate table. For example:

Products.Product_Id not in (select product_id from sales_fact)

You can even add a limiting WHERE clause to the not-in sub-select to constrain the results

further.

Page 35: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 26

Variable Limit “What’s Not” Query *

Purpose / Use: To find out from the database what did not happen.

Sample File: Not In Subquery.bqy

Steps to Produce: Add a limit based on a visually defined “not in” sub-query.

1) Build a data model that includes one or more tables that would normally contain the

absent information. Build your query based on fields from these tables.

2) Add tables to the data model for the testing condition. Do NOT join these tables to the

others in the data model. Your data model should look something like this:

3) Using the query portion of your data model, add a limit on a field that also appears in the

Test Condition portion of the query. In this example, we will use the Store Key field.

Drag the Store Key field from the Store Description table to the Limit line.

4) Since this is a “What’s Not” limit, turn ON the “Not” checkbox to the left of the

“=Equals” operator. Do NOT close the limit dialog box yet.

Query

portion of

Data Model

Test Condition

portion of Data

Model

Page 36: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 27

(Variable Limit “What’s Not” Query continued)

5) Click on the “Advanced” button in the lower right. This expands the dialog box as shown

below. Click on the “Create Subquery…” button.

A SubQuery section will be created under your Query section, using the same data

model as the query. (This is why the test condition tables needed to be added to the

query section’s data model.)

The goal of the subquery is to provide a list of Store Keys to the limit which match the

desired selection criteria. In this example, we want a subquery that gives us a list of Store

Keys for store that DO have sales after the target date. The Not Equals operator of the

main query’s limit will then give us all the stores NOT in that list.

6) The Request line of the subquery must match the item used for the limit of the main

query, so drag the Store Key field from the Sales Figures table to the Request line of the

subquery.

7) We now want to add a target date as a variable limit. Drag the Date field from the Day

Dimension table into the Limit line of the subquery. In the pulldown, change the limit

operator to “> Greater than”. Enter a date of 02/01/02, then click OK.

8) Right-click on the Date field in the subquery’s Limit line and select “Variable Limit” from

the speed menu.

9) Select the Query section from the section catalog and hit the Process button in the toolbar.

You will be prompted to select a target date, and then will get a Results section listing of

all stores with no sales after that date.

Page 37: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 28

Displaying Query Status

Purpose / Use: To let the user know what the query’s running status is.

Sample File: Query Status.bqy

Steps to Produce: Add a graphic “processing” dialog to the dashboard and an Alert in the

OnPostProcess event.

1) Temporarily, create a command button with the following code:

Application.Alert("Your query is processing. Please stand by...",

"Query Status")

2) Switch to Run mode and click on the button and hit Alt-PrintScreen to copy the dialog box

to the Windows clipboard. Return to Design mode and delete the command button.

3) Hit Ctrl-V to paste a bitmap of the dialog box onto your dashboard. Name it picQSP and

set its Visible property to false.

4) Create a command button to process the query with the following code:

picQSP.Visible = true

ActiveDocument.Sections["Query"].Process()

5) Add the following code to your OnPostProcess document script:

ActiveDocument.Sections["Sample

Dashboard"].Shapes["picQSP"].Visible = false

Page 38: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 29

Application.Alert("Your query has completed.\n","Query Status")

Page 39: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 30

Controlling the Drill Path

Purpose / Use: Sometimes you want to only show certain fields in a drill path, especially

when some fields are only used to build computed items and you don’t

want them included in drilling or even visible to users. In addition, you

may not want to use a Table section, since this would duplicate data.

Sample File: Drill path control.bqy

Steps to Produce: Add simple JavaScript code to the OnPostProcess and OnPreProcess

document events to remove the undesired fields from the Results section

after the query has processed and all computed items have been

calculated.

Version Dependency: Requires Hyperion Intelligence v6.5.0 or higher.

1) Build a data model and query as you normally would.

2) Use the File | Document Scripts… menu selection to enter the script editor for the BQY

document.

3) Select the OnPostProcess event from the pulldown menu at the top.

4) Enter code to remove the fields you want to hide from the Results section after the query

finishes processing. For example:

// Eliminate fields from the drill path

ActiveDocument.Sections["Results"].Columns["State"].Remove()

ActiveDocument.Sections["Results"].Columns["Date Ordered"].Remove()

5) Now select the OnPreProcess event and enter code to put the fields back into the Results

section just before processing the query. That way, any dependent computed items will be

properly refreshed. The corresponding code for the current example would be:

// Add the "hidden" fields so computed items can be recalced

ActiveDocument.Sections["Results"].Columns.Add("Date Ordered")

ActiveDocument.Sections["Results"].Columns.Add("State")

Page 40: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 31

Incremental Drilling

Purpose / Use: To allow users to drill to further detail without needing to fetch all

information into the original document beforehand. Using incremental

drilling provides a fast and efficient way to provide drilling while

avoiding the creation monster BQY files.

Sample File: Incremental drilling.bqy

Steps to Produce: To create incremental drilling, you will use a combination of a pre-

defined drill path plus the drill-to-detail feature. This combination will

tell Hyperion Intelligence to automatically drill into detail information

that is not currently contained in the query.

1) Build a data model with a single Meta Topic. Once created, set the data model view to

show only the Meta Topic (use DataModel | DataModel View | Meta in the menu system).

2) Double-click on the title bar of the meta topic to display the Topic Properties dialog. Use

the “Up” and “Down” buttons to put the topic items in the order in which you want your

user to drill. Then, turn on the “Set as Dimension” checkbox. This defines the order of

items in the meta topic as the pre-defined drill path.

Page 41: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 32

(Creating Incremental Drilling continued)

3) To remove a topic item from the drill path (such as items that are facts, not dimensions),

click on the topic item. Right-click on the item and select “Properties” from the speed

menu. Turn on the “Set as Fact” checkbox.

4) In the menu system, select DataModel | DataModel Options to display the Data Model

Options dialog. On the General tab, turn on the “Drill to Detail” checkbox.

5) Create your top-level chart as usual. When a user double-clicks on a bar in the chart,

Hyperion Intelligence will ask if the user wants to add the missing dimension to the query,

and then if the user will allow it to copy the query and chart definition to new sections to

preserve the original. Answer “yes” to both questions. (You can avoid the dialog box

questions in the future by checking the “Don’t show this warning again” checkbox in the

dialogs the first time.)

6) Hyperion Intelligence will copy the query and chart sections, but with a new dimension on

the query’s Request line and a new limit based on the bar the user double-clicked on. Now,

keep double-clicking on a target bar and Hyperion Intelligence will continue to add new

dimensions and limits, and then automatically re-process the query as needed to perform

the drilling.

Page 42: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 33

Partial Importing of Excel data **

Purpose / Use: To allow users to import only part of an Excel worksheet and to ignore

other portions.

Sample File: Partial Import of Excel.bqy

Steps to Produce: Use a named range in Excel to provide a defined data region for a Query

section.

1) In Excel, highlight the range of cells you want to import into the Query. In the cell

reference edit box in the upper left, type in a name for this cell range (see example

below). Save the XLS file and exit Excel.

Page 43: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 34

(Partial Importing of Excel Data continued)

2) In the Windows Control Panel, select Administrative Tools | Data Sources (ODBC).

Define a new System DSN, using the Microsoft Excel Driver. Define the ODBC DSN as

shown below, using the “Select Workbook” button to point to your Excel file.

3) Create an OCE named “Partial Import” that uses an ODBC/ODBC connection and selects

the “Partial Import” ODBC DSN you just created.

4) Create a new Query and select the Partial Import.OCE file you just created. In the Query

catalog, you should see the named range appear as a “table” that can be used to build a

query.

Page 44: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 35

Folder-Based Data Models

Purpose / Use: To provide users with a folder-based display of dimensions and facts to

choose from in building a query.

Sample File: Folder data model.bqy

Steps to Produce: To create a folder-based data model, you will use a combination of

creating meta topics and a little visual trick.

1) Build a data model with a Meta Topic for each folder you want to create. Once created, set

the data model view to show only the Meta Topics (use DataModel | DataModel View |

Meta in the menu system).

2) Drag each Meta Topic down to the bottom of the screen. Scroll down to gain more screen

space and drag the Meta Topics down even further so that they are below the bottom of the

regular screen. Scroll the data model design area back to the top, hiding the Meta Topics off

the bottom of the screen.

3) Promote the data model to be a Master Data Model by using the DataModel | Promote to

Master Data Model menu selection. This will lock your data model into the folder-based

view.

Page 45: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 36

4 OLAPQuery Section Tips

These tips are specifically for when you are querying a multi-dimensional data source, rather than a traditional RDBMS. OLAPQueries look very much like a Pivot section, but the data remains on the OLAP Database Server. Each time you drill, you are actually executing another query.

Since OLAPQueries interact with the database differently than regular queries, you need to think a little bit differently when using them. As a result, these tips actually involve more than just the OLAPQuery section. They center around new ways to use the other sections when you use an OLAPQuery to access data stored in a multi-dimensional database (such as Essbase).

Page 46: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 37

OLAP Bar-Line Chart

Purpose / Use: OLAP data is retrieved in a way that is organized differently than

relational data. The OLAP Query will show data in different columns

that are actually the same “field”. This means you can’t create a chart

design that requires multiple data series (like a Bar-Line chart) without

some local data manipulation first.

Sample File: Bar-Line Solution for MDD.bqy

Steps to Produce: In this example, we will download the OLAPQuery results and use a

series of Computed Items to craft the multiple data series we need.

1) Query the OLAP database to the point where you have the data you want to chart.

2) Download the actual data into a results section by selecting the OLAP | Download to

Results menu item. You will notice that the actual and budget values in the example

appear in a single field, PAYROLL.

3) Create two Computed Items in the OLAPResults to split the values into two columns based

on the Scenario type. Use the formulas shown below.

Page 47: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 38

(OLAP Bar-Line Chart continued)

Computed Item Name Formula

Actual if ( Gen2_Scenario == 'Actual' ) { PAYROLL } else { 0 }

Budget if ( Gen2_Scenario == 'Budget' ) { PAYROLL } else { 0 }

The Results section should now look like this:

4) Insert a new Chart section, and place Gen3,Market in the X-Axis and both the Actual and

Budget columns in the Y-Values. Now change the chart type to Bar-Line.

Page 48: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 39

Suppress Null Rows and Columns

Purpose / Use: An OLAP database can return a number of blank cells (where no data

exists for a particular dimensional intersection). In some cases, entire

rows and columns may be blank. In these situations, a person analyzing

OLAP data only wants to see dimension locations for which data

actually exists. OLAP databases can suppress null rows, but not null

columns. This tip shows how you can eliminate rows and columns that

are completely blank (i.e., no data for any of the items).

Sample File: Olap suppress null rows and columns.bqy

Steps to Produce: We will suppress null rows, then download the OLAPQuery results and

use a filtering Computed Item to eliminate null columns.

1) Processing an OLAPQuery can result in many empty cells, as shown below.

2) Turn on the Suppress Null Rows feature by selecting the OLAP | OLAP Query Options

menu item. Select the DB Specific tab in the dialog box that appears and turn the option on

as shown below.

Now all rows that are completely empty are removed, as shown here.

Page 49: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 40

(Suppress Null Rows and Columns continued)

3) Download the actual data into a results section by selecting the OLAP | Download to

Results menu item. The results in this example look like this, where we can clearly see

which rows are missing values for all the facts.

4) In the OLAPResults section, add a Computed Item named Filter that has a formula that is

just the sum of all the measure columns. In this case, the formula is:

Units + Amount

5) Define a local limit of the Filter column to say that the value is not null. Your limit should

look like this:

6) Now, build a Pivot section that mimics the layout of the OLAPQuery.

Page 50: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 41

5 Results and Table Section Tips

These tips are among the most used; since crafting your data into the form you want it in is a big part of the flexibility and power of Hyperion Intelligence.

Page 51: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 42

“Union All” on Local Results

Purpose / Use: You may need to add the rows of 2 results sets to create the charts, pivots

and reports you need However, a simple join of local results just adds

more columns, not more rows.

Sample File: Merged local results.bqy

Steps to Produce: To add rows, you would normally do a SQL Union operation. To

simulate a Union without having a database server to process, you add a

dummy non-matching column and do an outer join of the results sets.

1) Create and execute each query as you normally would.

2) In each Results section, add a Computed Item named “Join Here”. The formula for the first

query’s “Join Here” should be “a”. The second query’s “Join Here” should use “b” as its

formula.

3) Create a third query, joining the two local results on the “Join Here” fields. Add all fields

from both local results to the Request line. Change the join logic to be an outer join:

4) Processing the local results join query will yield a result set that has blank fields from one

data set or the other in all rows:

Page 52: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 43

(Union All on Local Results continued)

5) For each pair of related fields, create a Computed Item column that tests which field in the

pair has a value and use the value found in the computed item. For example, for the

Store/Store2 pair, create a computed item column named “Stores” with the following

formula:

Nvl ( Store, Store2 )

Repeat the creation of a “null value testing” computed item for each pair of fields.

6) Hide all the original columns, just showing the consolidated computed item fields.

Page 53: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 44

Creating Fiscal Year based information

Purpose / Use: Often, the only date-oriented information in your database is calendar

year based. You can derive Fiscal Year based information with a

combination of Date Groupings and Computed Items.

Sample File: Fiscal Year info.bqy

Steps to Produce: In this example, we will assume that your Fiscal Year starts on April 1.

1) In the Results section, select the date field to be transformed into Fiscal Year information.

Right-click and select Add Date Groups from the speed menu. This action will add three

columns. Select the Year and Quarter columns and delete them. This will leave you with a

derived column that displays the Month name for the date.

2) Add a new Computed Item and call it “Fiscal”. The formula you use will convert the

original date into a date adjusted for the start of the fiscal year. You will want to add the

number of months it would take to adjust the starting date of your fiscal year to be January

1 of the following calendar year. April 1 needs 9 months to be adjusted to January 1, so in

our example we define the formula to be:

AddMonths ( Date_Ordered, 9 )

For fiscal years that have different starts, the following table shows how many months to

add.

Fiscal Year Start Months to Add

April 1 9

July 1 6

October 1 3

3) Select the Fiscal column created in the previous step. Right-click and select Add Date

Groups from the speed menu. Select the Fiscal_Month column and delete it (since it really

doesn’t contain useful information). This action leaves you with Fiscal_Year, Fiscal_Quarter

and the actual Date_Ordered_Month.

Page 54: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 45

(Creating Fiscal Year based information continued)

4) This sequence of steps will produce a Date_Month column that displays the month names

in short (3 letter) form. To display the full month name, right-click on the

Date_Ordered_Month and select Number from the speed menu. In the number format

dialog box that appears, select the Custom category and type in the following format

formula:

“mmmm”

This display format (4 m’s) will show the full month name without displaying the year or

day.

5) To display monthly items in proper fiscal year order, you will also need to create a

Fiscal_Month_Number column. To add a Fiscal_Month_Number column, create a new

Computed Item with that name. Define the formula to be:

Decode(ToChar ( Date_Ordered, "mmm" ), 'Jan',10, 'Feb',11,

'Mar',12, 'Apr',1, 'May',2, 'Jun',3, 'Jul',4, 'Aug',5,

'Sep',6, 'Oct',7, 'Nov',8, 'Dec',9,0)

For fiscal years that start on a date other than April 1, adjust the numbers in the decode

function accordingly.

Page 55: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 46

Custom Sorting of a Chart Legend

Purpose / Use: Sometimes you want a chart legend in a particular logical order instead

of an alphabetical order.

Sample File: Sorted legend.bqy

Steps to Produce: Create a computed item column that ranks the legend labels.

1) In the Results section, select the field upon which the legend will be based. Right-click and

select Add Grouping Column from the speed menu. Name the grouping column to be

“Label Order”.

2) Create a new group “named” as 1 and select the legend label you want to appear first as

the only member of the group.

3) Within the same dialog box, create a numeric order group for each legend label as before.

4) Add the “Label Order” field to the Fact area of your chart. Now use the chart’s sort line to

sort the legend field on the Label Order instead of the Label. Use Maximum and sort in

either descending or ascending order (whichever gives you the desired results).

Page 56: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 47

Sorting Text Months in Calendar Order

Purpose / Use: You may only have a text field for month names in your database. If you

simply place this Month name field in a chart, pivot or report, it will

display in alphabetical order. This tip shows how to get even text-based

month names into calendar order.

Sample File: Date sorting of text month names.bqy

Steps to Produce: Define a date column based on the month name, then use it to create a

date-oriented Month Name field.

1) In the Results section, add a new Computed Item. Call it Cal, and define its formula to be:

ToDate("15-"+Substr ( Month_Name, 1, 3 )+"-1904")

2) Now, right-click on the Cal column and select “Add Date Groups”. This will create three

date-oriented fields: Cal Year, Cal Quarter, and Cal Month.

3) Use these new date fields in your charts, pivots and reports. They will sort in proper

calendar order.

Page 57: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 48

Display Limit Values in Charts

Purpose / Use: For a chart based on a prompted date limit query, you may want the

limit values chosen to appear inside the chart itself.

Sample File: Display pivot limits.bqy

Steps to Produce: Define a text-based Computed Item that can be added as an item in the

chart.

1) In the Results section, add a set of new Computed Items as shown below.

Computed Item Name Formula

Start Date ColMin ( Date )

End Date ColMax ( Date )

Date Limits 'Data is for '+ToChar ( Start_Date, "mm/dd/yy" )+' through

'+ToChar(End_Date, "mm/dd/yy")

2) Build your chart as you normally would, then add the Date Limits column to the Z-Axis.

Since only one unique value exists in this column, that is the label that will be displayed in

your chart.

Page 58: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 49

Display Limit Values in Pivots

Purpose / Use: For a pivot based on a prompted date limit query, you may want the

limit values chosen to appear inside the pivot itself.

Sample File: Display pivot limits.bqy

Steps to Produce: Define a text-based Computed Item that can be added as an item in the

chart.

1) In the Results section, add a set of new Computed Items as shown below.

Computed Item Name Formula

Start Date ColMin ( Date )

End Date ColMax ( Date )

Date Limits 'Data is for '+ToChar ( Start_Date, "mm/dd/yy" )+' through

'+ToChar(End_Date, "mm/dd/yy")

2) Build your pivot as you normally would, then add the Date Limits column as the top-most

Top Label. Since only one unique value exists in this column, that is the label that will be

displayed in your pivot.

Page 59: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 50

OR Limits in Local Results *

Purpose / Use: You may need to apply a local limit that uses a logical OR between 2

columns. But only the query section provides the ability to change the

logic between multiple column limits from an AND to an OR.

Sample File: OR Limit in Local Results.bqy

Steps to Produce: Define a Computed Item column that uses the desired OR logic to

calculate a value of 1 or zero. Then create your local limit filter on that

Computed Item column.

1) Add a table section and include all the columns from the original Results section

2) In the Table section, add a set of new Computed Items as shown below.

Computed Item Name Formula

Big Sales 10000

Big Units 1000

Big Sale OR Limit if ( (Amount_Sold >= Big_Sales) ||

(Units_Sold >= Big_Units) ) {

1

} else {

0

}

The computed item columns Big_Sales and Big_Units allow you to create a dashboard that

lets users change the definition of what a large sale is on-the-fly without having to deal

with the logic of the OR condition directly.

3) Create a local limit on “Big Sale OR Limit” where the value is equal to 1.

Page 60: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 51

Parsing Names

Purpose / Use: You may only have a text field that holds an entire name, with elements

separated by a comma. Use this tip to split Last Name, First Name and

Middle Initial into separate fields.

Sample File: Name solution.bqy

Steps to Produce: Define a series of Computed Items that use the Substr() and Instr()

function to determine where to split the field.

1) In the Results section, add a set of new Computed Items as shown below.

Computed Item Name Formula

F_Name Substr ( Full_Name, Instr ( Full_Name, ' ', 1, 1 ) +1, ( Instr (

Full_Name, ' ', 1, 2 ) - Instr ( Full_Name, ' ', 1, 1 ) ) )

MI Substr ( Full_Name, Instr ( Full_Name, ' ', 1, 2 ) + 1, ( Length (

Full_Name ) - Instr ( Full_Name, ' ', 1, 2 ) ) )

L_Name Substr ( Full_Name, 1, Instr ( Full_Name, ' ', 1, 1 ) - 2 )

Page 61: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 52

Padding numbers to a fixed length **

Purpose / Use: You may only have a numeric field but need to display it as padded to a

fixed length with a certain default character, such as a zero.

Sample File: Padded bill of lading.bqy

Steps to Produce: Define a Computed Item that uses concatenation plus the Substr()

function to provide the variable padding needed to properly set the

resulting field to a fixed length. In this example, we need a Bill of Lading

Number with a fixed length of 30 characters, right padded with zeros.

1) In the Results section, add a new Computed Item named “Padded” with the formula

defined as shown below.

Substr ( BOL_Number+"000000000000000000000000000000", 1, 30 )

This formula combines the original field with a set of 30 zeros. In other words, add the

same number of padding characters as the desired field length. Then we use the Substr()

method to select only the first 30 characters of the combined string.

2) If you need to left pad instead of right pad, the formula would be:

Substr ("000000000000000000000000000000"+BOL_Number,

Length(BOL_Number), 30 )

This would yield the following results if used to define a column named “Left Pad”:

Page 62: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 53

Creating Range-based analysis

Purpose / Use: You may want to convert a measure with many discrete values into a

derived measure that groups these items into a set of value ranges.

For fields with many discrete values, creating a Hyperion Intelligence

Grouping Column is often not appropriate. Grouping columns are

unwieldy to deal with when a large list of values is present, and are

defined in such as way that they can only handle a single contingency

group for values not present at definition time. A better solution exists

using a Computed Item with complex If-Then-Else logic defined.

Sample File: Results ranges.bqy

Steps to Produce: In this example, we want to define a column that displays in which

member in a range of values the revenue size of each order falls. We then

want to see how many orders fall into each size range.

1) In the Results section, add a new Computed Item. Call it Order_Size, and define its formula

to be:

if (Revenue <= 1000) {'$ 0 to $1000'} else {

if (Revenue <= 2000) {'$1001 to $2000'} else {

if (Revenue <= 3000) {'$2001 to $3000'} else {

if (Revenue <= 4000) {'$3001 to $4000'} else {

if (Revenue <= 5000) {'$4001 to $5000'} else {

'Greater than $5000' } } } } }

2) Add another Computed Item. Call it Order_Count and define its formula to be 1.

3) Use the Order_Size field as a label and the Order_Count field as a measure in your Pivots,

Charts and Reports.

Page 63: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 54

Creating Range-based analysis without ELSE **

Purpose / Use: You may want to create value ranges like in the previous tip, but in an

easier to use syntax that lends itself easily to copy-n-paste duplication.

Sample File: Variable ranges.bqy

Steps to Produce: In this example, we want to define a column that displays in which

member in a range of values the revenue size of each order falls. We then

want to see how many orders fall into each size range.

1) In the Results section, add a new Computed Item. Call it Order_Size, and define its

formula to be:

x = Revenue ;

'Greater than $5000' ;

if (x <= 5000) {'$4001 to $5000'} ;

2) Next, highlight the last line, copy it to the clipboard with Ctrl-C and paste it in with Ctrl-

V. Edit the new line so that it references the next range. Repeat this process until your

formula looks like this:

x = Revenue ;

'Greater than $5000' ;

if (x <= 5000) {'$4001 to $5000'} ;

if (x <= 4000) {'$3001 to $4000'} ;

if (x <= 3000) {'$2001 to $3000'} ;

if (x <= 2000) {'$1001 to $2000'} ;

if (x <= 1000) {'$ 0 to $1000'} ;

The key to this formula working is two-fold. First, the ranges must be defined in

descending order so that the proper value is displayed in a kind of “the last one in wins”

logic. Secondly, the syntax requires that every line be terminated with a semi-colon for

this logic to work.

3) Add another Computed Item. Call it Order_Count and define its formula to be 1.

4) Use the Order_Size field as a label and the Order_Count field as a measure in your

Pivots, Charts and Reports.

Page 64: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 55

Creating multi-contingency grouping / ranges

Purpose / Use: Sometimes, you don’t necessarily have all the possible values to be

grouped at design time. And in many cases you need more contingency

options than the single contingency that the regular Grouping Column

feature provides.

Sample File: Not available to the public

Steps to Produce: In this example, we want to bracket our range values. We want to plan

for items that either fall off the bottom of the list (i.e., smaller than we

want to analyze) or else fall off the top of the list (i.e., larger than we

want to deal with separately).

We will be looking to group budget expenditures into multi-year

Program Cycles. We aren’t interested in separating out the Program

Cycles for any items earlier than 1967, or later than 2009.

We also want to have ranges that are different sizes to handle historical

changes in the way these values were analyzed. Prior to 1997, program

cycles were 5 years long. From 1997 onward, the organization converted

to 3-year program cycles.

Page 65: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 56

(Multi-contingency Grouping Columns continued)

1) In the Results section, add a new Computed Item. Call it Program Cycle, and define its

formula as follows:

if (Budget_Year <= '1966') { 'Old Cycle'

} else {

if (Budget_Year <= '1971') { '1967-1971'

} else {

if (Budget_Year <= '1976') { '1972-1976'

} else {

if (Budget_Year <= '1981') { '1977-1981'

} else {

if (Budget_Year <= '1986') { '1982-1986'

} else {

if (Budget_Year <= '1991') { '1987-1991'

} else {

if (Budget_Year <= '1996') { '1992-1996'

} else {

if (Budget_Year <= '2000') { '1997-2000'

} else {

if (Budget_Year <= '2003') { '2001-2003'

} else {

if (Budget_Year <= '2006') { '2004-2006'

} else {

if (Budget_Year <= '2009') { '2007-2009'

} else {

'Future Cycle' } } } } } } } } } } }

Note that the first and last entries in this formula create the ceiling and floor

contingencies. You can create more complex contingency scenarios by using multiple

measures in the nested If-Then-Else logic.

2) Use this new column as a dimension label for your Pivots, Charts and Reports.

Page 66: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 57

Dimensionalized Facts **

Purpose / Use: Some data sets have all fact values in a single column. This can make

some types of reports difficult to create. For example, you may want to

compare values from different years and calculate a month-by-month

delta. A regular pivot section won’t give you the desired results, unless

you break out the values by year.

Sample File: Dimensionalized facts.bqy

Steps to Produce: To properly display the Year-over-Year comparison, you need to

“dimensionalize” the sales figures into separate columns for each year.

1) Build your query normally, including the sales date field.

2) In the Results section, select the Date field, then right-click and choose “Add Date Groups”.

This will add columns for Date Year, Date Quarter and Date Month.

3) In the Results section, create a Computed Item named “2001 Revenue”. Set the formula for

this computed item to be:

if ( Date_Year == '2001' ) { Revenue } else { null }

4) Create a 2nd Computed Item named “2002 Revenue”. Set the formula for this computed

item to be:

if ( Date_Year == '2002' ) { Revenue } else { null }

5) Build a pivot, using the Date Month field as the side label, and “2001 Revenue” and “2002

Revenue” as the facts.

6) In the pivot, create a Computed Item named “YoY Delta” with the formula:

if ( _002_Revenue != null ) {

( _002_Revenue - _001_Revenue )

} else {

null

}

7) Click the tab at the bottom of the Date Month column and click the summation button to

add totals.

Page 67: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 58

Analyzing “factless” data

Purpose / Use: Some data sets do not have any obvious fact columns. For example,

qualitative data sets are collections of ratings or item types. Hyperion

Intelligence can still be used to analyze these data sets with a simple

concept applied to the Results section.

Sample File: Factless data.bqy

Steps to Produce: To analyze “factless” data, you merely need to create a computed fact

based on the dimensions present.

1) In the Results section, create a Computed Item named “Store Cnt”. Set the formula for this

computed item to be:

1

Yes, create a computation with the simple formula of the number one.

2) Use this new “fact” in any chart, pivot or report to analyze the number of occurrences of

each of the items in your query.

Page 68: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 59

Flattening data **

Purpose / Use: You may have related data stored in multiple rows that you want to

display in a single row of multiple columns instead.

Sample File: Flattened Results.bqy

Steps to Produce: Use the Cume of a counter column to create a top label dimension for a

pivot display.

1) In the Results section, sort the data by Shoe Style, then by Available Colors.

2) In the Results section, create a Computed Item named “Counter”. Set the formula for this

computed item to be:

1

3) In the Results section, create a 2nd Computed Item named “Options”. Set the formula for

this computed item to be:

Cume ( Counter, Shoe_Style )

This will create an incrementing counter that restarts the numbering at each new shoe

style. Your Results section should now look like this:

4) Insert a new pivot section. Place the Shoe Style column in the Side Labels, the Options

column in the Top Labels, and the Available Colors column in the Fact area.

Page 69: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 60

Text Searches

Purpose / Use: Sometimes, users want an easy way to find the records in which they are

interested, based on part of a phrase located somewhere in the field.

Sample File: Text search.bqy

Steps to Produce: To perform a phrase-based search, use an “Is the string here?” computed

item as a search filter..

1) In the Results section, create a Computed Item named “Search Text” for holding what the

user wants to find.

2) On your dashboard, create a “Search” button with the following code:

ActiveDocument.Sections["Table"].Columns.ModifyComputed("Search

Text", " '"+txtSearch.Text+"' ")

3) Create a second Computed Item named Search Hit” to perform the test. Set the formula for

this computed item to be:

Instr ( Street_Address, Search_Text, 1, 1 )

This formula will yield a number greater than zero only if the search text is found

anywhere in the field.

4) Create a limit on the “Search Hit” field where its value is not equal to zero.

5) Hide the “Search Text” and “Search Hit” columns.

Page 70: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 61

Count of Participants #1

Displaying the number of States, not the number of rows in each State, in a Report

Purpose / Use: Dragging the State field into a Report design will display a list of the

unique state names. However, changing the data function to “count” will

display the number of rows within the group, not the number of unique

states in the group.

Sample File: State count solution.bqy

Steps to Produce: In the Results section, sort in the order in which the report groups are

defined plus the item to be counted uniquely. In this example, the report

is grouped by Year, and the item to count uniquely is the State.

Therefore, create a sort line with first Year, then State.

1) Add a Computed Item named “State Cnt” with the following formula:

if ( Prior ( State ) != State ) { 1 } else { 0 }

2) Now, drag the “State Cnt” field into the report design. The proper number of unique states

within the report group will display.

If you want to further format the display, make sure the expression line is displayed and

select the “State Cnt” item in your report. You can then edit the formula expression to add

text and other data elements. In this example, the formula was changed to read as follows:

'Sales Participation for '+currBreak.Value("Year")+' =

'+Tables("Results").Columns("State_Cnt").Sum(currBreak)+'

States'

Page 71: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 62

Count of Participants #2

Counting the number of stores in each state while also calculating the sum of all revenues.

Purpose / Use: Since you are also analyzing a total for each state, you can’t simply create

a query with Count(Distinct Store_Name).

Sample File: State count solution.bqy

Steps to Produce: The secret here is a creative combination of sorting the Results set and

using the Next or Prior function in a computed item.

1) Select the Results section, and sort by State and Store_Name.

2) Create a computed item called Store_Cnt with the following definition:

if ( Prior ( Store_Name) != Store_Name) { 1 }

else { 0 }

The sorting insures that a new Store Name also means a new store to count.

3) Now, build your pivot, using the category field as labels and the dollar amount field and

the new Store_Cnt computed item as the values.

Page 72: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 63

Qualified Sub-Totals #1

Display the sub-total of all transactions over $60K.

Purpose / Use: You want to add up the transaction total within each group, but only for

individual transactions larger than a certain threshold.

Sample File: Sales over 60k subtotal.bqy

Steps to Produce: This solution uses a computed item to separate out the qualifying

transactions.

1) Build your query as normal and process it to fetch some initial data.

2) With the Results section selected, add a new Computed Item named “Over 60k” using the

following formula:

if ( Amount_Sales >= 60000 ) { Amount_Sales } else { 0 }

3) In the event you want a limit that can be easily selected by end users, you can also create a

computed item named “Threshold” and simply enter the threshold value desired. The

“Over 60k” formula would then become:

if ( Amount_Sales >= Threshold ) { Amount_Sales } else { 0 }

4) Add this “Over 60k” computed item column to the appropriate group header in your

report.

5) If using the Threshold column method, add the threshold value to your report by adding

the Threshold field to the report group, right-clicking on it and changing the Data Function

to either Max or Min.

Page 73: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 64

Qualified Sub-Totals #2

Display all contributors that account for the top 40% of revenue within

each group.

Purpose / Use: You don’t want a fixed number of contributors (which would be a TopN

analysis). Instead, you want all the contributors (however many there

are) that account for the top 40% of your total revenue for each group.

Sample File: Prod fam within store type up to 40%.bqy

Steps to Produce: This solution requires two Table sections. One table section to create the

needed summary calculation, then another to convert the summary field

to a regular number upon which a limit can be applied.

1) Build your query as normal and process it to fetch some initial data.

2) With the Results section selected, add a new Computed Item named “Pcnt of Store Type”

using the following formula:

Amount_Sales/Sum(Amount_Sales,Store_Type)

3) Now, insert a new Table section and drag all fields into the Table section design.

4) With the Table section selected, sort the Table on the category field used for the grouping

and then on the percent calculation field. In this example, you would sort on “Store Type”

then on “Pcnt of Store Type”.

5) Add a new Computed Item to the Table section named “Top 40% within Store Type” with

the following formula:

Cume(Pcnt_of_Store_Type,Store_Type)

This calculation, in tandem with the sorting, provides a running sum of the total

contribution so far of each store within the group.

6) With this Table section selected, insert another new Table section and drag all fields except

“Pcnt of Store Type” from the first Table section into this new Table section.

7) Double-click on the “Top 40% within Store Type” column to create a limit. Set the limit to

be less than or equal to 0.4 (the decimal equivalent of 40%).

Page 74: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 65

Qualified Sub-Totals #3

Display the sales of all stores that rank in the top 80% of stores based on

their revenue.

Purpose / Use: You don’t want a fixed number of contributors (which would be a TopN

analysis). Instead, you want 80% of all the contributors, selected by their

revenue ranking. (This is different than asking for those stores that

contributed the top 80% of revenue.) You only want the sales detail for

those stores that qualify.

Sample File: Sales from top 80% customers.bqy

Steps to Produce: This solution requires two query sections. One query section is used to

create the list of the top 80% of stores, then another uses the Store IDs

from the first query as a local join limit to query the sales data from only

those stores.

1) Build a query that only fetches the Store ID, Store Name and total sales for the time period

of interest.

2) Create a Computed Item named “Sales Rank” using a formula of:

Rank ( Amount_Sales )

3) Create a Computed Item named “Top 80 Cutoff” to mark the 80% ranking cut-off point

using a formula of:

ColMax ( Sales_Rank ) * .8

4) Create a Computed Item named “Top 80 Member ?” to mark the target store IDs using a

formula of:

if ( Sales_Rank <= Top_80_Cutoff ) {

true

} else {

false

}

Page 75: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 66

(Qualified Sub-Totals #3 continued)

5) Create a new Table section named Top 80% Members and add the Store Key, Store Name ,

Amount Sales and Top 80 Member? columns.

6) Create a local limit on the Table section where the Top 80 Member? Field = 1.

7) Add a new query section. Design the data model and query as if you were going to query

the sales details for all stores. Do not process the query yet.

8) Right-click in the table area of the Catalog and select Local Results.

9) Add the Top 80% Members table section to the data model. Join it on Store Key to the

Stores table. Double-click on the join line and change the Join Type to be “Limit Local Join”.

Your data model should now look like this:

10) Process this second query and build your reports based on its results.

Page 76: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 67

Custom Sorting with Break Totals *

Purpose / Use: You want to display the data sorted by Month, then Region, but do a

break total on Region within each month. The problem is that the Break

Total function wants to resort the data according to the break column.

Sample File: Custom Sorting a Break Total.bqy

Steps to Produce: This solution uses two computed items columns to create a hidden break

column that follows the desired sort order.

1) Build a query normally, and then sort the Results as desired. In this example, we will sort

by Month, then Region, then Product Line.

2) Create the following Computed Item Columns:

Computed Item Name Formula

NewRegion if (Prior(Region) == Region) { 0 } else { 1 }

RegionCume Cume(NewRegion)

Notice that the values in the RegionCume column follow the grouping of the regions

within each month. You now have a break column whose value changes already match

the desired sorting, so the break total will not change the sorting.

Page 77: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 68

(Custom Sorting with Break Totals continued)

3) Since we want the break totals to appear in the Amount Sold column, right-click in the

“Amount Sold” column and select “Break Total…”. In the dialog box which appears,

make sure you change the “At every break in” column selection to be the RegionCume

column. Set all other options as shown below.

4) Finally, right-click on the NewRegion and RegionCume columns and hide them.

Optionally, you can add custom text to the break total line:

5) Double click on the break total value itself in the "Amount Sold" column. By default, the

dropdown will show "SUM". Select "Other…" from the dropdown. Edit the formula

there so that it will be something like:

'Total for ' + State + ': ' + Sum(Amount_Sold, Breaks)

Page 78: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 69

Median by Sub-Groups **

Purpose / Use: Pivot sections allow you to create Computed Item columns, but the

calculation always refers back to the individual records in the Results

section. For sub-group calculations, you need to create the calculation in

the Results section itself.

Sample File: Median by store and product.bqy

Steps to Produce: This solution requires the creation of a grouped calculation in the Results

section that groups by 2 levels of grouping. The problem is that,

normally, grouping functions like Median() only allow one level of

grouping… or so it seems.

1) Build your query as you normally would.

2) Create a Computed Item named “Median by Store Type and Product Line” using a

formula of:

Median ( Amount_Sold, [ Store_Type, Product_Line ] )

This works because functions that take column names as a grouping definition can also

take a list of column names in a JavaScript array to specify multiple groupings. The

syntax for an array is a comma-separate list enclosed in square brackets (as shown

above).

3) Build your pivot using Store Type and Product Line as the Side Labels, and using

Amount Sold and Median by Store Type and Product Line as the Facts.

Page 79: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 70

Std Dev Chart **

Purpose / Use: You may want to display chart data compared to high and low

“watermarks” based on standard deviation measurements from the

average.

Sample File: Standard deviation.bqy

Steps to Produce: Define a series of Computed Items that use the StdDev() function as a

basis for computing the high and low watermarks, then build a bar-line

chart based on these values.

1) In the Results section, add a set of new Computed Items as shown below.

Computed Item

Name Formula

Avg of Amount Avg ( Amount_Sold )

1 Std Dev of Amount Avg_of_Amount - StdDev ( Amount_Sold )

Multiples of Std Dev 2 (or 1 if you only want to chart based on 1 StdDev)

Top of Normal Avg_of_Amount + (Multiples_of_Std_Dev * __Std_Dev_of_Amount)

Bottom of Normal Avg_of_Amount - (Multiples_of_Std_Dev * __Std_Dev_of_Amount)

<blank> null

<blank><blank> null

2) Insert a new chart section and name it “Std Dev Chart”. Change the Chart Type to be

Bar-Line. Double-Click on the chart and turn off the 3-D Objects property. Add Store

Name to the X-Axis, then add the following fields in the listed order to the Facts:

• Amount Sold

• Bottom of Normal

• <blank>

• Avg of Amount

• <blank><blank>

• Top of Normal

3) Double-click any underlined fact to set all to use the same Y-Axis range.

Page 80: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 71

Good-Bad Chart **

Purpose / Use: You may want to display chart data compared to high and low

“watermarks” based on standard deviation measurements from the

average and display those that fall inside and outside the “normal”

range in different colors.

Sample File: Standard deviation.bqy

Steps to Produce: Use the same technique as the previous Std Dev Chart example, and then

add a few more Computed Items directly in the chart.

1) In the Results section, add the same set of Computed Items as before without the blank

columns.

2) Insert a new chart section and name it “Good-Bad Chart. Do NOT change the chart type

yet.

3) Add Store Name to the X-Axis, then add the following fields in the listed order to the

Facts:

• Bottom of Normal

• Avg of Amount

• Top of Normal

• Amount Sold

4) Right-click on Amount Sold in the Outliner and select “Hidden Item” to hide it.

Page 81: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 72

(Good-Bad Chart continued)

5) From the Main Menu, select Chart | Add Computed Item… and build the following

computed items in the Chart section itself:

Computed Item

Name Formula

Below Par if ( Amount_Sold < Bottom_of_Normal) {

Amount_Sold

} else {

null

}

Meets Expectations if ( Amount_Sold < Bottom_of_Normal ) {

null

} else {

if ( Amount_Sold > Top_of_Normal ) {

null

} else {

Amount_Sold

} }

Top Performers if ( Amount_Sold > Top_of_Normal) {

Amount_Sold

} else {

null

}

6) Drag the fact fields in the Outliner so that they appear in the following order:

• Below Par

• Bottom of Normal

• Meets Expectations

• Avg of Amount

• Top Performers

• Top of Normal

7) Set the legend to be on the Y-Facts. Double-click on the chart and turn off the 3-D objects

option.

8) Change the Chart Type to be Bar-Line. Double-click any underlined facts to set all to use

the same Y-Axis range.

9) Click on each set of bars to set the fill color as desired.

Page 82: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 73

Percent of Region

Purpose / Use: You want to display multiple values as percentages with a group, with

each group adding up to 100%.

Sample File: 100% of region.bqy

Steps to Produce: This solution uses two computed items, one to calculate the group total,

and a second that uses this group total to calculate the individual’s

percent contribution to the group total (rather than the overall total).

1) Build your query as normal and process it to fetch some initial data.

2) With the Results section selected, add a new Computed Item named “Region Total” using

the following formula:

Sum ( Amount_Sold, Region )

The second parameter in the Sum() function tells Hyperion Intelligence to only sum rows

with a value in the Region column equal to the current row’s value. In other words, it

calculates the total for the current group.

3) Add a second computed item named “Percent of Region” using this formula:

Amount_Sold / Region_Total

4) Use the “Percent of Region” column in your chart, pivot and report designs, and then

format it as a percentage.

Page 83: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 74

Charting Missing Data

Purpose / Use: You want to display a complete time series chart, even if data elements

are missing for certain time slots.

Sample File: Charting missing data.bqy

Steps to Produce: This solution uses a series of computed items to insert a zero when no

data exists for a time slot. By this technique, you take a single fact

column and “dimensionalize” it into numerous computed fact columns.

1) Build your query as normal and process it to fetch some initial data.

2) With the Results section selected, add a new Computed Item for each time series item to

test the presence of a value for that time slot. In the example, the time series is monthly, so

we create a computed item for each of the 12 months. The formula for testing the January

values based on the “Date” column would be:

if (ToChar ( Date, "mm" ) == "01") { Amount } else { 0 }

The Results section should look like this when all computed items have been defined:

3) Once all time series computed items have been added, build your chart, pivot or report

using all of the time series computed items.

Page 84: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 75

Hiding columns from a Pivot or Chart

Purpose / Use: In some applications, you need to fetch more columns than you want

users to be able to drill into with Drill Anywhere. Hiding a column in the

Results section doesn’t hide it from the drill path of a pivot or chart.

Sample File: Hiding columns in a pivot.bqy

Steps to Produce: Create a Table section with the items you want users to drill into, then

build your pivot or chart from the Table instead of the Results section.

1) Build your query as normal and process it to fetch some initial data.

2) With the Results section selected, insert a new Table section.

3) Drag into the Table design only those fields you want to use as either part of your initial

charts and pivots, or as items available for drilling.

4) With the Table section selected, insert a new chart or pivot. This sequence ensures that your

chart or pivot will be built based on the Table section, not the base Results section.

Page 85: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 76

Top and Bottom N Analysis

Purpose / Use: You want to create a TopN or BottomN analysis, with the user able to

select what value of N to use on the fly.

Sample File: Top and Bottom N.bqy

Steps to Produce: Allowing users to select the value of N means creating a dynamically

controlled limit. Unfortunately, you can’t create a limit on an aggregated

field such as a Rank or Sum. Using a Table section as the data staging

area allows you to place a limit on the controlling aggregate value.

1) In the Results section, create a Computed Item to determine the ranking. In this example,

we are looking at the revenue ranking by State.

2) For TopN analysis, create a Computed Item named “Revenue Rank” with a formula as

follows:

Rank ( Revenue, State )

3) For BottomN analysis, create a Computed Item named “Reverse Rank” with a formula as

follows:

RankAsc ( Revenue, State )

4) With the Results section selected, insert a new Table section.

5) Drag all regular fields into the Table design. Then add the appropriate ranking column to

the Table (Revenue Rank for a TopN analysis, or Reverse Rank for a BottomN analysis).

6) In the example of a TopN analysis, double-click on the new Table section in the catalog and

rename it to be called “TopN”.

Page 86: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 77

(Top and Bottom N Analysis continued)

7) In the TopN Table section, double-click on the ranking field to add a limit and set its initial

value to be less than or equal to 5.

8) With the Table section selected, insert a new chart or pivot. This sequence ensures that your

chart or pivot will be built based on the Table section, not the base Results section. Build

your chart or pivot as usual.

9) Create a Dashboard section and embed the appropriate charts and pivots that were built

based on the Table section. At a minimum, add a text box control with a script for the

OnChange event similar to the following code:

newN = ActiveSection.Shapes["tbN"].Text

with (ActiveDocument.Sections["TopN"].Limits["1"]) {

SelectedValues.RemoveAll()

Ignore = false

SelectedValues.Add(newN)

}

ActiveDocument.Sections["TopN Chart"].Title = "The Top " +

newN + " States"

Page 87: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 78

Dense Ranking *

Purpose / Use: You want to create a ranking that does not skip ranking numbers. Ties

are resolved by a secondary sort order.

Sample File: Dense Ranking.bqy

Steps to Produce: The supplied Rank() and RankAsc() functions display ties as the same

value but then skips numbers to pick up the ranking beyond the ties. Use

the Cume of a counter computed item column as the ranking value

instead to create a dense ranking.

1) Create your query as you would normally.

2) Sort the results by the column to be ranked, followed by any other secondary ranking

columns. In this example, sort by Salary, then by Employee name.

3) Create a computed item column named “Cntr” with a formula of 1.

4) Create a second computed item column named “Dense Ranking” with a formula of

Cume(Cntr).

5) Right-click on the Cntr column and select “Hide Column”.

Page 88: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 79

Random Sampling

Purpose / Use: You want to create a random sampling of a data set.

Sample File: Random sampling.bqy

Steps to Produce: Use the JavaScript Math class to define a random number generator you

can use to randomly select rows from a data set.

1) Create your query as you would normally.

2) Determine the number of desired sample segments by using the inverse (1/n) of the

sampling percent. For example, if you want a 5% sample, the number of segments is 1/.05

or 20.

3) Add a Computed Item named Sample Index, using the following formula (replace the 20

segments shown below for our 5% example with your number):

{ Math.floor(Math.random()*20) + 1 }

This example will yield a randomly distributed set of values between 1 and 20 inclusive.

4) Create a Table section that includes all the fields from the query (including the Sample

Index). Add a local limit on Sample Index and select one of the values.

5) Build your pivots, charts and reports from the Table section rather than the Results

section.

Page 89: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 80

Total Transactions and Current Balance

Purpose / Use: Some data scenarios end up with “multiple counting” unless you

manipulate the data after the query. In this case, we have a database that

returns both a transaction amount and the then current balance after the

transaction is completed. Normally, you want to know the total of all the

transactions, but the idea of a “total current balance” is meaningless.

What we need instead is the value of the most recent “current balance”

while still adding all the transactions.

NOTE This tip can also be useful when you are querying data with facts at different levels of detail (aka granularity).

Sample File: Total transactions plus current balance.bqy

Steps to Produce: The added wrinkle here is that you have multiple accounts you need to

process, but no single field provides a unique identifier. You will need to

create a concatenation of all the fields that uniquely identify an account,

accumulate the transaction amounts per account and figure out which

current balance is the most recent for each account (where the last

transaction date is most certainly different for each account).

1) Create your query as you would normally.

2) In our example, the combination of Store Type, Store Name and Zip Code uniquely

identifies each account. Sort the Results section in Ascending Order on Store Type, Store

Name and Zip Code. You also need to sort as a last sort item on Transaction Date in

Descending Order. It is vital to sort in descending date order so that the most recent values

for each account are at the top of each account’s data rows.

Page 90: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 81

(Total Transactions and Current Balance continued)

3) Create a Computed Item named Unique_ID in the Results section with a formula of:

Store_Type + Store_Name + Zip_Code

4) Create a set of counting columns to count the number of data rows for each account as

shown below:

Computed Item Name Formula

One 1

GroupRow Cume ( One, Unique_ID )

This creates a numbered list that restarts at 1 for each new Unique_ID value.

5) Now, add up all the transactions for each account by defining a Computed Item named

Transaction Total with a formula of:

Sum ( Transaction, Unique_ID )

This formula calculates the sum for each Unique_ID (but repeats the same value in every

row of the data for each account).

6) Add a new Table section, and place the unique identifier fields into the Table (in this case,

Store Type, Store Name and Zip Code). Also place the Transaction Total, Current Balance

and GroupRow fields into the Table. Your Table section should look like this:

7) Finally, set a local limit in the Table section on GroupRow, where the value = 1. Then hide

the GroupRow column. This will select only the most recent row, properly displaying the

correct Current Balance and removing the duplicate counting on the Total Transactions.

Page 91: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 82

Formatting Chart Multi-labels **

Purpose / Use: Chart labels can be easily formatted if only one label is used. However,

when multiple columns are used in the X-Axis or Y-Axis, formatting

only affects the 1st column used.

Sample File: Formatting Chart Multi-Labels.bqy

Steps to Produce: If you format the data in the Results section prior to using it to create the

chart, the chart will copy the formatting from the Results section.

1) Create your query as you would normally.

2) In the Results section, right-click on the column to be used as the 2nd X-Axis label, and

select “Number” from the speed menu to change the column to the desired format. In

this example, format the Date column to use a custom format of “dd yy” to display the 2-

digit day, followed by the 2-digit year.

3) The Results section should now look like this:

4) Insert a new Chart section and build as you normally would.

NOTE: To change the formatting once the chart is created, you must change the formatting in the Results section, then remove and re-add the column to the X-Axis area of the chart’s design. (No auto-update relationship exists between the two sections.)

Page 92: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 83

Double Underlining in a Report **

Purpose / Use: You want to highlight a column with double underlining.

Sample File: Double underline.bqy

Steps to Produce: Double underlining is not a natively supported font style. You can

“fake” this by creating a column of spaces the same width as the text and

using this column to create the 2nd underline.

1) In the Results section, create a Computed Item named “Spaces” with all spaces. Use this

formula:

" "

2) In the Results section, create a 2nd Computed Item named “UL” to create the same

number of spaces as the length of the current row’s Country. Use this formula:

Substr ( Spaces, 1, Length ( Country ) )

3) Create a report section that has no table object. Use the page header to place column

labels, then drag each field into the body area to create a columnar report.

4) Set the font for all fields to a fixed length (ie, non-proportional) font such as Fixedsys. Set

the font style on the target column to be underlined. Your report should now look as

shown below.

5) Drag the “UL” column onto the report design. Set the font to be the same fixed length

font and set the font style to be underlined. Left align with the Country field and position

it a little bit lower to create the double underline effect.

Page 93: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 84

Detail and Summary in One Display **

Purpose / Use: You may want to show detailed data and compare it to some overall

group summary of that data in a single display (eg, Country compared

to the total for its Territory).

Sample File: Detail and summary in one display.bqy

Steps to Produce: The trick here is to provide the group summary as a computed item for

each row in the results and then only count it once in the display.

1) Create your query as you would normally.

2) In the Results section, add a computed item named “Territory Revenue” with the

following formula:

Sum ( Revenue, Territory )

3) Create a new chart, adding both “Territory Revenue” and “Revenue” as facts. The chart

will show mostly data for Territory Revenue, as it is summing every instance at the

moment.

4) Click on one of the Territory Revenue bars, then right-click. From the speed menu which

appears, select Data Function | Maximum to eliminate the multi-counting of the

summary data.

Page 94: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 85

6 Chart Section Tips

The Chart section offers a wealth of flexibility. Use a touch of human psychology to get charts to tell data stories the numbers alone won’t tell.

Page 95: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 86

Baseline Comparison Chart (with a fixed target)

Purpose / Use: You often want to compare actual values with a constant projected value

or target. (The next tips show how to use a target that changes based on

values in the database.)

Sample File: Baseline and spotlighting.bqy

Steps to Produce:

1) Create your chart as usual.

2) Set the chart type to be Bar-Line (the last one in the toolbar chart type pulldown list).

3) Right-Click the chart and select Add Computed Item. Name the item “Target”,

“Baseline” or some other appropriate name. Enter the target value (say, 200000) as the

definition of the Computed Item.

4) In the chart itself, select one of the values for the Target. Right-click, and select

“Properties”. On the “Patterns” tab, change the line width to 3 points, and change the

marker size to 3 points.

5) Modify the chart settings.

• On the General tab, remove the 3-D Objects option. (Most Bar-Line charts look better

in 2-D.)

• On the Values Axis tab, turn off the Show Values at Right option.

• On the Bar Chart tab, the Shift setting should be Shift Points to Center.

Page 96: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 87

Baseline Comparison Chart (with DB values)

Purpose / Use: You often want to compare actual values with a target value that resides

in the database. This target value may change based on a number of

factors, so your comparison chart must key the baseline off data fetched

from the database.

Sample File: Data-based baseline comparisons.bqy

Steps to Produce: Hyperion Intelligence v6.x added support for creating summary

computed items that key off a single group total. This new

summarization ability can be used to create baseline comparison charts

that work off a reference value contained in the database itself.

1) Before creating the chart, select the Results section. Create a new Computed Item. Name

the item “Target”, “Baseline” or some other appropriate name. In this example, we want

to use the revenue figures for the state of New York as the baseline of comparison.

Therefore, enter the target value’s formula as the following:

Sum ( Revenue, State, 'NY' )

2) Create your chart as usual. Add the real value as the first Y-value and your new

computed Target item as the second Y-value.

3) Set the Chart Type to be Bar-Line (the last one in the toolbar pulldown list).

4) In the chart itself, select one of the values for the Target. Right-click, and select Data

Function from the speed menu. Change the data function from Sum to Maximum,

Minimum or Average (see the figure below).

Page 97: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 88

(Baseline Comparison Chart using values from the database continued)

5) In the chart itself, select one of the values for the Target. Right-click, and select

“Properties”. On the “Patterns” tab, change the line width to 3 points, and change the

marker size to 3 points.

6) Finally, modify the chart settings.

• On the General tab, remove the 3-D Objects option. (Most Bar-Line charts look better

in 2-D.)

• On the Values Axis tab, turn off the Show Values at Right option. Also turn off the

Auto checkbox in the Right Axis Scale section. Change the Min and Max settings for

the right axis scale to match the ones for the left axis.

• On the Bar Chart tab, the Shift setting should be Shift Points to Center.

Page 98: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 89

Baseline Comparison Chart (with DB averages)

Purpose / Use: You often want to compare actual values with an average of values that

reside in the database. Since this is a comparison against an average,

your comparison chart must key the baseline off data fetched from the

database.

Sample File: Data-based baseline comparisons.bqy

Steps to Produce: Hyperion Intelligence v6.x added support for creating computed items

that key off the number of distinct groups rather than the number of

rows. This new summarization ability can be used to create correct

baseline averages for use in comparison charts.

1) Before creating the chart, select the Results section. Create a new Computed Item. Name

the item “State Total” or some other appropriate name. Enter the computed item’s

formula as the following:

Sum ( Revenue )

2) Next, we need to calculate the number of state groups (rather than the total number of

rows). Create a second Computed Item called “State Cnt” with the formula:

CountDistinct ( State )

3) Now, create a third Computed Item that will hold the average revenue for an average

state. Name it “State Avg” and define its formula as:

State_Total / State_Cnt

4) Create your chart as usual. Add the real value as the first Y-value and your new

computed “State Avg” item as the second Y-value.

Page 99: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 90

(Baseline Comparison Chart using averages from the database continued)

5) Set the Chart Type to be Bar-Line (the last one in the toolbar pulldown list).

6) In the chart itself, select one of the values for the Target. Right-click, and select Data

Function from the speed menu. Change the data function from Sum to Maximum,

Minimum or Average (see the figure below).

7) In the chart itself, select one of the values for the Target. Right-click, and select

“Properties”. On the “Patterns” tab, change the line width to 3 points, and change the

marker size to 3 points.

8) Finally, modify the chart settings.

• On the General tab, remove the 3-D Objects option. (Most Bar-Line charts look better

in 2-D.)

• On the Values Axis tab, turn off the Show Values at Right option. Also turn off the

Auto checkbox in the Right Axis Scale section. Change the Min and Max settings for

the right axis scale to match the ones for the left axis.

• On the Bar Chart tab, the Shift setting should be Shift Points to Center.

Page 100: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 91

Chart Smoothing

Purpose / Use: Some applications lend themselfs better to a chart that has the data

points “smoothed” over time to reduce inaccurate analysis due to spikes

in general activity. Hyperion Intelligence v8.2 adds a number of Trend

Functions that provide this kind of trend smoothing.

Sample File: Chart smoothing.bqy

Steps to Produce: Create a second data series using a Computed Item with a Moving

Average formula.

Version Dependency: Requires Hyperion Intelligence v8.2 or higher

1) Create your chart as usual, and select “Bar-Line” as the chart type.

2) Select Chart | Add Computed Item from the menu.

3) Create a Computed Item named “Rolling Weekly Avg” and use the new Moving Average

trend function as shown below:

Page 101: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 92

Scatter Charts (pre v9.3)

Purpose / Use: Some data lends itself better to a chart type known as a scatter plot.

Scatter charts are not a type available as a choice in the chart toolbar, but

they can be easily created.

Sample File: Scatter plots.bqy

Steps to Produce: Create a scatter chart by building a line chart and then turning off the

line.

1) Create your chart as usual, and select “Line” as the chart type.

2) Click on one of the data points, then right-click and select “Properties…”.

3) On the Patterns tab, set the line pattern to “None”.

Page 102: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 93

Best-Fit Charts

Purpose / Use: One typical way to analyze data is to compare the actual data with an

ideal set of values to see how the actual results compare with expected

results. Best-fit charts are a way to display this. Best-fit charts are not a

type available as a choice in the chart toolbar, but they can be easily

created.

Sample File: Scatter plots.bqy

Steps to Produce: Create a scatter chart of the actual data, then add a computed item to

plot the best fit values.

1) Create a line chart, using your actual data points.

Do not change any line properties till after you have added all the fact columns.

Otherwise, the chart engine will reset all facts to the default settings each time a new fact

is added.

2) You will use a linear regression formula to calculate the best-fit plot. A best-fit line will

use the formula y = mx + b, where m=slope and b=y-intercept. To create a computed item

named “Best Fit”, you will need to compute the average slope of the data points and a y-

intercept value.

The slope of a line is defined as (y2-y1) / (x2-x1). In this case, the Length_m column

holds the y-values, and the Mass_kg column holds the x-values. Since the sample values

of y start where x=0, we can use the minimum column value as the y-intercept.

3) In the Results section, create a computed item named “Slope” using a formula similar to

the following:

(Length__m_-Prior(Length__m_))/(Mass__kg_-Prior(Mass__kg_))

Page 103: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 94

(Best Fit Charts continued)

4) In the Results section, create a computed item named “Avg Slope” using a formula

similar to the following:

Avg(Slope)

5) In the Results section, create a computed item named “Best Fit” using the following

formula:

(Mass__kg_*Avg_Slope) + ColMin(Length__m_)

6) Add the “Best Fit” computed item to your chart.

7) Right-click on one of the “Best Fit” data points and select “Properties…”.

8) On the Patterns tab, set the Marker pattern to “None”. Make sure the line color is one

that will be easily visible.

9) Right-click on one of the actual data points and select “Properties…”.

10) On the Patterns tab, set the line pattern to “None”. Make sure the marker color is one that

will be easily visible.

Page 104: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 95

Spotlighting in a Chart

Purpose / Use: The Spotlighter is a very useful tool for visually tagging deviant values.

However, the Spotlighter is not available in the Chart section.

Sample File: Baseline and spotlighting.bqy

Steps to Produce: Here is how to create spotlighting by using layered computed items.

1) Create your chart as usual, with the actual value as the first Y value.

2) Right-click on the chart, and create a Computed Item. Name it something appropriate

like “Monthly Goal”. Set its definition to be your target value (say, 200000).

3) Create another Computed Item. Name it “Goal Not Met”, and set its definition to be:

if (Monthly_Goal > Amount) {Amount} else {0}

This formula creates a bar only when you have a value to spotlight.

4) Change the chart type to Vertical Stack Bar (3rd icon from the top in the toolbar’s chart

type pulldown).

5) Drag the Goal Not Met field to be the first item in the Y values.

6) Set the legend to be based on the Y values. Use the Color Pallete to reset the colors for

each value series. One good setting is to use red for Goal Not Met (in front), blue for the

actual value (in the middle), and yellow for Goal (in the back).

7) Modify the chart and turn off the 3-D Objects option.

Page 105: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 96

Waterfall Charts *

Purpose / Use: To display time-series data in a Waterfall Chart style.

Sample File: Waterfall.bqy

Steps to Produce: The chart section does not have a Waterfall Chart style listed. However,

you can create the same kind of display with a few computed columns, a

flattened chart and bar borders turned off.

Version Dependency: Requires v9.3 or higher

1) Build a time-series query.

2) Add some computed columns to create “spacer” values for each member of the time

series based on the value of the previous member.

3) Add the time-series spacer members as the Depth Axis to a regular bar chart.

4) Set the chart legend to be based on the Z-Axis (depth), then hide the chart legend. Your

chart should look something like this:

Page 106: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 97

(Waterfall Charts continued)

5) In turn, select each of the spacer bars in the front of the Q1, Q2 and Q3 time periods and

set their fill color to white. Your chart should now look something like this:

6) Right-click on any bar and make sure that “Show Bar Border” is turned off.

7) Double-Click on the chart to open the Chart Properties dialog box.

8) On the “General” tab, turn off “3-D Objects”.

9) Resize and format as desired.

Page 107: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 98

Clustered Bar-Line Chart *

Purpose / Use: Normally, the bars in a Bar-Line chart are stacked. In this example, we

want them clustered for easier value comparison.

Sample File: Clustered Bar-Line.bqy

Steps to Produce: Use the bar chart options to change the bars from stacking to clustering.

1) Create your chart as usual, with the four funding levels as the Y-Facts. Format as desired.

2) Double-click in the white space area in the chart, and select the “Bar Chart” tab from the

Chart Properties dialog box that appears.

3) Change the Stack/Cluster chart option to clustering, as shown below:

Page 108: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 99

Bar-Line with Multiple Lines (v9.3) *

Purpose / Use: To display a Bar-Line chart that has 1 bar, multiple lines, and a legend

that builds itself with no strange blocks.

Sample File: Bar with Multiple Lines 93.bqy

Steps to Produce: This tip uses the new Bar-Line chart features introduced in v9.3

Version Dependency: Requires v9.3 or higher. (See the Dashboard Tips section for a pre-v9.3

solution using multiples overlaid charts.)

1) Create your query as normal.

2) Insert a new chart section. Define it with the Fiscal Year as the X-Category and the 4

funding fields in the Y-Facts.

3) Set the chart type to be a Bar-Line chart. Your chart should now look like this:

Page 109: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 100

(Bar-Line with Multiple Lines v9.3 continued)

4) Right-click on the “Validated Requirements” field in the Outliner and select “Display as

Line” in the speed menu that appears.

5) You should now have a chart with 1 bar and 3 lines, but with two different vertical axes.

Double-click on each of the underlined facts to eliminate the second vertical axis. Your

chart should now look like this:

6) You can further format the chart as desired. For example, you can right-click on the

legend and select “Show Legend Outline” to place a box around the legend. You can

right-click on the bar and select “Show Bar Border” or on a line marker and select “Show

Marker Border”. You can also right-click on any item, select “Properties” and configure

the color, size and thickness of the lines, bars and markers.

Page 110: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 101

Population Pyramid Chart *

Purpose / Use: Population data (as well as other demographic data organized into

“cohorts”) is often best displayed in “back-to-back” pyramid charts.

Sample File: Population Pyramid.bqy

Steps to Produce: Create a horizontal bar chart, with one group of data “sign-flipped” to

display as negative numbers to create the left side of the pyramid.

1) In the Results section, add the following computed item columns:

Computed Item Name Formula

“Cntr” 1

“SortBy” Cume(Cntr)

“ Male” -1 * Male

The Cntr column is used by the Cume() formula to create a row-number-based sort

order. This will be used to force the bars to be displayed in the correct data order (instead

of alphabetically). The “ Male” column is used to sign-flip the male numbers. Notice the

blank space before the name to create a unique column name that does not look unique.

2) Insert a new chart section. Drag “Age” to the X-Categories area of the Outliner, and drag

“ Male” (the computed column version), “Female” and “SortBy” into the Y-Facts area.

3) In the Sort line above the chart, set the sort on the Age field to be by the SortBy field.

Page 111: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 102

(Population Pyramid Chart continued)

4) Change the chart type to Horizontal Bar. The chart should now look like this:

5) Double-click on the chart title and change it to read “US Census Data for 2000”. Right-

click on the “Age” side label and hide it. Double-click on the bottom label and change it

to read simply “Male”.

6) Double-click on the chart itself and in the chart properties dialog box that appears, turn

OFF the “Show Legend”, “Show Borders” and “3-D objects” options.

7) While still in the chart properties dialog, click on the “Values” tab. Turn OFF the Auto-

Interval and change it from 25,000,000 to 5,000,000.

8) Click just outside the chart border to view the chart size handles. Enlarge the chart until

all numbers display on a single line. Your chart should now look like this:

Page 112: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 103

(Population Pyramid Chart continued)

9) Click on one of the numbers along the bottom of the X-Axis to select them. Right-click

and select “Number…” from the speed menu. In the number format dialog box, click on

the Custom category and enter the following format into the “Format:” edit box on the

right:

#,##0; #,##0

This number format will display negative numbers without displaying a minus sign.

Both positive and negative numbers will display the same, but negative numbers will

still appear on the left side of the chart.

10) Right-click in a blank spot in the chart and select “Insert Text”. Type in “Female”, then

click “OK”. Click on the text object and set its font style to bold and font size to 10. Right-

justify it and then drag it to the lower right side of the chart to tag the right-side numbers

as female.

11) Drag the “Male” label to the left to tag the left-side numbers as male.

12) To make the age labels more visible, click on one of the labels to select them and then set

the font style to bold and left-justify them.

13) Click on one of the age labels again and drag the left handle a bit to the right until the “85

and older” label word-wraps.

14) Set other formatting options (such as background, grid color, etc.) as desired.

Page 113: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 104

Portion within a Category

Purpose / Use: Pie charts are good for displaying “portion of the whole” comparisons.

Sometimes, you may want to display the portion of just a single item

within each of several categories at the same time.

Sample File: Percent of category.bqy

Steps to Produce: At Hyperion, we track Problem Reports and want to know how many

are closed versus the total for each category. The secret here lies in using

a Grouping Column in a unique way.

1) In the Results section, create a Grouping Column on the status item you want to use (i.e.,

the one that determines whether a PR is closed or not in our example). Place any status

that is considered closed in a group called Closed, and place all other status descriptions

in a group called Total PRs Entered.

In other words, instead of calling these other items Not Closed, we are intentionally

“mislabeling” them in the interests of our end result, the portion chart. Therefore, it is

important that the group label we “misuse” is set so that it falls later in the alphabet. That

way, it gets charted last.

2) Insert a new chart and set its type to Vertical Stack Bar (3rd icon from the top in the

toolbar’s list of chart types).

3) Drag the amount / count field into the Y values. Place the new Grouping Column in the Z

labels area. Place an appropriate category label in as the X labels.

4) Set the legend to be based on the Z labels.

5) Modify the chart and turn off the 3-D Objects option.

Page 114: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 105

Creating alternate sort order in a Chart

Purpose / Use: Often, you want your Chart dimensions sorted in an order other than

alphabetical. For example, this is a second way you can display month

names in calendar order.

Sample File: Hidden sorting.bqy

Steps to Produce: Make use of a hidden fact to control the sort order of the dimension.

1) Build your chart as usual.

2) Add a new fact that corresponds to the desired sort order. In the sample BQY, a field

named “Month Number” contains the month number. If no such data column exists, add a

Computed Item to the Results section named “Month Number” with the following

formula:

if (Month_Name == 'January' ) {1} else {

if (Month_Name == 'February' ) {2} else {

if (Month_Name == 'March' ) {3} else {

if (Month_Name == 'April' ) {4} else {

if (Month_Name == 'May' ) {5} else {

if (Month_Name == 'June' ) {6} else {

if (Month_Name == 'July' ) {7} else {

if (Month_Name == 'August' ) {8} else {

if (Month_Name == 'September' ) {9} else {

if (Month_Name == 'October' ) {10} else {

if (Month_Name == 'November' ) {11} else {

12 }}}}}}}}}}}

Once created, add the Month Number field to the chart’s facts.

3) Right-click on the sorting fact (Month Number in this example), and select “Hide Items”.

4) In the chart’s sort line, select Month Name and set it to be sorted on Month Number using

Maximum in ascending order as shown below.

Page 115: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 106

Chart Design for Report Embedding

Purpose / Use: You want to design a chart differently if it will be used in a Report

section.

Sample File: Chart for report embedding.bqy

Steps to Produce: Keep in mind what will happen to the chart once it is embedded in the

report. The SmartReport logic will narrow down the contents of the chart

to only display those items that apply to the current report group.

1) Build your chart with all the data elements your report will need. The chart will look very

busy in its raw form. Don’t worry. Embedding will clean it up.

2) Create a report with appropriate groupings defined. Drag your chart design into one of the

group areas or into the body area. The chart will become context-sensitive automatically.

Page 116: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 107

7 Pivot Section Tips

Crosstab-style displays allow for automatic data summarization. Think ahead about where special data handling should be defined, here or in a results or table section. Also make use of hidden dimensions, hidden facts and special formatting to achieve spectacular results.

Page 117: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 108

Variance Reporting

Purpose / Use: Often, you want to compare year to year numbers by both actual growth

and percentage growth in the same display.

Sample File: Variance reporting.bqy

Steps to Produce: You add two summary lines to the pivot, then change. Their data

functions and labels.

1) Build your pivot as usual.

2) Select the entire Year column by clicking on the tab below it. Click twice on the Grand Total

button in the toolbar.

3) Use Alt-Click to select the first total row. Right-click and select Data Function | % Increase

from the speed menu.

4) Alt-Click the second total row. Right-click and select Data Function | Increase from the

speed menu.

5) Double-click the word “Total” in the first summary row. Change the label to “% Growth:”

Repeat the process and change the second summary row’s label to “$ Variance:”.

6) Format the summary rows as desired. To match the example here, click on each summary

label and click the right-align format button. Then Alt-Click the summary labels and set the

row’s background color to blue, the text to bold, and the border style (the Format | Borders

menu) to “Horz and Vert”.

Page 118: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 109

Adding textual annotations to a Pivot

Purpose / Use: Often, you want your users to know why a particular item was

highlighted in a Pivot.

Sample File: Pivot annotations.bqy

Steps to Produce: You add a simple Computed Item to the Pivot design to display a text

string when a particular condition is met.

1) Build your pivot as usual.

2) Add a new Computed Item named “Reason” using the following formula:

if ( ASP <= 100 ) { 'Too low for profit' } else { '' }

You need the else clause to avoid seeing “N/A” displayed in the pivot where the

comparison doesn’t hold true. You can, of course, add nested if-then-else logic to provide

multiple messages for different conditions.

Page 119: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 110

Adding symbolic annotations to a Pivot

Purpose / Use: Sometimes, you want your users to focus on an item by tagging it with a

marker or symbol.

Sample File: Pivot annotations.bqy

Steps to Produce: Use a combination of a simple Computed Item along with some creative

use of fonts.

1) Build your pivot as usual.

2) Add a new Computed Item named “Flag” using the following formula:

if ( ASP <= 100 ) { 'A' } else { '' }

You need the else clause to avoid seeing “N/A” displayed in the pivot where the

comparison doesn’t hold true.

3) Now, invoke the Character Map windows application (Start | Programs | Accessories |

Character Map). In the upper left, select an appropriate symbol font. In this example,

Wingdings 3 was used.

4) Find the symbolic character you want to appear in your pivot. Click on it and hit the

“Select” and “Copy” buttons to copy the symbol to your clipboard. Close the Character

Map application.

5) Back in your pivot, right-click on the “Flag” column and select “Modify” from the speed

menu. Highlight only the A in the formula and then press Ctrl-V to paste the selected

symbol into your formula. Close the formula box.

6) With the “Flag” column still selected, change the font to match the one you used in the

Character Map application. In this example, select Wingdings 3.

7) You can also use the Spotlighter on this strange character. With the “Flag” column still

selected, simply invoke the Spotlighter (Format | Spotlighter). Set the desired display

colors and use Ctrl-V to paste the selected symbol into the Value box.

Page 120: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 111

Displaying Performance Comparisons

Purpose / Use: Sometimes, you want a quick visual indicator of relative performance.

Sample File: Drill and compare.bqy

Steps to Produce: Use a combination of a simple Computed Item along with some creative

use of fonts.

1) Build your pivot as usual, including a meaningful comparison value.

2) Create a Computed Item to compare the values and enter a character representation. In this

example, we created a Computed Item named Performance with a formula of:

if ( Amount_Sales >= Median_Xactn ) { 'C' } else { 'D'}

3) Change the font of the computed column to Wingdings to display the up and down

thumbs shown above.

Page 121: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 112

Convert Nulls to Zeros

Purpose / Use: Often, a Pivot will display blank spots where no data exists for a

particular row/column intersection. The solution is not a simple matter

of changing nulls to zeros in the Results section, since “holes” in a Pivot

mean no data rows exist to convert.

Sample File: Convert pivot nulls to zeros.bqy

Steps to Produce: Make use of Computed Items in the Pivot itself to perform the

conversion.

1) Build your pivot as usual. The pivot will look like this:

Note the blank spots for Argentina and Ireland in 2001.

2) Right-click and select Add Computed Item to build the following 2 formulas:

Computed Item Name Formula

Units if ( Units_Sold == null ) { 0 } else { Units_Sold }

Revenue if ( Amount_Sold== null ) { 0 } else { Amount_Sold}

3) Finally, right-click on Units_Sold and select Hidden Item. Do the same for the

Amount_Sold column.

Page 122: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 113

Creating alternate sort order in a Pivot

Purpose / Use: Often, you want your Pivot labels sorted in an order other than

alphabetical. For example, you may want month names listed in calendar

order.

Sample File: Hidden sorting.bqy

Steps to Produce: Make use of a hidden fact to control the sort order of the labels.

1) Build your pivot as usual.

2) Add a new fact that corresponds to the desired sort order. In the sample BQY, a field

named “Month Number” contains the month number. If no such data column exists, add a

Computed Item to the Results section named “Month Number” with the following

formula:

if (Month_Name == 'January' ) {1} else {

if (Month_Name == 'February' ) {2} else {

if (Month_Name == 'March' ) {3} else {

if (Month_Name == 'April' ) {4} else {

if (Month_Name == 'May' ) {5} else {

if (Month_Name == 'June' ) {6} else {

if (Month_Name == 'July' ) {7} else {

if (Month_Name == 'August' ) {8} else {

if (Month_Name == 'September' ) {9} else {

if (Month_Name == 'October' ) {10} else {

if (Month_Name == 'November' ) {11} else {

12 }}}}}}}}}}}

Once created, add the Month Number field to the pivot’s facts.

3) Right-click on the sorting fact (Month Number in this example), and select “Hide Items”.

4) In the pivot’s sort line, select Month Name and set it to be sorted on Month Number using

Maximum in ascending order as shown below.

Page 123: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 114

Demographic Analysis

Purpose / Use: To graphically display trends of average values in an organization over

time or across different groups.

Sample File: Demographics.bqy

Steps to Produce: What appears as a simple chart may in fact require some imagination to

set up. In this case, preliminary work includes building a Computed

Item to transform the data into useable form, and then building the

analysis as a Pivot first. We then convert the Pivot to a Chart.

1) In the Results section, create a Computed Item. Call it Months Since Last Promotion, and

define its formula to be:

MONTHS_BETWEEN ( Today, Last_Promotion_Date )

2) Insert a new Pivot. Add the category as the left-side label, and the analysis grouping as the

top label. Place the new Computed Item (Months Since Last Promotion, in our example) in

as the data element.

3) Right-click on the data column and select Data Function from the speed menu. Change the

data function to be Average.

4) On the Hyperion Intelligence main menu, select Insert | Chart This Pivot.

Page 124: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 115

Percent Decrease

Purpose / Use: To display the percent delta decrease between groups of values.

Sample File: Percent decrease.bqy

Steps to Produce: The pivot section has a “% Increase” summary function. However, it

does not have a “% Decrease” function. We can simulate one, though,

using a custom number format.

1) Build your pivot as you normally would.

2) Click on the right-side tab on the top labels and click on the Summation button in the

toolbar to add a Totals set of columns.

3) Click, then Alt-Click on the Totals label to select the Totals columns. Now right-click and

select Data Function | % Increase from the speed menu.

4) Alt-Click to select the columns again, then right-click again and select Number... from the

speed menu. Select the Custom category and enter a format string of -#,##0.00%;#,##0.00%

to reverse the sign (negative for positive numbers and positive for negative numbers):

5) Finally, double-click on the “% Increase” label and change it to “% Decrease”.

Page 125: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 116

Side Label-based Averages *

Purpose / Use: To display the rolling average from month to month.

Sample File: Side Label Averages.bqy

Steps to Produce: The pivot section’s formula wizard does not list the Next() and Prior()

functions when building formulas, but they still work.

1) Build your pivot as you normally would.

2) Add a Computed Item column named “2-Month Avg” using the following formula:

( Amount_Sold + Prior(Amount_Sold) ) / 2

3) Format the new column as desired.

Page 126: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 117

Gannt Charts (pre-v9.3)

Purpose / Use: To display schedule-based data in a Gannt Chart style.

Sample File: Gannt Chart.bqy

Steps to Produce: The chart section does not have a Gannt Chart style available. However,

you can create the same kind of display with a few computed columns

and a pivot section.

1) Build a schedule-focused query, making sure to include expected start date, duration or

end date, and any status fields that may be pertinent such as risk of delay information, etc.

2) Add some computed columns to create single-value status indicators for each row:

Computed Item Name Formula

Schedule if ( Status == 'Not Started' ) { 'N' }

else

if ( Status == 'Running' ) { 'R' } else { 'D' }

Risk of Delay if ( Delay_Risk == 'G' ) { 0 }

else

if ( Delay_Risk == 'O' ) { 1 } else { 2 }

3) If needed, right-click on your date field and select Add Date Groups from the speed menu.

4) Build a pivot, using the project names and stages as the Side Labels, the year and month

names as the Top Labels, and the Schedule and Risk of Delay fields as the facts. Right-click

on the Risk of Delay column and select Data Function | Maximum from the speed menu.

Your pivot should look like this:

Page 127: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 118

(Gannt Charts pre-v9.3 continued)

5) Right-click in any blank area of the pivot and select Data Labels | Down Side from the

speed menu. The two facts should now be displayed in separate rows.

6) Click on the Schedule row, then select Format | Spotlighter from the main menu. Define

the following Spotlighter conditions:

Schedule Value Meaning Font Color Background Color

= N Not Running White White

= D Delayed Red Red

= R Running On Time Blue Blue

7) Click on the Delay of Risk row, then select Format | Spotlighter from the main menu.

Define the following Spotlighter conditions:

Risk Value Meaning Font Color Background Color

= 0 No to Low Risk White White

= 1 Medium Risk Pale Yellow Pale Yellow

= 2 High Risk Pale Rose Pale Rose

8) Finally, double-click the width of each month, then format and center to the rows of Top

Labels.

Page 128: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 119

Display Totals for Only Some Facts

Purpose / Use: To only display totals for some fact columns but not for all.

Sample File: Display selected pivot totals.bqy

Steps to Produce: The default summation action in a pivot section is to display sums for all

fact columns. Sometimes, this does not make sense for certain columns.

Some formatting tricks will solve this problem.

1) Build your pivot as you normally would, and add the totals using the summation button

on the toolbar.

2) Alt-click on the Totals row to select it. Click the Bold button in the toolbar twice to set all

fields in the Totals row to be bold.

3) Use the toolbar to set both the background and font colors to the same light color (like a

pale blue for example). Click in any blank space and your Totals row should look like this:

4) Click where the Totals label should be and set the font color back to black.

5) Click in each column where a total should be displayed and set the color back to black.

Page 129: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 120

Display Correct Totals for Computed Items

Purpose / Use: To display correct totals for fact columns that are computed items.

Sample File: Correct computed item totals.bqy

Steps to Produce: The default summation action in a pivot section is to add all the values in

each fact column. For certain computed facts (using division or

multiplication), you really want the non-computed facts summed, and

then the computation formula used on the values in the Totals row to

yield the “sum” of the computed columns.

Version Dependency: Requires Hyperion Intelligence v8.2 or higher

1) Build your pivot as you normally would, and add the totals using the summation button

on the toolbar. The display of the totals should look like this:

Note that the “total” for the Avg Sale column is indeed summing all the rows in the pivot.

This is not the value we want. Instead, we want the formula of the Avg Sale column (i.e.,

Amount_Sold / Units_Sold) to be used in this total row as well.

2) Select Pivot | Pivot Options… from the main menu. Turn off the “True Computed Item

Totals” option and the total for Avg Sale will now be correct.

Page 130: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 121

Weighted Ranking

Purpose / Use: To display rank as a fraction of the largest contributor.

Sample File: Weighted ranking.bqy

Steps to Produce: Relative ranking can be displayed using a simple computed item.

1) Build your pivot as you normally would, with Units Sold as the fact in this example.

2) Add a computed item named “Ranking” with the following formula:

Units_Sold / ColMax ( Units_Sold )

3) Use the pivot’s Sort line to sort the Side Label by the Ranking column in descending order.

Page 131: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 122

Calculated Spotlighting in the Same Column **

Purpose / Use: To display spotlighting based on calculations in the same column as

another data element.

Sample File: Calculated Spotlighting in Same Column.bqy

Steps to Produce: Spotlighting normally highlights the value in a column. This tip provides

highlighting in a column based on data other than what is displayed in

the column.

1) Build your pivot as you normally would, with Revenue and Units Sold as the facts in this

example.

2) Add a computed item named “Under” with the following formula:

Revenue / Units_Sold

3) Select the Spotlighter from the Format menu, then click on the “Under” column and

define a rule where values <=16.5 are displayed with red text on a red background.

Define a second rule where values > 16.5 are displayed with white text on a white

background. The pivot should now look like this:

Page 132: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 123

(Calculated Spotlighting in the Same Column continued)

4) Select the “Units Sold” column, right-click and hide it, since it was only needed for the

calculation and will not be displayed in the final pivot.

5) Select the column label for “Under” and set the text color to the same as the background

(to hide the label).

6) Right-click anywhere in the pivot, then select “Data Labels” | “Down the Side” from the

speed menu.

7) Adjust the height of the spotlighting row as desired.

Page 133: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 124

Group Header Rows in a Pivot **

Purpose / Use: To display blank rows that act as group headers within a pivot.

Sample File: Requirements vs funding.bqy

Steps to Produce: Pivots support creation of Computed Item columns, but not rows. This

tip uses Computed Item columns plus the ability to display column

labels as row labels.

1) Build your pivot as you normally would, with Years as the Side Label, and the other

fields as Facts. Add a computed item named “Deltas” with the following formula:

“”

2) Continue adding any other needed computed item columns. In this example, a computed

item column named “Percentages” has also been added, using the same formula as

“Deltas”. Your pivot should now look like this:

3) Right-Click anywhere, and select Data Labels | Down Side from the speed menu. Your

pivot should now look like this:

Page 134: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 125

(Group Header Rows in a Pivot continued)

4) Click on the label “Funding”, then Ctrl-Click on “Deltas” and “Percentages”. Set the fill

color to grey and the font style to bold.

5) Click on the data cell to the right of the label “Funding”, then Ctrl-Click on the data cells

for “Deltas” and “Percentages”. Set the fill color to grey and the font style to bold. Your

pivot should now look like this:

6) Finally, swing the Years label to be across the top to achieve the desired final results.

Page 135: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 126

Fact-based Delta Trends

Purpose / Use: To analyze percent changes from one year to the next, and highlight

those areas where the average year-to-year percent change is greater

than a particular target.

Sample File: Not available to the public

Steps to Produce: This is another analysis that takes some preliminary set up before it can

be created.

1) In the Result section, break out the dollar amounts by year (i.e., create dimensionalized

facts). For example, add a new Computed Item for 1992 called Rsrc_1992. Define the

formula as:

if (Budget_Year='1992') {Gross_Budget} else {0}

Repeat the creation of a dimensionalized fact for each year you want to analyze.

2) Insert a new Pivot. Add the appropriate categories to the left-side labels. Add the

dimensionalized facts to the data area in the order they should be analyzed.

3) For each year-to-year comparison, add a Computed Item to the Pivot. For example, for the

1992-to-1993 delta, name the item Change 1993, and define its formula to be:

if ((Rsrc_1992 != null) && (Rsrc_1992 != 0)) {

if (Rsrc_1993 != null) {

(Rsrc_1993 - Rsrc_1992) / Rsrc_1992

} else { -1 }

} else {

if (Rsrc_1993 != null) { 1 }

else { 0 }

}

Page 136: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 127

(Fact-based Delta Trends continued)

The formula’s logic is as follows. If dollar amounts exist for both years, perform a normal %

change calculation (i.e., (Current-Previous)/Previous ). If an amount exists for the prior year

but not the following year, tag that as a delta of –100%. If no amount exists for the prior

year but one exists for the following year, tag that as a delta of +100%.

4) Add a final Computed Item to calculate the average delta across the entire range of years.

In our example, name it Avg_ Annual_Chg, and define its formula as:

( Chg_1993 + Chg_1994 + Chg_1995 + Chg_1996 + Chg_1997 +

Chg_1998 + Chg_1999 + Chg_2000 ) / 8

5) Select the Avg_Annual_Chg column, right-click on it and change the numeric display to be

0.00%.

6) With the Avg_ Annual_Chg column still selected, open the Spotlighter and define the

appropriate highlight definition. For example, say we wanted to highlight any average

change greater than 10%, you would define the Spotlighter as shown below:

Remember that Spotlighter values are defined in terms of the “raw” unformatted numbers.

Therefore, you need to enter the target value as 0.1 (the raw equivalent of 10%).

Page 137: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 128

Dimension-based Delta Trends

Purpose / Use: To analyze percent changes from one quarter to the next by keying off

the changes in the dimension labels.

Sample File: Dimension-based deltas.bqy

Steps to Produce: This is an analysis that takes advantage of the unique properties of the

Next() and Prior() functions when they are used in a Pivot section.

1) Create your pivot as usual; with the dimension(s) you want to track the changes over

placed in the top labels.

2) Create a computed item in the Pivot that tracks the actual change amounts from one top

dimension value to the next. In this example, we are tracking the changes from one

quarter to the next, so create a computed item named “Inc/Dec” with a formula of:

if (Quarter=="Q1") {}

else { Unit_Sales-Prior(Unit_Sales) }

3) Create a second computed item in the pivot to calculate the amount of change as a

percentage of the previous quarter’s value. Give the computed item a name of “Pct

Inc/Dec” and use a formula of:

if (Quarter=="Q1") {}

else { Inc_Dec / Prior(Unit_Sales) }

4) Set the display of the Pct Inc/Dec column by right-clicking on it, selecting the Number

option and setting the number format to #,##0.0%.

Page 138: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 129

Reporting the Break % of the Total

Purpose / Use: To create a report that properly displays the percent of the grand total

for each grouping.

Sample File: Break percent of total.bqy

Steps to Produce: The Report section by itself cannot actually produce this report with the

correct numbers. You need to embed a special pivot into the report to

replace the default table object.

1) In the Results section, create a Computed Item to calculate the grand total of the revenue.

Name this item “Total Amt” and use the following formula:

Sum ( Amount )

2) Next, create a second Computed Item named “Pcnt of Grand” using the formula:

Amount / Total_Amt

3) Now, insert a pivot section.

• Place one or more dimensions into the side labels

• Place “Amount” into the Facts twice. Right-click on the second “Amount2” column and

change the data function to be “% of Column”.

• Add the “Pcnt of Grand” column to the Facts.

• Click on the Side Label column and then click on the toolbar’s Sigma button.

Page 139: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 130

(Reporting the Break % of the Total continued)

Your pivot should now look something like the figure shown below.

4) Next, format the pivot to look more like a Report section’s table object.

• Double-click on the “Amount2” column name and change it to “Pcnt of State”.

• Right-click on the “Pcnt of State” column itself and set the Number format to

“#,##0.0%”. Set the Number format for “Pcnt of Grand” to be the same.

• Right-click anywhere in the Pivot, select “Corner Labels” from the speed menu and set

it to “Side”.

• Click on the Side Labels column, set the border type to “Horz and Vert” (use the menu

selection Format | Borders | Horz and Vert), the fill color to “Transparent”, the text

color to black and the font style to regular.

• Click on the cell that says “Total” and set its text color to “Transparent”. Then Alt-Click

on the Total cell and set the row’s font style to bold.

• Click on all top column labels, set the fill color to blue, the text color to white, and the

border type to “Horz and Vert”. Next center-align and middle-align (Format | Justify |

Middle) the text. Adjust the height of the column labels so that all the text displays

properly.

Your pivot should now look something like the figure below.

5) Insert a Report section and add “State” to Report Group 1. Delete the table object in the

body and then drag the pivot into the body instead. The SmartReport feature will

automatically adjust the “Pcnt of Grand” column correctly.

Page 140: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 131

Profit and Loss Reporting

Purpose / Use: To create a display that shows both debits and credits as positive

numbers, while displaying the correct totals at the same time.

Sample File: Not Available to the Public

Steps to Produce: The solution is simple once you remember that display formatting is a

separate issue from the actual internal numeric representation.

1) Build your pivot as you normally would.

2) Select each of the numeric facts, right-click and select “Number…” from the speed menu.

3) Select the “Custom” category and create a new custom format as:

#,###.0;#,###.0

In other words, the negative value format is set identical to the positive value format.

4) Click “OK” to apply the new format.

5) The Spotlighter can be used to add color highlighting so that, if desired, conditional

formatting can still identify negative numbers.

Page 141: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 132

Preserving custom formatting when drilling **

Purpose / Use: If you create custom formatting in a pivot, when you drill only the

default formatting will display for the drilled item labels.

Sample File: Preserving format on drill.bqy

Steps to Produce: The solution is set a custom default formatting for the pivot itself that

will not affect the default formatting for any other pivot sections.

1) Build your pivot as you normally would.

2) Click in the far upper left corner of the pivot, then hit Ctrl-A to select all cells in the pivot.

3) While all cells are selected, set up the desired custom default format for your pivot labels

(borders, text alignment, font, font style, font size, etc.).

Page 142: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 133

(Preserving custom formatting when drilling)

4) Click in your Fact columns and change the format to one suitable for the data. In this

example, set the background to white and text to black regular (ie, non-bold).

5) Your pivot is now ready for drilling that will preserve the custom label formatting.

Page 143: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 134

8 Report Section Tips

The Report section can be used for more than simple reports. Because other sections can be embedded into a Report section, and because embedded objects placed within groups become context-sensitive, the Report section provides far more power than most people realize.

Page 144: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 135

Barcoded Labels **

Purpose / Use: To add barcodes to mailing labels for easier zip code processing (thus

reducing your cost of mass mailings).

Sample File: Barcoded labels.bqy

Steps to Produce: Use a special font to “print” the zip code as a Code 3 of 9 barcode.

1) Insert a new report section, select the Report | Report Setup menu, and click on the

“Columns” tab to set the report to use 2 columns.

2) Add one or more “unique identifier” fields to Report Group 1 so you create a group

definition that has only one item in each group. In this example, Store Code is the unique

identifier.

3) Add one or more fields to the same group (ie, Report Group 1) to sort the labels in the

order you want. In this example, we want to sort by Country and then Zip Code.

4) Drag the Report Group 1 fields into the Sort line and sort as desired. Double-click on a field

in the Sort line to switch between ascending and descending sort order. The report should

now look like this:

Page 145: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 136

(Barcoded Labels continued)

5) Delete the Table object in the Body area of the report, then add a Rectangle object to the

Body.

6) Right-click in the Body area to the right of the rectangle and select “Keep Together”. Once

this is set, make the rectangle the same width as the column.

7) Delete all field objects from the display area of the report. This leaves them still present in

the report design for sorting, but removes them from being printed. Shrink the size of the

report group header as small as you can make it. Your report design should now look like

this:

8) Drag the individual fields you want in your labels into the first rectangle. Format as

needed.

9) Add the Zip Code field a second time to the lower right corner of the first rectangle. Your

report should look like this:

10) Change the font (and perhaps font size as well) of this second Zip Code field to use the Free

3 of 9 Extended font included in the Cookbook Sample files.

NOTE The above steps assume you have already installed this barcode font on your system. The included Free 3 of 9 fonts are exactly that – free of charge and available for download over the Internet.

Page 146: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 137

Eliminating Error Messages in Calcs **

Purpose / Use: If Computed Item formulas are not crafted carefully in a report section,

certain situations (such as divide by null) can created “error messages”

in some of the cells.

Sample File: Eliminating Error Messages.bqy

Steps to Produce: Use if-else logic to test for potential error conditions.

1) Build your report as usual.

2) Right-click inside the table and select “Add Computed Item”. By double-clicking on

“Revenue” and “Ad Spend”, create the formula shown below. This will create a column

that has errors in any cell where no Ad Spend value exists.

Tables("Results").Columns("Revenue").Sum(currBreak) / Tables("Results").Columns("Ad_Spend").Sum(currBreak)

3) Right-click on the “Revenue Multiple of Ad” column and select “Modify Column”. Change

the formula to test for the null condition as follows:

if ( Tables("Results").Columns("Ad_Spend").Sum(currBreak) == null) { null } else { Tables("Results").Columns("Revenue").Sum(currBreak) / Tables("Results").Columns("Ad_Spend").Sum(currBreak) }

Page 147: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 138

Maintaining relative position

Purpose / Use: To keep objects in the same spatial relationship, even when the size of

the report group changes due to changes in the number of items

displayed in each group.

In this example, we want to add a horizontal line and some custom text

to the summary area of a report section’s table object. The table object

will grow and shrink from group to group, but we want the line and text

to always be at the bottom of the table.

Sample File: Spring objects.bqy

Steps to Produce: Use the “Spring Objects” formatting option to maintain the relative

position between two objects.

1) Build your report as usual.

2) Add a text object and a line object to the table in the first group. Position the objects into

the desired location relative to the first table object.

3) Click on the text object, then shift-click on the table object to select both items. (Make sure

you selected them from the same group.)

4) Use the main menu and select Format | Spring Objects.

5) Click on the line object, then shift-click on the table object to select both items. (Make sure

you selected them from the same group.)

6) Use the main menu and select Format | Spring Objects.

7) Repeat the process for any other objects you want to hold in position. (Spring Objects

only works with 2 objects at a time.)

Page 148: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 139

Custom group summaries

Purpose / Use: Sometimes you want group summary information in a format different

from what the report section’s table object provides.

Sample File: Spring objects.bqy

Steps to Produce: Create a group footer, and then craft whatever summaries you want by

simply dragging data elements into the group footer.

1) Build your report as usual.

2) For each fact column, click on the column, then right-click and click on the “Show

Column Total” menu item to turn off that option. When finished, your table object

should have no totals showing for any columns.

3) In the group portion of the Outliner, right-click on the group for which you want the

custom summary to appear. Select “Show Both” from the header/footer options menu.

4) Drag any desired data elements into the group footer. Any numeric field will

automatically be totaled.

5) You can add text fields as summary data as well. Drag a text field into the group footer,

then right-click on the field. Select Data Function | Count from the speed menu that

appears. The field in the group footer will now display the number of times that item

appears within the group.

6) Add appropriate text objects to the group footer to serve as labels.

Page 149: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 140

Group Summary in the Group Header **

Purpose / Use: To display totals in the group header instead of at the bottom of the

group.

Sample File: Break examples.bqy

Steps to Produce: Create a group header, and then craft whatever summaries you want by

simply dragging data elements into the group header..

1) Create groupings as desired.

2) In the table definition area of the Outliner, drag all the dimension fields into the Table

Dimensions and the fact fields into the Fact area. Format the field widths as desired.

3) For each fact column, click on the column, then right-click and click on the “Show

Column Total” menu item to turn off that option. When finished, your table object

should have no totals showing for any columns.

4) Drag the fact fields you want totaled into the group header. Any numeric field will

automatically be totaled. If you want a different function other than summation, right-

click on the field object in the group header, select “Data Function” from the speed menu

and change the function from Sum to the desired function:

5) Add appropriate text objects to the group header to serve as labels.

Page 150: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 141

Break Totals in a single Table object **

Purpose / Use: To display group totals within a single table, with no report groups

defined.

Sample File: Break examples.bqy

Steps to Produce: Use a sorted table object and add break totals.

1) In the table definition area of the Outliner, drag all the dimension fields into the Table

Dimensions and all the fact fields into the Fact area. Format the field widths as desired.

2) For each fact column, click on the column, then right-click and click on the “Show

Column Total” menu item to turn off that option. When finished, your table object

should have no totals showing for any columns.

3) Sort the table for the desired groupings. In this example, sort on Country, then City by

dragging the Country column from the table area into the Sort line. Do the same for the

City column.

4) Right-Click on the Country column and select “Break Total…” from the speed menu. You

will see the following dialog box:

5) Select the fact columns for which you want group totals, then click “OK”.

Page 151: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 142

Cume in a Report *

Purpose / Use: To display a running total within a report table.

Sample File: Cume in a Report.bqy

Steps to Produce: Report table objects do not support the Cume() function. So, add the

Cume() function in the Results section before creating the report.

1) In the Results section, sort the data the way you will be grouping the report. In this

example, sort by State, then by Store Type

2) Create a computed item column named “Cume of Units” using this formula:

Cume ( Units, State )

This formula creates a cume() calculation for each State, then starts over at the next new

State.

3) Build your Report section as you normally would, placing the “State” field as Group1,

“Store Type” as the table dimension, and “Units” and “Cume of Units” as the table facts.

4) Right-click on the Cume of Units column, and turn OFF the “Show Column Total” option

in the speed menu that appears. (It makes no sense to do a sum of a cume.)

Page 152: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 143

Pivot Cumes across Report Groups *

Purpose / Use: To display running totals across report groups.

Sample File: Pivot Cume in Report Groups.bqy

Steps to Produce: Use a set of creative computed item columns in the Results section that

will be properly filtered by the report groups before creating the report.

1) In the Results section, sort the data the way you will be grouping the report. In this

example, sort by Region.

2) Build your base pivot as you normally would, including totals under the Years and totals

to the right of the quarters. Optionally, double-click on the Fiscal Year “Total” label and

change the text to “Regional Totals”.

3) Create the following computed item columns in the Results section:

Computed Item Name Formula

TotalByRegion if ( Prior ( Region ) == Region) {

0

} else {

Sum ( Amount_Sold, Region )

}

RunningTotal if (TotalByRegion == 0) {

0

} else {

Cume(TotalByRegion)

}

The if-else construction of the formulas eliminates multiple counting of the values. The

RunningTotal formula creates a single cume value per region, so that the current group’s

running total will appear instead of the total for all regions.

Page 153: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 144

(Pivot Cumes across Report Groups continued)

4) Insert a new Report section. Drag the Region field into the Group area of the Data Layout

as Report Group 1.

5) Drag the pivot from the catalog into the body area of the report.

6) Drag the RunningTotal field from the catalog into the body area of the report and place it

under the Quarter Totals column (on the right side of the pivot). Format as currency, set

the line color to black, then size and align with the last pivot column.

7) Drag a TextLabel from the catalog into the body area of the report and place it to the left

of the RunningTotal field. Change the text to “Running Total” and format as desired.

If your pivot has a different number of rows in each group, use the Format | Spring Objects

option to insure that the RunningTotal field and text label stay in the same relative position:

8) Click on the pivot, then Cntrl-click on the RunningTotal field. Select Format | Spring

Objects from the main menu.

9) Click on the pivot, then Cntrl-click on the “Running Total” text label. Select Format |

Spring Objects from the main menu.

Page 154: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 145

Formatted Totals (Simple) *

Purpose / Use: To highlight totals within a report table by using different font

formatting from the detail rows.

Sample File: Formatted Report Totals.bqy

Steps to Produce: Select the Totals row and change the font formatting.

1) Create your report as you normally would. Format as desired. (The example above turns

off all grid lines and suppresses duplicates in the Product Line column.)

2) Move your mouse to the Totals row and click just inside the left side of the table object as

shown below. This will select the Totals row instead of the Product Line column.

3) Right-click in the same spot, select Font from the speed menu and select the desired font

and font style.

Page 155: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 146

Formatted Totals (Robust) *

Purpose / Use: To highlight totals within a report table by using a variety of different

formatting items to distinguish it from the detail rows.

Sample File: Formatted Report Totals.bqy

Steps to Produce: Create a grouping footer and drag in formatted objects to display totals.

1) Create your report as you normally would. Format as desired. (The example above turns

off all grid lines and suppresses duplicates in the Product Line column.)

2) Select each fact column, right-click and turn OFF the “Show Column Total” option.

3) In the Outliner Report Groups area, right-click on the “Region” field and add a grouping

footer by selecting “Show Both” in the speed menu:

4) Drag the bottom border of the Body area up as high as you can to make sure it leaves no

blank space below the data table.

5) Drag a text label into the report group footer area, enter the text “ Totals:” and stretch its

width to cover the space from Product Family to Units Sold. Set the font color to white,

font size to 12, font style to bold italics and the background to dark blue as shown below.

Page 156: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 147

(Formatted Totals - Robust continued)

6) Drag the Amount Sold field from the catalog into the report group footer and place it

underneath the Amount Sold column. Numeric data fields placed in group headers or

footers automatically display the group total for that item.

7) Format the Amount Sold field object to match the desired font style and set its

background to be transparent so the background of the text label shows through.

8) Align the top of the Amount Sold field object to match the top of the text label object

from the previous step. Then move it horizontally so the decimal point lines up with

those in the detail rows.

9) Repeat steps 6 through 8 with the Unit Sold field, placing it under the table’s Unit Sold

column.

Page 157: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 148

Group Spacing in a single Table object **

Purpose / Use: To display group breaks within a single table, with no report groups

defined.

Sample File: Break examples.bqy

Steps to Produce: Use a sorted table object, add a break total, then hide the totals.

1) Build your report as in the previous example (with break totals in a sorted table object).

2) To select the group break rows, move your mouse to just inside the left margin of the

table object on the first group break row. The cursor should change to a crosshair as

shown below:

3) Click in this “left margin” area to select the row, as shown below. If you do not succeed

on the first attempt, simply move the mouse a little to the right and try again.

4) Right-click on the highlighted row and select “Font…” from the speed menu.

5) In the dialog box which appears, set the font color to be transparent.

Page 158: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 149

Multi-Line Column Reports (using table objects)

Purpose / Use: To display fields on multiple lines per record in a column-oriented

report.

Sample File: Multi-line wrapping columns.bqy

Steps to Produce: Use multiple table objects, one table object per line desired.

1) Create groupings so that the body area will hold only one record per group.

2) Turn off the group headers for all groups except the top-level group. Right-click on each

sub-group in the group area of the Outliner and select “Header” to turn it off.

3) In the table definition area of the Outliner, drag all the first-line fields into the Table

Dimensions. Format the field widths as desired.

4) Select any column in the table object, right-click and choose “Show Column Titles” to

turn off the table-based column titles.

5) With the table still selected, choose Format | Border and Background from the main

menu, and set the Border style to “None”. Select Format | Grid Lines, and set the Vertical

Grid Lines to “None”.

6) From the main menu, select Report | Insert Table, and draw out a second table in the

report’s body area.

7) Select the new table object and drag all the second-line fields into the Table Dimensions

area of the Outliner. Format the field widths as desired.

8) Select any column in the second table object, right-click and choose “Show Column

Titles” to turn off the table-based column titles. Choose Format | Border and Background

from the main menu, and set the Border style to “None”. Select Format | Grid Lines, and

set the Vertical Grid Lines to “None”.

9) Add a text object to the top-level header area to serve as column labels. Format as needed

to align the labels with the columns in the tables.

Page 159: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 150

Multi-Line Column Reports (using field objects)

Purpose / Use: To display fields on multiple lines per record in a column-oriented

report, when using multiple table objects will not produce the desired

effect.

In this example, the user wants the Street Address field to wrap to 2

lines. All other “second line” fields should appear on the same line as the

second line of the Street Address. Because this is the only multi-line field,

and because it appears in the middle of the list of fields, multiple table

objects won’t create the desired effect.

Sample File: Multi-line wrapping columns.bqy

Steps to Produce: Delete the default table object and drag individual field objects into the

report body, formatting them as needed.

1) Create report groupings so that the body area will hold only one record per group.

2) Turn off the group headers for all groups except the top-level group. To do this, right-

click on each sub-group in the group area of the Outliner and select “Header” to turn it

off.

3) Select the blank default table object and delete it.

4) Drag the desired fields directly into the body area of the report (instead of into the

Outliner). This will create a free-form report design.

5) Format and align the fields as desired.

6) To set any field to automatically word-wrap, right-click on the field and select

“Properties”. Select the “Alignment” tab in the dialog box that appears. Set Horizontal

alignment to Left, Vertical alignment to Top, and turn on the Wrap text checkbox.

Page 160: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 151

Multi-Line fields (using JS codes for new line)

Purpose / Use: To create a single text object that wraps at a pre-determined point in the

text, not simply when the width of the text object has been exceeded. In

this example, we want the various query limits of the report displayed.

Sample File: Multi-line fields.bqy

Steps to Produce: Use the special JavaScript codes for carriage return and new line as part

of the text object’s formula.

1) Create a header by selecting Report | Headers and Footers | Page Header.

2) Drag one or more field objects directly into the report header area (instead of into the

Table Outliner). This will create text objects with the correct JavaScript code to display

the selected query limit. For our example, click on the plus sign next to “Fields” in the

catalogue, and drag Query Limit into the page header. Do this once each for Product

Line, Region and Year. Each object will include the name of the field, and its current limit

setting.

3) Click on the Product Line object in the page header. Add a colon to the text in the front of

the formula, so that it now reads “Product Line: “.

4) At the end of the formula, add a + sign, and the text for the JavaScript codes for carriage

return and new line, which are “\r\n”. The formula for the Product Line object should

now look like this:

"Product Line: " + ServerLimitValues("Query", "Product

Line", "", ",")+"\r\n”

5) Select the Region object, and use the Ctrl-C key combination to copy its formula to the

Windows clipboard.

6) Select the Product Line object, go to the end of the formula text, and then hit Ctrl-V to

paste in the formula for Region. Edit the formula so it now reads:

"Product Line: " + ServerLimitValues("Query", "Product

Line", "", ",")+"\r\nRegion: " + ServerLimitValues("Query",

"Region", "", ",")

Page 161: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 152

(Multi-Line fields using JavaScript codes for new line continued)

7) As before, add a +”\r\n” to the end of the formula.

8) Select the Year field object, and use the same copy and paste logic to add it to the Product

Line object’s formula, so it now reads:

"Product Line: " + ServerLimitValues("Query", "Product

Line", "", ",")+"\r\nRegion: " + ServerLimitValues("Query",

"Region", "", ",")+"\r\nYear: " +

ServerLimitValues("Query", "Year", "", ",")

9) Clean up the report design by deleting the extra Region and Year fields.

Page 162: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 153

Multi-Line fields (using word wrap formatting)

Purpose / Use: To provide a comma-delimited list of values that automatically word-

wrap.

Sample File: Multi-line fields.bqy

Steps to Produce: Drag a field object onto the report design, then set its formatting to

word-wrap as needed.

1) Design your report as usual.

2) Drag a field object directly onto the report design surface, instead of into the Table

Outliner. If a text field is used, Hyperion Intelligence will automatically display all

unique values in a comma-delimited string.

3) Right-click on the field and select “Properties”. Select the “Alignment” tab in the dialog

box that appears. Set Horizontal alignment to Left, Vertical alignment to Top, and turn

on the Wrap text checkbox.

Page 163: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 154

Complex Narrative Reports

Purpose / Use: Many narratives are stored in multiple records, which must be merged

into a single field. In addition, some text fields used to store narratives

may contain characters that don’t translate well onto the PC. These

characters can throw off the formatting when included in a report.

Sample File: Multi-row text with spurious formatting.bqy

Steps to Produce: Create a Computed Item that uses the Cume function to merge all

related rows, and then parses the text to remove offending characters.

1) Build your query as normal and process it to fetch a representative data sample. Note that the

text for each ID is contained in multiple rows. Also note the strange square items within the

data shown below.

2) The real trick here is realizing that the Cume() function can be used on non-numeric fields.

Create a Computed Item named Description with the following formula:

Replace ( Cume ( Impact_Summary, Numberprgn ) , Chr (9) + ","

,"" )

This formula assembles all the rows from each Numberprgn (the Cume function), and then

replaces the spurious characters with nulls.

3) Create a report section, grouped on Numberprgn.

4) Place the Description field in the body, then right-click on the field and select Data Function.

Change the data function to Maximum.

Page 164: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 155

Conditional Labels

Purpose / Use: To add certain text to a mailing label only when the location has a

remodeling date (i.e., only if it has been remodeled).

Sample File: Conditional labels.bqy

Steps to Produce: Build a field-object based report that includes a JavaScript conditional

test for inserting extra text.

1) Build your query as normal and process it to fetch a representative data sample.

2) Add a Computed Item to the Results section named Remodeled that defines the conditional

text. The formula should be:

if (Date_Store_Remodeled != null) { '*** Newly Renovated ***' }

else {''}

3) Add a Report section and define a label-oriented layout by selecting Report | Report Setup

from the menu. Select the Columns tab from the dialog box that appears and define the

columns as shown below.

4) Add a Rectangle object to the design to server as a label border, and add field objects as

needed.

5) For the conditional text, add a field object, then select the object so its current definition is

displayed in the Expression box.

6) Change the Expression definition to be the following:

if (Tables("Results").Columns("Remodeled").Sum(currBreak)!='') {

Tables("Results").Columns("Remodeled").Sum(currBreak)+'\n' +

Tables("Results").Columns("Street_Address").Sum(currBreak) + '\n'

+ Tables("Results").Columns("City").Sum(currBreak) +',

'+Tables("Results").Columns("State").Sum(currBreak) +' ' +

Tables("Results").Columns("Zip_Code").Sum(currBreak) } else {

Tables("Results").Columns("Street_Address").Sum(currBreak) + '\n'

+ Tables("Results").Columns("City").Sum(currBreak) +',

'+Tables("Results").Columns("State").Sum(currBreak) +' ' +

Tables("Results").Columns("Zip_Code").Sum(currBreak) }

Page 165: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 156

Full-Row Spotlighting

Purpose / Use: To highlight an entire row of data when a particular field item is out of

scope.

Sample File: Full row spotlighting.bqy

Steps to Produce: Build a field-object based report that is formatted to look like a table

report, add a second copy of the spotlighting field and set it as a full-row

background.

Version Dependency: Requires Hyperion Intelligence v6.1.0 or higher.

1) Build your query as normal and process it to fetch a representative data sample.

2) Insert a new Report section, select the default table object and delete it. For ease of design,

you may want to display the report’s section boundaries in the report by selecting the Report

| Section Boundaries menu selection.

3) Add any grouping fields you want to use into the Report Groups area of the Outliner.

4) In your Results section, add a computed item named “One” using a formula of 1. Add this

field as the lowest report group (so far), and then delete the display of this field from the

report group’s header.

5) Select a field to be the “group-controlling field”. This is usually the left-most field in your

report “table”. In this example, the controlling field is the “Product Category”. Add this field

into the Report Groups area of the Outliner as the last group field. Delete the display of this

group-controlling field from the report group header.

6) Drag each “table” field into the group-controlling field’s report group header and format as

desired. Your report should look like this so far:

Page 166: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 157

(Full-Row Spotlighting continued)

7) In the group header associated with the “One” computed item group, drag in each of the

“table” fields, positioning them over the corresponding data fields in the group header

below. Right-click to change the data function to be “Column Name” and format to mimic a

table header.

Now your report should look like this:

8) To add summary information at the bottom of the “table”, right-click on the “One” group in

the Outliner and turn on the group footer.

9) Drag items for the summary into the “One” group’s footer.

Page 167: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 158

10) Add the spotlighting field to the lowest level group header a second time. In this example,

this is the “ASP” field.

11) Set the format of the spotlighting field to be transparent text with a transparent background.

Expand the field to cover the entire row.

12) With the new spotlighting field still selected, invoke the Spotlighter via the Format |

Spotlighter… menu selection.

(Full-Row Spotlighting continued)

13) Use the Spotlighter to set the conditional formatting such that every condition is defined to

use the same text and background colors. For example:

14) Send the new spotlighting field to the background via the Format | Layer | Send to Back

menu selection.

15) Finally, turn off the display of report section boundaries with the Report | Section

Boundaries menu selection.

Page 168: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 159

Context-Sensitive Charts / Pivots

Purpose / Use: To create a report with charts or pivots specific to the data within a

report group.

Sample File: Smartreports.bqy

Steps to Produce: Create a report with the appropriate groups, and then embed the desired

charts or pivots into either the body area or into the desired group’s

header.

1) Create the charts and pivots to be used.

2) Create the report as usual, with one or more groups defined.

3) Drag a chart or pivot into the body area of the report to make it display only those values

that pertain to the lowest level group defined.

4) Drag a chart or pivot into a report group header to make it display a summary of those

values that pertain to selected group.

5) Use the main menu, and select Report | Headers and Footers | Report Header to create a

report-wide header area. Drag a chart or pivot into the report header to make it display a

global summary of all values in the report.

Page 169: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 160

Pivots from Multiple Queries (System 9) *

Purpose / Use: To create a grouped report with pivots that are sourced from different

queries, but with common grouping data.

Sample File: Pivots from multiple queries.bqy

Steps to Produce: The challenge is getting the second pivot to be visible when the grouping

is based on the first query’s data column.

Version Dependency: Requires Interactive Reporting v9.0 or higher

1) Create the queries to be used. In this example, the year column is named Date Year in the

Sales Query, but Year in the Ad Spend Query.

2) Where necessary, change the names of the columns to be used for the common grouping

so that they are identical in all queries. In this example, we need to change the name of

the Year column in the Ad Spend Query to match the name of the corresponding year

column in the Sales Query. To do this, select the Ad Spend Query, right-click on the Year

field in the Request Line, select “Properties…” and change the Name to “Date Year” as

shown below.

3) Create the report as usual, using the Date Year column from the Sales Query as the

grouping. Drop the Sales Pivot and Ad Spend pivots into the report body. You will note

that the Ad Spend pivot does not display properly.

4) Reprocess the Ad Spend Query so that the new column name for the year column will be

present in the Ad Spend Results section. The Ad Spend Pivot will now display properly

in the Report.

Page 170: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 161

Pivots from Multiple Queries (Pre-System 9) *

Purpose / Use: To create a grouped report with pivots that are sourced from different

queries, but with common grouping data.

Sample File: Pivots from multiple queries.bqy

Steps to Produce: The challenge is getting the second pivot to be visible when the grouping

is based on the first query’s data column.

Version Dependency: Applies only to v6.x and v8.x

1) Create the queries to be used. In this example, the year column is named Date Year in the

Sales Query, but Year in the Ad Spend Query.

2) Where necessary, change the names of the columns to be used for the common grouping

so that they are identical in all queries. In this example, we need to change the name of

the Year column in the Ad Spend Query to match the name of the corresponding year

column in the Sales Query. To do this, select the Ad Spend Query, right-click on the Year

field in the Request Line, select “Properties…” and change the Name to “Date Year” as

shown in the previous tip.

3) Create the report as usual, using the Date Year column from the Sales Query as the

grouping. Drop the Sales Pivot and Ad Spend pivots into the report body. You will note

that the Ad Spend pivot does not display at all.

4) Reprocess the Ad Spend Query so that the new column name for the year column will be

present in the Ad Spend Results section.

5) Drag the Date Year field from the Ad Spend Results section into the group header of the

report. In other words, your group header will have the Date Year field from both

queries present. The Ad Spend Pivot will now display properly in the Report.

6) Hide the second copy of the Date Year field by setting its text color to be transparent.

Page 171: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 162

Displaying multiple charts / pivots on 1 page

Purpose / Use: Sometimes, you want to be able to see multiple charts or pivots on a

single page.

Sample File: Smartreports.bqy

Steps to Produce: Create a report section with no groups, and embed the desired charts

and pivots in the body area.

1) Add a new Report section. Do not define any groups. (Groups will create context-sensitive

charts and pivots.)

2) Select the blank default table object and delete it.

3) Drag all desired charts and pivots into the report’s body area.

4) Format page headers, page footers and graphical elements as desired.

Page 172: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 163

Per-Portion Charts on 1 page

Purpose / Use: Display multiple charts that show the same data for different groups on

a single page.

Sample File: 100% of region.bqy

Steps to Produce: Create a report section with no groups, and embed the desired charts

and pivots in the body area.

1) Create your query and process it to fetch representative data.

2) For each chart group, create a new Table section from the Results, and then define a local

limit to display only 1 group’s data within each table section.

3) For each group Table section, build a chart to display the group data. Make sure every

group chart is designed in exactly the same manner.

4) Add a new Report section. Do not define any groups. (Groups will create context-sensitive

charts.)

1) Select the blank default table object and delete it.

2) Drag all desired charts into the report’s body area.

3) Format page headers, page footers and graphical elements as desired.

Page 173: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 164

Chart and Summary Data on 1 page

Purpose / Use: To display a chart and its summary details on a single page.

Sample File: Pie chart with totals.bqy

Steps to Produce: Create a report section with no groups, and embed the desired chart and

summary data in the body area.

1) Build your chart as usual.

2) If you want to display the summary as if it were a part of the chart’s sub-title, define a sub-

title with a value of “Total Dollars = “. The extra spaces help center the text

properly for its eventual display.

3) Insert a new Report section.

4) Select the blank default table object and delete it.

5) Drag the chart into the report’s body area.

6) Drag the field object that represents the data to be summarized into the report’s body area.

Align the field so that it appears to be part of the chart’s sub-title.

Page 174: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 165

Easy Labels for Free-Form Fields

Purpose / Use: To easily create field labels with no typing.

Sample File: Easy Labels.bqy

Steps to Produce: Use the Data Function feature to create a field label.

1) Build your report as you normally would.

2) Drag the desired free-form field onto the report design.

3) Drag the same field onto the report a second time. Format and align both copies as needed.

The display should look something like this:

4) On the copy that will be the label, right-click on the field, and select Data Function |

Column Name from the speed menu.

Page 175: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 166

Custom Display Format for Limits

Purpose / Use: To display limit values in a custom format.

Sample File: Display custom report limits.bqy

Steps to Produce: Change the data function string of the limit field to show the values the

way you want.

1) Build your report as you normally would.

2) Drag the desired limit field into the report’s page header. If the limits have start and end

values (such as dates), drag both of them in. The report header should look like this:

3) Click on the start value and edit its formula to look something like this:

"Data shown is filtered for dates from

"+Format(Tables("Results").Columns("Start_Date").Sum(currBreak),"

mmmm dd, yyyy")

4) Click on the second limit field, highlight its formula and use Ctrl-C to copy it to the

Windows clipboard. Then delete the second limit field.

5) Click on the first limit field and paste the formula from the second into the end of the

formula string for this first field. Then edit the formula to look like this:

"Data shown is filtered for dates from

"+Format(Tables("Results").Columns("Start_Date").Sum(currBreak),"

mmmm dd, yyyy")+" through

"+Format(Tables("Results").Columns("End_Date").Sum(currBreak),

"mmmm dd, yyyy")

6) Format the font of the limit string as desired.

Page 176: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 167

Multi-Line Bar Chart (pre-v9.3)

Purpose / Use: To display a Bar-Line Chart that has 1 bar and multiple lines.

Sample File: Multi-line bar chart.bqy

Steps to Produce: Create a report section with no groups, embed a specially formatted bar-

line chart and design a custom chart legend in the report section.

Version Dependency: Applies only to v6.x through v9.2. This tip is no longer needed in v9.3.

The challenge stems from the fact that, prior to v9.3, bar-line charts work with pairs of values,

one being a bar and one being a line. The trick is getting the chart and its legend to display only

the first value as a bar and all others as lines.

1) In the Results section, create a computed item named “Dummy” with a formula of 0.

2) Add a new chart and change its chart type to be a bar-line chart by selecting the last item in

the chart type pulldown.

3) Drag the field to be displayed as a bar into the Outliner as the first item in the Y-Facts area.

4) Drag the field to be displayed as the first line into the Outliner as the next item in the Y-

Facts area.

5) Create subsequent bar-line groupings by dragging the Dummy field as the bar (with a

value of zero) and the next line-oriented field as its bar-line group partner. Your chart

should now look like this:

Page 177: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 168

(Multi-Line Bar Chart continued)

Note that the chart displays the data exactly as desired, but the legend displays the dummy

fields as well. We’ll use the Report section to override the way the legend is displayed.

6) Insert a new Report section. Do not define any groups. (Groups will create context-

sensitive charts.)

7) Select the blank default table object and delete it.

8) Drag the chart into the report’s body area.

9) Drag a box object on top of the chart’s legend to hide it (or you can simply hide the legend

by going into the chart section, right-clicking on the legend and selecting “Hide Legend”

from the speed menu).

10) Use other report section objects to build a custom legend display from scratch. You may

want to use embedded BMPs to display the proper legend “widgets” (such as diamonds,

etc.)

Page 178: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 169

Annotated Chart

Purpose / Use: To build a report that displays a chart with associated data in tabular

format.

Sample File: One Bar with Multi-Lines and Table.bqy

Steps to Produce: This tip requires some coordinated formatting of a pivot and a chart.

1) Create a Multi-line Bar Chart as in the previous tip.

2) While displaying the chart, select Insert | Pivot This Chart from the menu. Remove the

dummy zero fields from the facts. Your pivot should now look like this:

3) Remove the side labels.

4) Right-click anywhere blank and select Data Labels | Down Side. The pivot should now

look like this:

Page 179: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 170

(Annotated Chart continued)

5) Add the Month date field to the top labels.

6) Select the entire top label row by clicking on the tab on the far right. Right-click on the

Month label and select Number… and define a Custom format of mmm-yy.

7) Speed fit all the column sizes.

8) Next, format the pivot for a tabular-style display in the report section.

• Set the background color to white for all elements, and the font to 8 pt. Arial.

• Select all the Fact labels. Set the border style to “Horz and Vert”, and then right align

the text. Increase the width of the Fact labels (to allow room for annotation graphics to

be added later).

You should now see a pivot that looks something like the next figure shown below.

9) Add a new Report section, removing the default table object.

10) Expand the Body area to fill the entire page. Add the Chart to the top of the body area and

then the Pivot to the bottom of the body area. Move the chart so that the bottom X-axis line

is covered by the top of the pivot. Resize the chart so that the bar widths and locations

match those in the pivot.

11) Add graphical elements to the left side of the pivot to create a legend.

Page 180: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 171

Grid Report *

Purpose / Use: To build a report that displays ratings visually in a grid instead of

numerically.

Sample File: Grid Report.bqy

Steps to Produce: This tip requires some creative use of a free-form (ie, non-tabular) report.

1) In your Results section, create a set of computed columns to “dimensionalize” the grid

ratings into separate columns.

Computed Item Name Formula

Quad1 if ( Quad == 1 ) { Name }

Quad2 if ( Quad == 2 ) { Name }

Quad3 if ( Quad == 3 ) { Name }

Quad4 if ( Quad == 4 ) { Name }

These formulas will result in the names being split out into separate columns based on

their grid rating.

2) Insert a new Report section. Drag the Employee field into the Report Group area of the

Outliner.

3) Drag a Horizontal Line object into the body area of the report. Do the same with a

Vertical Line object. Size and position both lines to form a grid display, as shown below:

Page 181: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 172

(Grid Report continued)

4) Drag the Quad1 field into the upper left area of the grid. (Dropping a column f text data

onto a non-tabular report will produce a comma-separated list of unique values.) Resize

the field object to fill the upper left grid quadrant.

5) Double-click the field object to bring up the properties dialog. Click on the Alignment tab

and set Horizontal Alignment to Center and turn ON the “Wrap text” property. Your

report should now look like this:

6) Repeat the process for the other grid quadrants, dragging Quad2 into the upper right,

Quad3 into the lower left and Quad 4 into the lower right.

7) Align the tops of the 2 upper quadrant field objects. Repeat for the lower 2. Align the left

sides of the 2 left quadrant field objects. Repeat for the right 2.

8) Continue formatting as desired. You may want to add text labels to each of the grid

quadrants to identify what each grid area is supposed to represent.

Page 182: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 173

Page Numbers by Group Report *

Purpose / Use: To build a report with page numbers that reset to 1 when changing from

one group to another.

Sample File: Page Numbers by Group.bqy

Steps to Produce: This tip uses a series of computed item columns, plus a “hidden” report

group instead of a page footer. Note that this tip assumes that no

columns have word wrap turned on so as to insure that the same

number of rows fit on each report page.

1) Build your report as you normally would. Make sure to select the “Repeat Header”

option for the Region. In the Outliner, right-click in the Report Group area on the Region

field and select “Show Both” from the speed menu. This will create a group footer.

2) Scroll down in your report to where the group changes so you can view the group footer.

Right-click in the group footer and select “Page Break After”. This will force a new page

after each region.

3) In your Results section, create a set of computed columns to calculate the line number

within the group of each data row.

Computed Item Name Formula

Cntr 1

Line No Cume(Cntr, Region)

Page 183: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 174

(Page Numbers by Group Report continued)

4) Add the Line No field to your report design as the first column. Sort the report table on

the Line No column. Your report should now look something like this:

Scroll down the first page to see how many lines appear on a page. Note this number,

then remove the Line No field from your report. In this example, the number of lines per

page is 37.

5) In your Results section, create a set of computed columns to calculate the page number

for each data row and the total pages for each group.

Computed Item Name Formula

Page No Floor ( Line_No / 37 ) + 1

Num of Pages ColMax ( Page_No, Region )

NOTE: In the formula for the “Page No” column, replace the 37 listed above with your actual number of lines per page.

6) Return to the Report section and add the Page No field as Report Group 2.

7) In the Outliner, right-click in the Report Group area on the Page No field and select

“Show Both” from the speed menu. Right-click again and select “Header”. This will

create a group footer with NO group header.

8) Scroll down in your report to the bottom of the page so you can see the Page No group

footer. Drag the “Page No” and “Num of Pages” fields into the Page No group footer.

Right-click on each and select “Data Function” | “Maximum”.

9) Click on the “Page No” field and edit the formula shown in the expression bar to add

[“Page: “+] (without the brackets) to the beginning of the formula.

10) Click on the “Num of Pages” field and edit the formula shown in the expression bar to

add [“of “+] (without the brackets) to the beginning of the formula.

11) Move the fields to be next to each other and aligned. Format as desired.

Page 184: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 175

Calendar-style Reports

Purpose / Use: To build a report that displays daily information in a calendar-style

format.

Sample File: Calendar.bqy

Steps to Produce: This tip requires some imaginative formatting of a pivot, which will then

get embedded in the report. The key is to have a week number column

that you use as a side label and put the days of the week in a top label.

The day number is the fact for the pivot. The resulting pivot won’t make

sense until you drop it into a report section grouped by Year and Month.

1) You start with two tables. The first (Periods2000.xls in this example) has date, year

number, month number, day number, ordinal day of the week (Sunday = 1 through

Saturday = 7), and week number. The week number starts with a value of 1 for the first

day of the year and then increments by 1 every Sunday. The second table (SALES.XLS in

this example) has date, units, and dollar amount.

2) If a column for the name of the day doesn’t already exist in the Periods2000 results, create

a Grouping Column named “Day” to convert the ordinal day of the week into a day

name.

Page 185: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 176

(Calendar-style Reports continued)

3) Create another Grouping Column called “Month Name” to create names for each month

based on the “Month_No” column.

4) Now, create a local join query that links the Periods2000 data with the data to be

analyzed. Include all of the Periods2000 columns in the Request line of the query.

Double-click on the join line that links the Full Date in Periods2000 to the Order Date in

the Sales data. Set the join Properties to display all rows in the Periods2000 data set and

those Sales rows that have dates in Periods2000 (a left join in this example).

5) Once the local join query is processed, insert a new pivot section based on the Results of

the local join query.

• Place Week_No in the Side Labels

• Put DOW and Day in the Top Labels

• Place Day_No, Units and Amount in the Facts

• Right-click somewhere in the pivot, select the Data Labels option from the speed menu

and set it to “Down Side”.

• Right-click on the Day_No row and change the data function to be “Minimum”.

Because of the left join, the pivot will show “N/A” on any date with no sales data. You

should now see something similar to the figure shown below.

Page 186: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 177

(Calendar-style Reports continued)

6) Next, format the pivot for calendar-style display in the report section.

• Select the Week_No label column, set both its text and fill colors to “Transparent”, its

border type to “None”, and then make the column as thin as possible. This is to hide it

from the final display.

• Select the DOW label row, set both its text and fill colors to “Transparent”, its border

type to “None”, and then make the column as short as possible. This is to hide it from

the final display also.

• Now select the Day label row. Set its text color to white and its fill color to blue. Set the

font to be bold, the border style to “Horz and Vert”, and then center align the text.

• Select the three fact labels, set their fill colors to “Transparent”, their border style to

“None” and right-align the text.

• Select just the Day_No fact label and set its text color to “Transparent”.

• Select the Day_No row and set its font style to bold.

• Select the Units and Amount fact rows, set the border style to “Vertical” and left-align

the text.

You should now see a pivot that looks something like the next figure shown below.

Page 187: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 178

(Calendar-style Reports continued)

7) Finally, create a Report section to hold the final calendar.

• Place the Year_No field in Report Group 1, and both Month_No and Month_Name into

Report Group 2.

• Delete the Month_No field that appears in the group 2 header, leaving only the Month

Name. Move the Month Name to the top of the Group 2 header.

• Select the Year_No item in the Group 1 header, copy it to the clipboard and then paste

it into the Group 2 header. Move it to be underneath the Month Name, right-click on it.

Select “Properties” and change its Number format to be “###0”. Delete Year_No from

the Group 1 header.

• Select the Table object in the Report’s body and delete it.

• Select the Group 2 header, right-click and select “Keep Together” from the speed

menu. Then drag the formatted pivot into the Group 2 header area. Adjust the pivot’s

location within the Group 2 header as needed but do not change the vertical size of the

Group 2 header after inserting the pivot.

• You will notice that each month’s calendar is missing the bottom line. To add a floating

bottom line, drag a Horizontal Line object into the body area of the report. Size the line

to be the same width as the pivot. Use the cursor keys to place the line at the extreme

bottom of the pivot. (You may want to Zoom the report to check for exact placement of

the line.)

• Click on the horizontal line, then shift-click on the pivot in the same body section. With

both the line and the pivot selected, go to the main menu and use the Format | Spring

Objects menu item. This will set the line so that it will automatically float with the

pivot as the pivot changes height for each month.

Page 188: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 179

9 Scripting Tips

Sometimes what you want to accomplish requires the use of JavaScript coding. This can take the form of creating a dashboard section, or of merely coding some JavaScript actions into a document event such as OnPreProcess or OnPostProcess.

While not an exhaustive discourse on the full scripting capabilities found in a BQY file, this section gives you a few tips on how to use scripting to automate the creation of certain “new” features without having to create a dashboard section.

Page 189: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 180

Formatted Export (pre-v8.5) **

Purpose / Use: To export data to Excel while preserving the formatting.

Sample File: Formatted export in v8.bqy

Steps to Produce: This tip uses an export to HTML to preserve the formatting in versions of

Hyperion Intelligence prior to the inclusion of the MS Office export

format that was added to v8.5 and to System 9.

Version Dependency: Applies only to v6.x through v8.3. This tip is no longer needed in v8.5

and higher.

1) Create your formatted display as normal.

2) You can add scripting to the OnPostProcess event if you want the export to happen

automatically after processing the query. To access the OnPostProcess event, select File |

Document Scripts from the main menu, then select OnPostProcess from the pulldown as

show below:

3) You will use JavaScript code to export the display to HTML format. The code will have to

set the HTML export options so that the formatting is stored in the HTML file itself, not

in a separate Cascading Style Sheet. The code will also have to set the page break so that

all rows get exported to a single HTML file.

Page 190: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 181

(Formatted Export in pre-v8.5 continued)

4) In either the OnPostProcess event, or on a command button on a dashboard, enter the

following JavaScript code:

// Export to HTML with style info embedded in the HTML

ActiveDocument.Sections["Results"].CSSExport = false

// Export with no page breaks

NumRows = ActiveDocument.Sections["Results"].RowCount

ActiveDocument.Sections["Results"].HTMLExportBreakRowCount =

NumRows

// Set temp output file location, then export to HTML

OutputFile = "C:\\Exports\\FormattedResults.htm"

ActiveDocument.Sections["Results"].Export(OutputFile,

bqExportFormatHTML, false)

// Launch Excel and open the formatted HTML file

Exe = "C:\\Program Files\\Microsoft Office\\OFFICE11\\Excel.exe"

Application.Shell(Exe, OutputFile)

NOTE: For the above code to work, you MUST create a directory on your C: drive named “Exports”.

Page 191: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 182

User-controlled Range-based analysis **

Purpose / Use: You may want to create value ranges based on user input (without

creating a dashboard section).

Sample File: Variable ranges.bqy and Variable Ranges.xls

Steps to Produce: We want to define a column that displays range-based data, using a

user-defined input to determine the low and high end of the ranges.

Whenever a user updates the Excel data file and reprocesses the BQY,

the report will adjust its ranges based on the values in the Excel file.

1) In the Results section, add a new Computed Item. Call it Order_Size, and define its

formula to be:

x = Revenue ;

'Very Large Order' ;

if (x <= 8000) {'$7001 to $8000'} ;

if (x <= 7000) {'$6001 to $7000'} ;

if (x <= 6000) {'$5001 to $6000'} ;

if (x <= 5000) {'$4001 to $5000'} ;

if (x <= 4000) {'$3001 to $4000'} ;

if (x <= 3000) {'$2001 to $3000'} ;

if (x <= 2000) {'$1001 to $2000'} ;

if (x <= 1000) {'$ 500 to $1000'} ;

if (x <= 500) {'$ 0 to $500'} ;

if (x >= valLarge) {'Very Large Order'} ;

if (x <= valSmall) {' Small Order'} ;

This formula is like the “Creating Range-based analysis without ELSE” tip, but provides

logic to override the low and high end of the ranges based on values stored in variables.

2) Build the Order_Count computed item and pivot as before.

3) Use the File | Import Data File | Data File… menu to add the Variable Ranges.xls file to

the BQY design. This file will be the basis for the values stored in the override variables.

Page 192: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 183

(User-controlled Range-based analysis continued)

4) Use the File | Document Scripts menu and add the following code to the OnStartup

method to set default values for the low and high end of the ranges:

valLarge = 5000

valSmall = 500

5) In the Event Trigger pulldown at the top of the editor, select OnPostProcess and enter the

following code to read the new values and update the display ranges:

valLarge = ActiveDocument.Sections["Variable

Ranges.xls"].Columns["Large"].GetCell(1)

valSmall = ActiveDocument.Sections["Variable

Ranges.xls"].Columns["Small"].GetCell(1)

ActiveDocument.Sections["Results"].Recalculate()

ActiveDocument.Sections["FY96 vs FY97"].Recalculate()

ActiveDocument.Sections["Range-based Analysis"].Recalculate()

6) To use this capability, the user simply needs to open the Variable Ranges.xls file, edit the

high and low values, then save and close the XLS file. When the user hits the “Process

All” button in the BQY file, the latest version of the XLS file will be read with the new

values and the pivot display will be updated.

Page 193: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 184

Prompt Once for Multiple Queries *

Purpose / Use: You may want to provide user prompting for limit selections, but you

only want to prompt once and reuse the selection values in all queries

without having to create a dashboard.

Sample File: Prompt once for multiple queries.bqy

Steps to Produce: Set up only the first query with variable limits. Then define an

OnPreProcess event that copies the limit selections to the other queries.

1) Build your queries as you normally would. Add variable limits to the first query to

provide user limit selection prompting. In this example, we will be using limits on the

Region and Country fields.

2) In all other queries, add regular limits (not variable ones) that correspond to the limits

created in the first query.

3) Use the File | Document Scripts… menu selection, then select OnPreProcess from the

script editor Event Trigger pulldown:

Page 194: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 185

(Prompt once for multiple queries continued)

4) Add code to the OnPreProcess event that will copy the limit selections from the

SelectedValues collection of the first query to the SelectedValues collection of the other

queries. (The OnPreProcess event fires after user selections have been made but before

the query is submitted to the database.) An example set of code is shown below:

if (ActiveDocument.QueryInProcess == "Folder Query") {

// then we are running the first query

fq = ActiveDocument.Sections["Folder Query"]

aq = ActiveDocument.Sections["Advertising Query"]

//

// Copy all Region selections from Folder Query to Ad Spend Query

//

numRegions = fq.Limits["Region"].SelectedValues.Count

aq.Limits["Region"].SelectedValues.RemoveAll()

for (i=1; i<=numRegions; i++) {

valRegion = fq.Limits["Region"].SelectedValues.Item(i)

aq.Limits["Region"].SelectedValues.Add(valRegion)

}

//

// Copy all Country selections

//

numCountries = fq.Limits["Country"].SelectedValues.Count

aq.Limits["Country"].SelectedValues.RemoveAll()

for (i=1; i<=numCountries; i++) {

valRegion = fq.Limits["Country"].SelectedValues.Item(i)

aq.Limits["Country"].SelectedValues.Add(valRegion)

}

}

5) Select “Process All” from the toolbar to execute all the queries, prompting the user to

make selections for Region and Country that will be applied to all queries.

Page 195: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 186

Clear All Data Displays on Opening *

Purpose / Use: You may want users to start with a totally clean set of displays. The

problem is that even when you do NOT save Results, the chart, pivot

and other sections retain a copy of the data.

Sample File: Clear All Data.bqy

Steps to Produce: Set up a dummy filter in the OnStartup event and then clear it in the

OnPreProcess event.

1) Build your query as you normally would and design your report sections.

2) Add a limit on one of the columns in your Results section. Set the selected value to

something that does not exist in the actual database. In this example, create a local limit

on the Region field and set its value to “Unknown”.

3) Select File | Document Scripts… from the main menu and add the following code to the

OnStartUp event:

limName = ActiveDocument.Sections["Results"].Limits["Region"]

limName.SelectedValues.RemoveAll()

limName.SelectedValues.Add("Unknown")

limName.Ignore = false

4) While still in the script editor, select the OnPreProcess event from the Event Trigger

pulldown and add this code:

ActiveDocument.Sections["Results"].Limits["Region"].Ignore = true

Page 196: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 187

Zero-Footprint Report Creation *

Purpose / Use: Web-based users running in iHTML mode may want to build their own

Report sections. While a user interface exists for creating all other section

types, none exists for the Report section yet.

Sample File: ZF Report Creation.bqy

Steps to Produce: Set up a blank report section and then “fill it in” in the OnPostProcess

event.

Version Dependency: Requires v9.0 or higher to provide ad-hoc query building in iHTML

mode without having to build a dashboard UI.

1) Build your query as you normally would.

2) Insert a new Report section and leave the blank table object as-is. Format as desired.

3) Select File | Document Scripts… from the main menu, select the OnPostProcess event

from the Event Trigger pulldown and add this code:

SQL = ActiveDocument.Sections["Query"].LastSQLStatement

OrdrBy = SQL.split("ORDER BY ")

Sorts = OrdrBy[1].split(",")

numGrps = Sorts.length

//

// Add report groups based on what is in the Sort line

//

ActiveDocument.Sections["Report"].Groups.RemoveAll()

for (i=1; i<=numGrps; i++) {

// The ORDER BY syntax produced by IR is "ORDER BY 1,3" etc. as a string.

// The "*1" syntax below forces a typecasting to numeric so we can use it

// to add the field by number

numItem = Sorts[i-1] * 1

Page 197: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 188

(Zero Footprint Report Creation continued)

Field = ActiveDocument.Sections["Query"].Requests.Item(numItem)

ActiveDocument.Sections["Report"].Groups.Add(Field.DisplayName,

"Results")

// Change from default group header to one that includes the name of

// the field used as a string in front of the value

strFormula =

ActiveDocument.Sections["Report"].Groups.Item(i).Header.Fields.Item(1).Fo

rmula

strFormula = ' " ' + Field.DisplayName + ': " + ' + strFormula

ActiveDocument.Sections["Report"].Groups.Item(i).Header.Fields.Item(1).Fo

rmula = strFormula

ActiveDocument.Sections["Report"].Groups.Item(i).Visible = true

// Finally, add some group break control

ActiveDocument.Sections["Report"].Groups.Item(i).Footer.PageBreak =

bqPageBreakAfter

}

//

// Add any previously used items from the default table object

//

ActiveDocument.Sections["Report"].Body.Tables["Table"].Dimensions.RemoveA

ll()

ActiveDocument.Sections["Report"].Body.Tables["Table"].Facts.RemoveAll()

numFlds = ActiveDocument.Sections["Results"].Columns.Count

//

// Add all other (ie, non-grouping) items from the current query to the

// now-blank default table object

//

for (i=1; i<=numFlds; i++) {

NotAGrp = true

// Check to see if current field number is used in the ORDER BY

// (In other words, has it already been added as a group header)

for (j=1; j<=numGrps; j++) {

numItem = Sorts[j-1] * 1

if (numItem==i) {

NotAGrp = false

}

}

if (NotAGrp) {

// Only add fields to the table that haven't already been added

// as a group

Field = ActiveDocument.Sections["Results"].Columns.Item(i)

if ( (Field.DataType == bqDataTypeNumber) || (Field.DataType ==

bqDataTypeInteger) ) {

ActiveDocument.Sections["Report"].Body.Tables["Table"].Facts.Add(Field.Na

me, "Results")

} else {

Page 198: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 189

(Zero Footprint Report Creation continued)

ActiveDocument.Sections["Report"].Body.Tables["Table"].Dimensions.Add(Fie

ld.Name, "Results")

}

}

}

//

// Display resulting report

//

ActiveDocument.Sections["Report"].Activate()

4) Launch the System 9 Workspace and import your BQY into the appropriate Connections

folder.

Page 199: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 190

10 Dashboard Tips

Sometimes what you want to accomplish requires the use of a dashboard section to bring multiple objects together in a coordinated fashion. Some of these solutions require no coding, while others use a combination of dashboard capabilities and JavaScript coding.

While not an exhaustive discourse on the capabilities found in a dashboard section, this section gives you a few tips on how to use dashboards to create “new” kinds of “report” displays.

Page 200: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 191

Bar-Line with Multiple Lines (pre-v9.3) **

Purpose / Use: To display a Bar-Line chart that has 1 bar, multiple lines, and a legend

that “builds itself” with no strange blocks.

Sample File: Bar with Multiple Lines.bqy

Steps to Produce: This tip uses a dashboard section’s ability to overlay multiple objects on

a screen.

Version Dependency: Applies only to pre-v9.3 editions. This tip is made unnecessary by native

functionality in v9.3 and above.

1) Create your query as normal.

2) Insert a new chart section. Define it with the Fiscal Year as the X-Category and the field

to be used as the Bar in the Y-Facts (the Funding field in this example). Leave the chart

type as Vertical Bar.

3) Change the title text to be “Requirements vs Funding” (even though it only has funding

data). Set the border on the legend and on the chart as a whole to be Transparent. Your

bar chart should look like this:

Page 201: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 192

(Bar-Line with Multiple Lines & Auto-Legend continued)

4) Insert a second chart section. Define it with the Fiscal Year as the X-Category and the

fields to be used as the lines in the Y-Facts (the Requested, Validated and Critical fields in

this example). Make sure that the Y-Axis scale is set to exactly match the one in the first

chart.

5) Change the chart type to be Line. Set the border on the legend, the border on the chart,

the chart background, and the grid lines to be Transparent. Turn off the chart title, all tick

marks, Y-Axis and X-Axis labels. Position the legend below where the first chart’s legend

would be. Your line chart should look like this:

6) Insert a new Dashboard Section. In design mode, drag in the first chart, then position and

size it as desired. Double-click the chart and select the “Hyperlink” radio button in the

“Make embedded section:” area on the right side of the Properties dialog box.

7) Right-click on the chart and select “Scripts…” from the speed menu. Comment out the

code with a double slash as shown below:

// ActiveDocument.Sections.Item("Funding Chart").Activate();

8) In the same dashboard section, drag in the second chart. Once again, double-click on the

chart and set its embedded section property to be “Hyperlink”. Then right-click, select

“Scripts…” and comment out the code for the second chart as well.

9) Click on the first chart, then Shift-Click on the second chart. Use the Section toolbar to set

the second chart to match the height and width of the first chart.

Page 202: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 193

(Bar-Line with Multiple Lines & Auto-Legend continued)

10) While both charts are still selected, use the alignment tools in the Section toolbar to left

and top align the two charts. You may need to adjust size and positioning a bit to insure

proper overlap.

11) Your dashboard should now look like this:

12) Finally, draw a rectangle around all legend elements, making it look like a single legend

instead of two that are overlaid.

Page 203: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 194

“No Data” Display Message **

Purpose / Use: To display a “no data” message when no data is available for the current

filter conditions, but display the chart when data is available.

Sample File: No Data Text Message.bqy

Steps to Produce: This tip uses code in the OnPostProcess event to switch a dashboard

between a static “message” display and the actual chart display.

1) Create your query and chart as normal.

2) Create a variable limit and set the filter conditions on the query to retrieve no data.

3) Select the chart section and change the title of the chart to be “Empty Chart”.

4) Export the now empty chart to a JPG file.

5) Insert a dashboard section and add a picture object. Use the JPG export of the blank chart

as the picture. Name the picture object “PictNoData”, size it appropriately and center it

on the dashboard.

6) Add a text label to the dashboard and name it “txtNoData”. Set the text to be “No Data

Available”. Set the font to be 18 point bold. Center the text label in the middle of the

picture object.

Page 204: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 195

(“No Data” Display Message continued)

7) Your dashboard should look like this so far:

8) Add the chart section to the dashboard. Name the embedded chart object as

“ChartData”. Size and position it so that it completely covers the picture and text label

objects. Double-click on the chart and set its Visible property to be off.

9) Select File | Document Scripts… from the main menu. Select OnPostProcess from the

pulldown and add the following code:

if ( ActiveDocument.Sections["Results"].RowCount > 0 ) {

// Then we have data to display

ActiveDocument.Sections["Dashboard"].Shapes["txtNoData"].Visible =

false

ActiveDocument.Sections["Dashboard"].Shapes["PictNoData"].Visible =

false

ActiveDocument.Sections["Dashboard"].Shapes["ChartData"].Visible =

true

} else {

// We need to display the “no data” message

ActiveDocument.Sections["Dashboard"].Shapes["txtNoData"].Visible =

true

ActiveDocument.Sections["Dashboard"].Shapes["PictNoData"].Visible =

true

ActiveDocument.Sections["Dashboard"].Shapes["ChartData"].Visible =

false

}

NOTE: Take care to make sure you add the code to the OnPostProcess event, not to the default OnStartup event.

Page 205: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 196

Custom Colors (pre-v9.3) *

Purpose / Use: Sometimes you need to match the background of a custom logo.

Unfortunately, most logo background colors do not conform to the

standard colors available in the Hyperion color palette.

Sample File: Custom colors.bqy

Steps to Produce: Any color can be set via code, as long as you know how to translate the

RGB numbers into a single value. Either hex or decimal numbers can be

used.

Version Dependency: Applies only to pre-v9.3 editions. This tip is made unnecessary by native

functionality in v9.3 and above.

1) Create your dashboard as usual. Make sure you are still in Design mode (the rulers

should be showing on the top and left).

2) In this example, the logo background color has an RGB value of R=1, G=1 and B=130. To

set this value as the fill color, translate this into a single decimal value using the

following formula:

Color Value = (R*256*256) + (G*256) + B

In this example, that means (1*256*256) + (1*256) + 130 = 65922

3) Add code to your dashboard (typically in the OnActivate event) to set the Fill.Color

property of the background object to match the color of the logo background. In this

example, the code would be:

Rect1.Fill.Color = 65922

Page 206: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 197

(Custom Colors pre-v9.3 continued)

4) An alternative that might be easier would be to use the hexadecimal equivalent of the

RGB numbers instead of the decimal calculation listed above. Each RGB number would

be a separate 2-digit hex number. The format of a hex number is 0x######, and the RGB

numbers are used in sequence as 0xRRGGBB. So in this case, you would have a hex RGB

number of 0x010182 (B = 130 = 8*16 + 2). In this example, the code would be:

Rect1.Fill.Color = 0x010182

Page 207: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 198

Custom Colors (v9.3) *

Purpose / Use: Sometimes you need to match the background of a custom logo.

Sample File: Custom colors.bqy

Steps to Produce: Any color can be set in v9.3 via the user interface, as long as you know

the RGB numbers to use.

Version Dependency: Requires v9.3 or higher.

1) Create your dashboard as usual. Make sure you are still in Design mode (the rulers

should be showing on the top and left).

2) In this example, the logo background color has an RGB value of R=1, G=1 and B=130. To

set the fill color of the rectangle behind the logo, click on the rectangle to select it.

3) While the rectangle is selected, click on the Fill Color icon in the toolbar. The decimal

RGB values can be entered on the right side of the color selector, as shown below.

4) Finally, click in the space below the RGB edit boxes, then click on the Fill Color icon

again. This will set the fill color of the rectangle to the selected RGB color values.

Page 208: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 199

Fetching the Windows Username *

Purpose / Use: Sometimes you need to run logic based on the user’s Windows login

properties.

Sample File: Username Windows.bqy

Steps to Produce: Windows scripting provides a simple way to fetch information from

Windows.

Added Dependency: This tip requires that Windows scripting be installed on the user’s

machine. (It is usually included by default in a normal Windows install.)

1) Create your dashboard as usual. Make sure you are still in Design mode (the rulers

should be showing on the top and left).

2) Add code (typically in the OnStartup or OnActivate event) to use Windows scripting to

determine the current user’s Windows login information. Use the following code to fill in

this information into a textbox on the dashboard:

var oleApp = new JOOLEObject("WScript.Network");

domain = oleApp.UserDomain;

user = oleApp.UserName;

TextBox1.Text = 'Domain=' + domain + ', User=' + user;

NOTE: This code will only work in the desktop client and plug-in modules. It will not work in zero footprint mode. Use the ODSUsername property instead in web-based documents.

Page 209: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 200

Tagging Listbox Selections *

Purpose / Use: Sometimes you need to visually show which items the user has already

selected. Unfortunately, no method exists for modifying a Listbox item’s

text, nor does one exist for removing only one item.

Sample File: Update a ListBox.bqy

Steps to Produce: Save the initial state of the Listbox items in an array, then modify the

array members and use the array to completely re-create the list.

1) Create your dashboard as usual. Make sure you are still in Design mode.

2) Select File | Document Scripts… to add code to your OnStartup event. Enter the

following code to save the initial Listbox items in an array.

//

// Save all the original ListBox values

//

NumLBItems =

ActiveDocument.Sections["Dashboard"].Shapes["ListBox1"].Count

aLBItems = new Array(NumLBItems)

for (i=1; i<= NumLBItems; i++) {

aLBItems[i] =

ActiveDocument.Sections["Dashboard"].Shapes["ListBox1"].Item(i)

}

3) Now add code to the dashboard to update the array’s copies of the Listbox item and then

re-add them to the Listbox. This code can reside in a CommandButton, or in the

OnSelection event of the Listbox itself:

// Update the text of the selected item

if (ListBox1.SelectedList.Count > 0) {

NumItem = ListBox1.SelectedList.ItemIndex(1)

aLBItems[NumItem] = aLBItems[NumItem] + " - Selected"

}

// Now totally replace the ListBox with the updated list

ListBox1.RemoveAll()

for (i=1; i<= NumLBItems; i++) {

ListBox1.Add(aLBItems[i])

}

Page 210: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 201

Double-Click Drill from a Pivot *

Purpose / Use: To create a dashboard lets a user drill to further detail in a different

display, filtered based on what dimensions were clicked on.

Sample File: Double-Click Drill from Pivot.bqy

Steps to Produce: This tip uses code in the OnCellDoubleClick event of a dashboard’s pivot

object to determine where the user double-clicked and to take action

accordingly.

Version Dependency: Requires Hyperion Intelligence v8.2 or higher

1) Create your query to retrieve the detail information needed in the detail report you will

create.

2) Create your summary pivot as normal.

3) Add a Table section and copy all the fields into the design. Add filters to this table

section to provide the detail filtering the user will see when they double-click on a pivot

cell.

4) Insert a new Report section. Build a detail report based on the Table section fields, not on

the Results section fields.

5) Insert a new Dashboard section. Drag your pivot into the dashboard. Size and position as

desired.

Page 211: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 202

(Double-Click Drill from a Pivot continued)

6) While still in design mode, right-click on the pivot object and select “Scripts…” from the

speed menu.

When the OnCellDoubleClick event is triggered, it automatically creates a number of variables. If

the dashboard’s pivot object is named “Pivot1”, then the variables created will be:

Variable Name Function / Usage

Pivot1.FactName The name of the fact column the user double-clicked on.

Pivot1.CellValue The fact value in the specific cell double-clicked on

Pivot1.SideLabelValues[] An array that holds the dimension values of the side labels at the

intersection where the cell clicked upon resides. The members are

listed in order from the outside edge inward. The number of

members retrieved will depend on the number of levels of side

labels present at the moment the cell was double-clicked.

Pivot1.TopLabelValues[] An array that holds the dimension values of the top labels at the

intersection where the cell clicked upon resides. The members are

listed in order from the outside edge inward. The number of

members retrieved will depend on the number of levels of top

labels present at the moment the cell was double-clicked.

NOTE: In the descriptions above, no variables are created to determine the names of the dimensions that reside on the side and top labels. This is because this information already exists in the properties of the pivot section itself that underlies the dashboard’s pivot object. When examining the code below, make careful note of when the dashboard’s object is used and when the underlying pivot section is used.

7) Enter the following code into the OnCellDoubleClick event:

//

// Define some object variables for code flexibility

//

secDT = ActiveDocument.Sections["Detail Table"]

secPIV = ActiveDocument.Sections["Pivot"]

//

// Ask the user if they really want to drill

//

ReturnVal = 0

ReturnVal = Application.Alert("Should I drill to the details of the selected

cell?", "Drill to Details?","Drill","Cancel")

if (ReturnVal == 1) {

// then the user elected to drill

secDT.Limits["State"].SelectedValues.RemoveAll()

secDT.Limits["Store Type"].SelectedValues.RemoveAll()

secDT.Limits["Year Number"].SelectedValues.RemoveAll()

secDT.Limits["Month Name"].SelectedValues.RemoveAll()

Page 212: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 203

(Double-Click Drill from a Pivot continued)

for (i = 1; i <= secPIV.SideLabels.Count; i++) {

if (secPIV.SideLabels[i].Name == "State") {

secDT.Limits["State"].SelectedValues.Add(Pivot1.SideLabelValues[i])

}

if (secPIV.SideLabels[i].Name == "Store Type") {

secDT.Limits["Store

Type"].SelectedValues.Add(Pivot1.SideLabelValues[i])

}

if (secPIV.SideLabels[i].Name == "Year Number") {

secDT.Limits["Year

Number"].SelectedValues.Add(Pivot1.SideLabelValues[i])

}

if (secPIV.SideLabels[i].Name == "Month Name") {

secDT.Limits["Month

Name"].SelectedValues.Add(Pivot1.SideLabelValues[i])

}

}

for (i = 1; i <= secPIV.TopLabels.Count; i++) {

if (secPIV.TopLabels[i].Name == "State") {

secDT.Limits["State"].SelectedValues.Add(Pivot1.TopLabelValues[i])

}

if (secPIV.TopLabels[i].Name == "Store Type") {

secDT.Limits["Store

Type"].SelectedValues.Add(Pivot1.TopLabelValues[i])

}

if (secPIV.TopLabels[i].Name == "Year Number") {

secDT.Limits["Year

Number"].SelectedValues.Add(Pivot1.TopLabelValues[i])

}

if (secPIV.TopLabels[i].Name == "Month Name") {

secDT.Limits["Month

Name"].SelectedValues.Add(Pivot1.TopLabelValues[i])

}

}

ActiveDocument.Sections["Drill to Details Report"].Recalculate()

ActiveDocument.Sections["Drill to Details Report"].Activate()

}

Page 213: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 204

On-the-Fly Dashboard Creation *

Purpose / Use: To create a custom dashboard with filter objects based on the data

retrieved by the query.

Sample File: Build Your Own v93 Dashboard.bqy

Steps to Produce: This tip uses code in the OnPostProcess event to fill-in a blank

dashboard section based on the data retrieved.

Version Dependency: Requires v9.3 or higher.

1) Create your query and chart as normal.

2) Insert a new dashboard section. Add a command button named “cbDash” and add the

following script to the button:

//

// 1) Create the background panel for the filter objects

//

ActiveDocument.Sections["Dashboard"].Shapes.CreateShape(bqRectangle)

Rect1.Placement.Height = 800

Rect1.Placement.Width = 130

Rect1.Fill.Color = bqBlueGray

//

// 2) Check the Years retrieved and create a radiobutton for each year.

//

Page 214: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 205

(On-the-Fly Dashboard Creation continued)

ActiveDocument.Sections["Folder Results"].Limits["Date

Year"].RefreshAvailableValues()

numYrs = ActiveDocument.Sections["Folder Results"].Limits["Date

Year"].AvailableValues.Count

YOffset = 125

for (i=1; i<= numYrs; i++) {

ActiveDocument.Sections["Dashboard"].Shapes.CreateShape(bqRadioButton)

cntrlName = "RadioButton" + i

ActiveSection.Shapes[cntrlName].Placement.XOffset = 15

ActiveSection.Shapes[cntrlName].Placement.YOffset = YOffset + (i*25)

ActiveSection.Shapes[cntrlName].Text = "CY " +

ActiveDocument.Sections["Folder Results"].Limits["Date

Year"].AvailableValues.Item(i)

ActiveSection.Shapes[cntrlName].Font.Color = bqWhite

ActiveSection.Shapes[cntrlName].Font.Style = bqFontStyleBold

ActiveSection.Shapes[cntrlName].Fill.Color = bqBlueGray

//

// 2a) Add code to each radiobutton to filter on the Date_Year column

// (Uses String.fromCharCode(13,10) to add \n\r for readability)

//

Code = 'Yr = '+cntrlName+'.Text.substr(3,4);' +

String.fromCharCode(13,10)

Code = Code + 'ActiveDocument.Sections["Folder Results"].Limits["Date

Year"].Ignore = false;' + String.fromCharCode(13,10)

Code = Code + 'ActiveDocument.Sections["Folder Results"].Limits["Date

Year"].SelectedValues.RemoveAll();' + String.fromCharCode(13,10)

Code = Code + 'ActiveDocument.Sections["Folder Results"].Limits["Date

Year"].SelectedValues.Add(Yr);' + String.fromCharCode(13,10)

ActiveSection.Shapes[cntrlName].EventScripts["OnClick"].Script = Code

}

//

// 3) Create a label for the Store Types filter Listbox

//

ActiveDocument.Sections["Dashboard"].Shapes.CreateShape(bqTextLabel)

TextLabel.Text = "Store Types:"

TextLabel.Placement.XOffset = 15

TextLabel.Placement.YOffset = 230

TextLabel.Placement.Width = 80

TextLabel.Font.Style = bqFontStyleBold

TextLabel.Font.Color = bqWhite

TextLabel.Fill.Color = bqBlueGray

//

// 4) Create a Listbox and add each Store Type retrieved

//

ActiveDocument.Sections["Dashboard"].Shapes.CreateShape(bqListBox)

ListBox1.Placement.XOffset = 15

ListBox1.Placement.YOffset = 250

ActiveDocument.Sections["Folder Results"].Limits["Store

Type"].RefreshAvailableValues()

Page 215: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 206

(On-the-Fly Dashboard Creation continued)

numTypes = ActiveDocument.Sections["Folder Results"].Limits["Store

Type"].AvailableValues.Count

for (i=1; i<= numTypes; i++) {

val = ActiveDocument.Sections["Folder Results"].Limits["Store

Type"].AvailableValues.Item(i)

ListBox1.Add(val)

}

//

// 4a) Add code to the Listbox to filter on the Store_Type column

// (Uses String.fromCharCode(13,10) to add \n\r for readability)

//

Code = 'ActiveDocument.Sections["Folder Results"].Limits["Store

Type"].SelectedValues.RemoveAll()' + String.fromCharCode(13,10)

Code = Code + 'ActiveDocument.Sections["Folder Results"].Limits["Store

Type"].Ignore = false' + String.fromCharCode(13,10)

Code = Code + 'numVals = ListBox1.SelectedList.Count' +

String.fromCharCode(13,10)

Code = Code + 'for (i=1; i<=numVals; i++) {' + String.fromCharCode(13,10)

Code = Code + ' val = ListBox1.SelectedList.Item(i)' +

String.fromCharCode(13,10)

Code = Code + ' ActiveDocument.Sections["Folder Results"].Limits["Store

Type"].SelectedValues.Add(val)' + String.fromCharCode(13,10)

Code = Code + '}' + String.fromCharCode(13,10)

ListBox1.EventScripts["OnClick"].Script = Code

//

// 5) Add a CommandButton to clear all filters

//

ActiveDocument.Sections["Dashboard"].Shapes.CreateShape(bqButton)

CommandButton1.Placement.XOffset = 15

CommandButton1.Placement.YOffset = ListBox1.Placement.YOffset +

ListBox1.Placement.Height + 15

CommandButton1.Placement.Height = 25

CommandButton1.Placement.Width = ListBox1.Placement.Width

CommandButton1.Text = "Clear Filters"

CommandButton1.Font.Style = bqFontStyleBold

//

// 5a) Add code to the CommandButton to clear all filters

// (Uses String.fromCharCode(13,10) to add \n\r for readability)

//

Code = 'ActiveDocument.Sections["Folder Results"].Limits["Date

Year"].Ignore = true' + String.fromCharCode(13,10)

Code = Code + 'ActiveDocument.Sections["Folder Results"].Limits["Store

Type"].Ignore = true' + String.fromCharCode(13,10)

Code = Code + 'numVals = ListBox1.SelectedList.Count' +

String.fromCharCode(13,10)

Code = Code + 'for (i=numVals; i>=1; i--) {' + String.fromCharCode(13,10)

Code = Code + ' ListBox1.Unselect(ListBox1.SelectedList.ItemIndex(i))'

+ String.fromCharCode(13,10)

Code = Code + '}' + String.fromCharCode(13,10)

Code = Code + 'RadioButton1.Checked = false' + String.fromCharCode(13,10)

Code = Code + 'RadioButton2.Checked = false' + String.fromCharCode(13,10)

CommandButton1.EventScripts["OnClick"].Script = Code

Page 216: Hyperion Tips Cookbook 2007

Tips Recipes Solutions 2007

Copyright © 2007, Mark Ostroff Page 207

(On-the-Fly Dashboard Creation continued)

//

// 6) Add the chart to the dashboard

//

ActiveDocument.Sections["Dashboard"].Shapes.CreateShape(bqEmbeddedSection

, "Chart")

Chart1.Placement.XOffset = 150

Chart1.Placement.YOffset = 50

Chart1.Placement.Height = 550

Chart1.Placement.Width = 650

3) Select File | Document Scripts… and select the OnPostProcess event from the Event

Triggers list in the scripting editor.

4) Add the following code to the OnPostProcess event:

//

// First, delete any objects previously created

//

numShapes = ActiveDocument.Sections["Dashboard"].Shapes.Count

for (i = numShapes; i >=1; i--) {

strShapeName =

ActiveDocument.Sections["Dashboard"].Shapes.Item(i).Name

if (strShapeName != "cbDash") {

ActiveDocument.Sections["Dashboard"].Shapes.RemoveShape(strShapeName)

}

}

//

// Make the cbDash creation button visible so we can "push it" to

// create the dashboard, then hide the button again so users can

// not mess with it.

//

ActiveDocument.Sections["Dashboard"].Shapes["cbDash"].Visible = true

ActiveDocument.Sections["Dashboard"].Shapes["cbDash"].OnClick()

ActiveDocument.Sections["Dashboard"].Shapes["cbDash"].Visible = false

NOTE: Take care to make sure you add the code to the OnPostProcess event, not to the default OnStartup event.