Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Aug 8, 2005

Introduction to MSSQL Server Analysis Services: Mastering Enterprise BI: Create Aging "Buckets" in a Cube - Page 3

By William Pearson

Hands-On Procedure


Clone the FoodMart 2000 Sample Database

We will create a copy of the FoodMart 2000 sample database, which, along with the several cubes and other objects it contains, accompanies an Analysis Services installation. This will allow us to keep the original sample database intact for other uses.

1.  Open Analysis Manager, beginning at the Start menu.

2.  Expand the Analysis Servers folder by clicking the "+" sign to its immediate left.

Our server(s) appear.

3.  Expand the desired server.

Our database(s) appear, in much the same manner as depicted in Illustration 2.

Illustration 2: Example Databases Displayed within Analysis Manager

NOTE: Your databases / cube tree will differ, depending upon the activities you have performed since the installation of MSAS (and the simultaneous creation of the original set of sample cubes). Should you want or need to restore the cubes to their original state, simply restore the database under consideration. For instructions, see the MSSQL Server 2000 Books Online.

4.  Right-click the FoodMart 2000 database.

Again, we are making a copy of the database, because our lesson will involve making changes to the data connections, as well as the Sales cube, shared dimensions, and other objects, within the practice example. As we have noted, working with the copy will allow us to maintain our existing sample cube in its current condition, and available to other possible users and applications.

5.  Select Copy from the context menu that appears.

6.  Right-click on the Analysis Server.

7.  Select Paste from the context menu that appears, as shown in Illustration 3.

Illustration 3: Paste the Cloned Database to the Analysis Server

The Duplicate Name dialog appears.

As noted in previous articles, we cannot have two databases of the same name in a given Analysis Server.

8.  Type the following into the Name box of the Duplicate Name dialog:


The Duplicate Name dialog appears, with our modification, as depicted in Illustration 4.

Illustration 4: The Duplicate Name Dialog, with New Name

TIP: As I have mentioned elsewhere, in this and other series, the foregoing is also an excellent way of renaming a cube, (a "rename" capability is not available here, as it is in many Windows applications). Simply create a duplicate, give it the name to which you wish to rename the old cube, and then delete the old cube, as appropriate. This also works for Analysis Services databases, dimensions and other objects.

9.  Click OK to apply the name change.

The new database, AgingDim, appears in the tree beneath the Analysis Server, among the databases already in place, as shown in Illustration 5.

Illustration 5: The New Database Appears ...

We now have a copy of the FoodMart 2000 database, within which we can perform the steps of our practice exercise. We will be working with the Sales cube within this database. We will next need to apply filters to contain only the purchase dates that occur within the last six months of year 1997, in accordance with the specifications that the information consumers have communicated.

Apply a Filter to the Time Dimension

We will next enact a source filter upon the Time dimension to limit the transactions in our cube to those that have occurred in the last half of 1997. This is one part of preparing the data for our practice session, and constitutes a step that would probably not occur in many real world scenarios. Again, we are simply making it possible to practice the creation of an aging capability using a sample data environment that is available to virtually anyone with an Analysis Services installation.

1.  Expand the new AgingDim Analysis Services database by clicking the "+" sign to its immediate left.

2.  In like manner, expand the Shared Dimensions folder within the AgingDim database.

3.  Right-click the Time dimension.

4.  Select Edit from the context menu that appears, as depicted in Illustration 6.

Illustration 6: Select Edit from the Context Menu

The Dimension Editor opens.

5.  With the Time dimension (top of the tree) selected, click the Advanced tab in the Properties pane (underneath the tree pane)

6.  Type (or cut and paste) the following into the Source Table Filter box within the Advanced Properties tab:

"time_by_day"."the_date" >#05/31/1997# AND "time_by_day"."the_date" <#01/01/1998#

7.  In the Allow Duplicate Names box (on the Advanced tab, immediately above the Source Table Filter box), select True.

The Advanced Tab – Properties pane appears, with our modifications, as shown in Illustration 7.

Illustration 7: Advanced Tab – Properties Pane with Modifications

The filter we have put in place ensures that the new shared dimension will entrain only transactions that fit within the time band specified by the information consumers (the last half of year 1997). Next, we will process the dimension to prepare it for use within the Sales cube in our practice session.

8.  Right-click the Time dimension, atop the tree, as before.

9.  Select Process Dimension ... from the context menu that appears, as depicted in Illustration 8.

Illustration 8: Select Process Dimension ... from the Context Menu

10.  Click Yes on the dialog that next asks if we wish to save the dimension, as shown in Illustration 9, if necessary.

Illustration 9: Save the Dimension ...

The Process a Dimension dialog appears next, affording us an opportunity to select a processing method.

11.  Ensure that the radio button to the immediate left of Rebuild the dimension structure is selected, as depicted in Illustration 10.

Illustration 10: Preparing to Rebuild ...

12.  Click OK.

Processing commences and completes rapidly. Successful processing is indicated by the green message at the bottom of the Process viewer, which appears as shown in Illustration 11.

Illustration 11: Successful Processing is Indicated

13.  Click Close to dismiss the Process viewer.

We are returned to the Dimension Editor. While we would typically reprocess a cube containing a dimension that we have modified, we will defer processing the Sales cube until we have completed most of the steps of the procedure that follows, in the interest of saving time.

14.  Select File --> Exit from the main menu to return to Analysis Manager.

We are now prepared to add an aging dimension to the Sales cube, pursuant to the expressed business requirements of the information consumers.

MS SQL Archives

Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM