HP Storage Essentials Storage Resource Management Report Optimizer Software 6.0 Performing On-Report Analysis with Web Intelligence (August 2008)

Creating Custom Calculations216
You have a report showing Year, Quarter and Sales revenue, with a break on Year.
The report has a section based on Year and a break on Quarter. The Body column has
the formula
Sum ([Sales Revenue]) In Body.
The totals in the Body column are the same as those in the Sales revenue column
because the Body keyword refers to the data in the block. If you were to remove the
Month object, the figures in the Block column would change to correspond with the
changed figures in the Sales revenue column. If you were to place the formula in the
report footer it would return the total revenue for the block.
Using keywords to make reports generic
Extended keywords future-proof your report against changes. If you refer to data explicitly
(by specifying dimensions using In, ForEach or ForAll) your reports might return
unexpected data if dimensions are added or removed. The following example illustrates
this.
Example: Using the Report keyword to display percentages
In this example you have a block that contains Year, Quarter and Sales revenue objects.
You want to display revenues by year and quarter, and the percentage of the total revenue
in the report that each individual revenue represents, as shown:
The formula for the Percentage of Total column is:
(
[Sales revenue]/(Sum([Sales revenue]) In Report)) * 100
Remember that, in a block, the Report includes all data in a report, so this formula could
be written:
([Sales revenue]/Sum([Sales revenue] ForAll ([Year];[Quarter]))) * 100
Sum([Sales revenue]) ForAll ([Year],[Quarter])
The Body keyword
gives a different result
depending on where it
is placed