设为首页收藏本站

 找回密码
 注册

QQ登录

只需一步,快速开始

BCM 门户 IT世界 资料备录 查看内容

MS SSAS 2008 Unleashed - Chapter 9. Multidim - Models and BI Development Studio

2012-8-16 15:24| 发布者: demo| 查看: 1247| 评论: 0

摘要: Chapter 9. Multidimensional Models and Business Intelligence Development Studio In This Chapter Creating a Data SourceDesigning a Data Source ViewDesigning a DimensionDesigning a CubeConfiguring and D ...
Designing a Cube


Designing a Cube

A cube is the fundamental object of the multidimensional model. It is a major object, one that defines the data that you can access. We have just worked on defining dimensions because dimensions play a major role in defining a cube. You do not necessarily need to design your dimensions before you define your cube; you can start with the cube. For our purposes, however, we are going to design a cube with the dimensions we already have. For detailed information about cubes, see Chapter 6.

Creating a Cube

You can use the Cube Wizard to design a simple cube, including dimensions, if you have not already created them. As handy as it is to create an entire cube using just a single wizard, it is something we recommend only for simple models. If you are using advanced dimensions (for example, a dimension with more than one table), we recommend that you use the Dimension Wizard to create your dimensions before you create your cube.

We are going to show you how to create a cube, and will assume that you have already created the dimensions you need for your cube.

Launch the Cube Wizard

1.
In the Solution Explorer of BI Dev Studio, right-click the Cubes node.

2.
From the resulting menu, select New Cube.


When the Cube Wizard appears, you can—as usual—speed on through the Welcome page. Then, you get down to the business of creating your cube:

1.
On the Select Creation Method page, for our purposes go ahead and accept the defaults.

2.
On the Select Measure Group Tables page, select the DSV you used to create your dimensions from the drop-down box.

In the Measure Group Tables pane, you see the list of all tables in your DSV. In the beginning, none of the tables are designated to be a measure group tables. Click the Suggest button for BI Dev Studio to suggest measure group tables, as shown in Figure 9.11.

Figure 9.11. Select measure group tables for your cube.



3.
On the Select Measures page, under Measures, you will see the available measure groups and measures. (Measure groups are first-class objects in the tree view.) You can change the names of the measure groups and measures. Just select one, press F2, and enter the name you want.

When you have finished your changes, click Next.

4.
On the Select Existing Dimensions page, you select the existing database dimension you want to be included in your cube.

5.
On the Select New Dimensions page, you see tree view of new dimensions that BI Dev Studio suggests you create. Under dimension nodes, you see the tree of the attributes. Click the check boxes to deselect the dimensions\attributes you do not want to be included. When you have finished your changes, click Next.

6.
On the Completing the Wizard page, you can preview the cube. If you want, you can change the cube’s name in the Cube Name text box. For our purposes, name your cube MySampleCube and click Finish.

Modifying a Cube

The MySampleCube you have created has a structure similar to that of the Warehouse and Sales cube in our sample FoodMart 2008 database. We will use the Cube Designer in BI Dev Studio to examine the structure of MySampleCube.

To open MySampleCube in BI Dev Studio, right-click the file in the Solution Explorer and select View Designer from the resulting menu.

On the Cube Structure tab of the Cube Designer, you will see a diagram of your cube, as shown in Figure 9.12.

Figure 9.12. You can see a diagram of MySampleCube on the Cube Structures tab of the Cube Designer.


Working with Measures and Measure Groups

All of your measure groups and measures are listed in the Measures pane. (See Chapter 7, “Measures and Multidimensional Analysis,” for more information.)

You can click a measure group or a measure to see its properties in the Properties pane. You can drag and drop columns from Data Source View pane, which shows all the tables that your cube is based on.

Right-click anywhere in the Data Source View pane. On the resulting menu, select Show Tables. The tables that you see listed in the Show Tables dialog box are the tables from your DSV that are not included in the diagram. You can select one or more of these tables to include them in the diagram.

Right-click anywhere in the Measures pane (see Figure 9.12). From the resulting menu, you can do the following:

  • Create a new measure or measure group

  • Delete a measure or measure group

  • Rearrange order of the measures or measure groups

  • Create a new linked object

Working with Linked Objects

You use linked objects to reuse an object (dimension or measure group) that resides in a different database, perhaps on a different server. You can link only dimensions from different databases. The linked object points to the object you want to reuse.

For more information about linked objects, see Chapter 25, “Building Scalable Analysis Services Applications.”

Launch the Linked Object Wizard

1.
On the Cube Structure tab, right-click anywhere in the Measures pane.

2.
From the resulting menu, select New Linked Object.


When the Linked Object Wizard appears, you can, as usual, speed on through the Welcome page. Then, you get down to the business of creating your linked object:

1.
On the Select a Data Source page, under Analysis Services Data Sources, a list of available Analysis Services data sources appears. You can select a data source from the list or click New Data Source.

Note

An Analysis Services data source is the data source pointing to another instance of Analysis Services and not to the relational database.

2.
The Data Source Wizard appears on top of your Linked Object Wizard.

3.
On the Select How to Define the Connection page, select an existing connection under Data Connections that points to another instance of Analysis Services that contains the objects you want to link to. Click Next.

4.
On the Impersonation Information page, select Use the Service Account, and click Next.

5.
On the Completing the Wizard page, click Finish.

6.
Back in the Linked Object Wizard, on the Select a Data Source page, select your newly created Analysis Services data source, and then click Next.

