Database Reference
In-Depth Information
The gridview now contains the following data.
Budget
New York
Sales
Jan
Feb
Mar
Qtr1
Cola
100.0
100.0
100.0
300.0
Diet Cola 100.0
100.0
100.0
300.0
Colas
100.0
100.0
100.0
300.0
There are a couple of points to examine in this grid. First, our code wrote the value
100 into the Qtr1 column for both Cola and Diet Cola, but the value shown in the cell is
300. how can that be? The reason Qtr1 does not contain 100 is that the Qtr1 member is
marked as a dynamically calculated member in the outline and, as such, the block does
not store this number. Further, as the number was dynamically calculated when it was
retrieved, it automatically reflects the sum of its children as it was defined in the Essbase
outline. If you were to look at IEssDataCell.getAccessMode for the cells in the Qtr1 col-
umn, you would see that the cells in that column are marked as read-only.
Also, if you look at the total row for Colas, you will notice that it still has the value
of 100 that the code posted into that row. Despite the fact that it is a parent, the Colas
member is not marked as a dynamic calculation member. In order to see the Colas value
property calculated, you must execute a Calc Script. of course, the Java API can calcu-
late Essbase, so let us take a look at calculations in the next section.
8.6 CalCulating essBase DataBases
one of the most powerful facets of Essbase is its ability to calculate data, and the calcula-
tions used by companies can take many forms. They can be simple calculations of the
entire Essbase outline, aggregations of small slices of the database or top-down allocation
calculations. In any case, most users who execute calculations in Essbase perform those
executions via a prewritten Calc Script. The Java API supports these types of calculations
and, additionally, allows you to specify and execute calculation scripts on-the-fly. In this
section, we will take a brief tour of the calculation functionality in the Essbase API.
Essbase calculations are performed on a single database and, as you will remember,
a database is represented in the Essbase Java API in an IEssCube object. he IEssCube.
calculate method has three different overloads that provide the ability to execute the
default calculation, execute a calculation from a server-based Calc Script file or create
and execute a calculation script on the fly. The simplest overload is the overload that
executes the default calc. to execute the default calc, simply call the calculate method
with no arguments.
// execute the default calc
cube.calculate();
The second overload lets you execute a server-based Calc Script or, alternatively, check
the syntax of a Calc Script. This overload has 2 arguments, a flag to indicate that the cal-
culation operation should only check the syntax and a string containing the name of the
Calc Script on the server. For example, if you wanted to check the syntax of a Calc Script
file named CalcProd that is located on your server, you would call the following methods.
// check the syntax of CalcProd.csc
cube.calculate(true, "CalcProd");
Search WWH ::




Custom Search