HP Storage Essentials Storage Resource Management Report Optimizer Software 6.0 Building Reports Using the Web Intelligence Java Report Panel (August 2008)

Creating custom calculations314
Defining the calculation context
Before you can define a specific calculation context, you need to understand how
calculation contexts work.
What are calculation contexts?
Calculation contexts give you more control over how a formula or measure is evaluated.
To understand them, you need to be familiar with basic report concepts. A report contains
two kinds of objects: dimensions, which are types of data about your business that can
have measures associated with them (for example: products, years, states) and the
measures that you can calculate in relation to dimensions (for example: sales revenue,
number of sales). For example, a report could show sales revenue (measure) by year
(dimension).
The important thing to remember about measures is that they are semantically dynamic.
This means that the figures returned by a measure depend on the dimensions with which it
is associated; in other words, on the context in which it is placed. Web Intelligence places
measures in default contexts depending on where they appear in a report. However, you
can change these default contexts. This is what is meant by defining the calculation
context.
You can see default contexts by creating a block containing Year and Sales Revenue
objects. In this case the Sales Revenue object returns the revenue by year, because
revenue is evaluated in the context of the Year dimension. If you then add the Quarter
dimension to the block, the figures in the Sales Revenue column change because the
default context is now year and quarter.
From this you can see that when you place a measure or formula in a block, the default
calculation context that Web Intelligence applies includes all the dimensions in the block.
Default calculation contexts
Depending on where you place a measure or formula, Web Intelligence selects a default
context. All the following examples use the Sum() function to illustrate default contexts.