您的位置:首页 > 数据库

sql serve 2005 analysis service step by step(一):创建标准维度

2009-04-23 21:48 369 查看
一. add a datasource 新增数据源

Add a data source to an Analysis Services project
1. If necessary, start SQL Server Business Intelligence Development Studio (BIDS).
2. On the File menu, point to New, and then click Project.
3. In the New Project dialog box, click the Analysis Services Project template in the Templates
pane.
4. Type a name for the project: SSAS Step by Step.
5. If necessary, change the location for the project to C:\Documents and Settings
\<username>\My Documents\Microsoft Press\as2005sbs\Workspace, and click OK.
6. In Solution Explorer, right-click the Data Sources folder, click New Data Source, and
then click Next.
7. Click the New button to create a new connection.
8. In the Connection Manager dialog box, type a server name: localhost.
9. In the Select Or Enter A Database Name list box, select SSAS Step by Step DW.

10. Click Test Connection and then click OK to close the message box.
11. Click OK to close the Connection Manager dialog box.
12. Click Next.
13. On the Impersonation Information page of the Data Source Wizard, click Use The Service
Account and click Next.
14. To complete the wizard, click Finish.

新增数据源有一点要注意:模拟信息:选择服务账户

二. 创建数据源视图

首先我们来看下为什么需要数据源视图。

An important component of the UDM in Analysis Services is the DSV。UDM是统一定义模型,The UDM provides an intermediate logical layer between the physical relational database that is used as a data source and the proprietary cube and dimension structures that are used to resolve user queries.统一定义模型是数据源和数据立方体之间的逻辑层,you can pick and choose the data that you need for the dimensions and for the cube by creating a subset view of the data warehouse.subset view 就是数据源视图。

1. In Solution Explorer, right-click the Data Source Views folder, click New Data Source
View, and then click Next.
2. Click SSAS Step by Step DW to select the relational data source, and then click Next.
3. Double-click dbo.DimProduct to add it to the Included Objects list.
Alternatively, you can click on a table and then click the arrow pointing to the right
(which looks like a greater-than sign) to move it to the Included Objects list. You can
select multiple tables by pressing the Ctrl key while clicking on each table.
4. Repeat the previous step to add another

5. Click Next, and then click Finish.
You have the option to change the default DSV name before completing the wizard.
6. Save the solution.

三 创建一个维度

1. In Solution Explorer, right-click the Dimensions folder, click New Dimension, and then
click Next.

Clear the Auto Build check box, and then click Next.
3. Click the SSAS Step by Step DW data source view.
You can review the diagram for the DSV if you click Browse on this page of the wizard.
This feature is helpful when you have multiple DSV in a project and want to be sure that
you select the correct one.
4. Click Next.
The Select The Dimension Type page of the Dimension Wizard looks like this:

5. Click Next.

6. In the Key Columns list, select ProductKey, and then select EnglishProductName in the
Column Containing The Member Name drop-down list.注意这里,不然后面显示就是id,而不是productname

8. Click Next, and then, on the Select Dimension Attributes page of the wizard, select the
check box next to the following attributes: Color, List Price, and Size.

Select the check box to the left of Dim Product Subcategory, and then, in the same row,
click dbo.DimProductCategory.EnglishProductSubcategoryName in the Attribute
Name Column drop-down list.

Select the check box to the left of Dim Product Category, and then, in the same row, click
dbo.DimProductCategory.EnglishProductCategoryName in the Attribute Name Column
drop-down list.
11. Click Next.

12. On the Specify Dimension Type page, click Next.

13. On the Define Parent-Child Relationship page, click Next.
Since you’re not currently building a parent-child dimension, you don’t need to change
the Define Parent-Child Relationship page of the wizard. Later in this chapter, you will
learn more about working with this page of the wizard.
14. Change the name of the dimension from Dim Product to Product, and then click Finish.

四。部署维度,为什么要现在部署呢?因为如果你不部署,你将无法看到刚才建立的维度的信息。比较简单。

最后,将介绍两个设置,第一、设置Changing Attribute Properties,为什么需要设置这个呢?看下面的介绍:

When users browse a cube, they select
attribute hierarchies for grouping measure values, so you should be careful about which
attribute hierarchies are available for grouping data. In the current dimension, for example,
grouping by Category, Subcategory, Product, Color, or Size seems logical and desirable. However,
grouping by List Price is probably not useful. Typically, an attribute like this, which can
have a high number of distinct members relative to the leaf-level attribute, is used for filtering
purposes or for detailed reporting.

第二 .unknown member.为什么会出现这个呢?简单来说,这是由于数据不一致或者不完整现象导致的。unknown member有三种形式visible(默认),hidden,none,可以在维度的属性中设置。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: