Introduction to SQL Server 2000 Analysis Services: Exploring Virtual Cubes - Page 9December 11, 2002
Let's conclude our
examination of virtual cubes with a brief look at calculated members, to which
we have been exposed in earlier lessons. Earlier, we created the Budget vs Actual virtual cube to illustrate options for using the virtual cube to
consolidate information that occurs in different OLAP cubes. Let's extend this
example to provide value in another way to the information consumers whom we
support. A simple illustration
is in order: let's say that we have determined that the affected information
consumers, while quite content with the virtual cube we have provided in
general, have a business requirement that the virtual cube cannot, in its
current configuration, directly meet. Management has asked that the Finance
team determine how closely it is meeting budget within the realm of expense
control. While the Finance consumers can certainly perform the math involved,
they would like for us to make a simple enhancement to their data source, the
virtual cube -- they would like to see a Variance column that displays
the difference in the Actual Expense and the Budget Expense, so
that at any applicable level of drilldown within the new reporting data source
they can see directly where performance lies from all associated perspectives. We will create a calculated member, which in this case is also a calculated measure, to
subtract the Budget Expense from the Actual Expense. We will
accomplish our objectives with the following steps: The Virtual Cube
Editor for the Budget vs Actual virtual cube appears.
Illustration 23: Insert -> Calculated Member
Alternatively, we might have chosen the Insert Calculated Member button (the small calculator icon atop the Analysis Manager toolbar, just above the cube tree) for the same effect. The Calculated Member Builder dialog appears.
The Data tree appears as shown in Illustration 24.
Illustration 24: Measures and MeasuresLevel in the Data Tree
The Value Expression box contents appear as shown below.
Illustration 25: The Calculation behind the Calculated Member
Cube data is retrieved, and we are presented with a partially filled Data pane. Note that, because the sample cubes do not contain fully comparative information, or even complete expense information for all account/other dimension intersects, nulls appear throughout the default grid.
The Data pane contents appear as shown below.
Illustration 26: The Data Pane with Our Specifications
We can certainly see that various rearrangements, such as orders of measures, formatting, and so forth, might enhance our presentation, and its drilldown behavior and other considerations could be easily tweaked to anticipate and deliver options within the context of the business requirements of the information consumers involved. (To review how many of these operations can be accomplished, see the appropriate sections within the other tutorials of this series.) The Variance column now appears, and after formatting to the specifications of the consumers, extends the value of their new virtual cube. Just as we created a calculated measure for the purposes of adding utility, we also have the option of importing existing calculated members into our cube from source cubes (the virtual cube would need, as might be expected, to include any members referenced by the virtual cube).
|