7.
If you connected to an instance of Analysis Services that holds another copy of the FoodMart 2008 database, on the Select Objects page you should see something like Figure 9.13. Here you can select measure groups and dimensions to link to. (If you select only one measure group, make sure that you also select some of the dimensions belonging to it.)

Figure 9.13. Select the objects you want to link to.


8.
On the Completing the Wizard page, review the names of the new linked dimensions and measure groups. If the Linked Object Wizard detects that you already have an object with the same name as one of your linked objects, it renames the linked object to avoid duplication. Click Cancel to avoid creating extra objects in the FoodMart 2008 sample database.

Defining Cube Dimension Usage

The role of a dimension in a cube is defined by its relationship to a measure group. We are going to move now to the Dimension Usage tab of the cube editor to review those relationships in the Warehouse and Sales cube from the FoodMart 2008 sample database.

The Dimension Usage tab will look like the one depicted in Figure 9.14. It displays a grid that contains a column for each measure group and a row for each dimension. The intersections of the rows and columns show the names of the granularity attributes. For example, the intersection of Product dimension and Warehouse measure group shows that the granularity attribute is Product.

Figure 9.14. Review the relationships of dimensions and measure groups.


Click the Product granularity attribute, and the Define Relationship dialog box appears, as shown in Figure 9.15.

Figure 9.15. You can review the relationship between the measure group and the dimension.


In the Define Relationship dialog box, you can see how a dimension is related to a measure group. The dialog box displays the granularity attribute, the dimension table, and measure group table.

Under Relationship, you will find two columns: Dimension Columns and Measure Group Columns. Under Dimension Columns, you will see the name of the key column of the Product attribute: product_id. Under Measure Group Columns, you will see the name of the column in the inventory_fact_1997 table (the measure group table): product_id.

Note

Because the measure group could consist of several partitions, you will see only the name of the table of the first partition. But, the rest of the partitions need to have the same columns as the first partition, so we can safely use the name: product_id.


Our Product granularity attribute is based on a single key column. If a granularity attribute is based on more than one key column, you must map every dimension key column to a measure group column.

In the Select Relationship type box, you will find a drop-down list of relationship types. (For more information about relationship types, see Chapter 8, “Advanced Modeling.”) Depending on your selection, the Define Relationship dialog box looks different. Earlier we described the Define Relationship dialog box for the relationship type Regular. In the following list, we briefly define some of the other types of relationships:

  • Fact The Fact dimension has the same granularity as your measure group; it is based on the same table as the measure group.

  • Referenced A dimension that is related to the measure group through another dimension.

  • Many-to-many For a many-to-many dimension, you need only specify the name of the intermediate measure group. (For more information about many-to-many relationships, see Chapter 8.)

  • Data mining A dimension that is built on top of the source dimension using the mining model.

Building a Cube Perspective

A cube perspective is similar in concept to a view in relational databases. There is a difference, however: A perspective in Analysis Services 2008 does not make it possible to specify security for the perspective—all users that have access to the cube can see all the perspectives in the cube. In essence, a cube perspective is another view of the cube that can be presented to the end user.

Suppose that you want to build a complex cube that involves lots of dimensions and that every dimension has a lot of attributes and hierarchies. And, the measure groups have lots of measures. Such a cube would be hard for a user to navigate. To make the cube easier to navigate and browse, you can create a perspective in your cube that shows customers only the information they are interested in.

To create a cube perspective, we will use the Perspectives tab in the Cube Designer. Right-click anywhere in the Perspectives tab and select New Perspective from the resulting menu.

The essence of designing a perspective is to select the measure groups and measures that will be included in the perspective. You also select the hierarchies and attributes that will be visible to the user. You can do all this on the Perspectives tab, shown in Figure 9.16.

Figure 9.16. Select the objects you want your user to see in your perspective.


In the Cube Objects column, you can see the measure groups (those are highlighted), measures, dimensions, hierarchies, and attributes available for your perspective. In the Perspective Name column, just click the ones you want to include.

After you have created your perspective, name it in the Perspective Name column. Our sample perspective is named Product Sales. To the user, it will look just like another cube, very much the same way the regular cubes in Analysis Services 2000 were visible to the end user.

Defining Cube Translations

Earlier in this chapter, we have described how to define translations for dimensions in your database. Now we are going to turn our attention to defining translations for your cube.

You define object captions in different languages for your cube objects. To do this, you create a translation for each language. Figure 9.17 shows the Translations tab in the Cube Designer.

Figure 9.17. Use the Translations tab to define translations for your cube.


In Figure 9.17, you can see a Russian translation defined for the Warehouse and Sales cube. When you want to create a new translation, you will use the Translations tab:

1.
Right-click anywhere in the Translations tab space.

2.
From the resulting menu, select New Translation.

3.
In the Select Language dialog box, select the language you want from the very long list of available languages.

4.
In the column headed by the name of the language, type the caption for the individual objects.

If you have not specified a caption for a certain object in this new language, the server uses the default object name. Go back and look at Figure 9.17, and you will see that we did not create a translation for the Product Sales perspective. There is nothing in the cell in the Russian column, but the server will supply one.



鲜花

握手

雷人

路过

鸡蛋

相关阅读

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )  

GMT-8, 2025-12-13 22:14 , Processed in 0.014500 second(s), 17 queries .

Supported by Best Deal Online X3.5

© 2001-2025 Discuz! Team.

返回顶部