Tracy.Bai

Focus on Data analysis and Mining

导航

sql server 2005 analysis service step by step(二):创建时间维度

1. In Solution Explorer, right-click the Dimensions folder, click New Dimension, and then
click Next.
2. Clear the Auto Build check box, and then click Next.
3. Click the SSAS Step by Step DW DSV, and then click Next.
4. On the Select the Dimension Type page of the wizard, click Time Dimension, and then
click dbo_DimTime in the corresponding drop-down list.
All tables in the DSV are available in the drop-down list. Since the wizard is unable to
identify which table is the time dimension, you must select the appropriate table here.
5. Click Next.

6.On the Define Time Periods page, click the drop-down list for Year in the Time Table
Columns, scroll through the list of columns, and then click CalendarYear to assign this
column to the Year time property.
7. Repeat the previous step to assign table columns to specific time properties, as shown in
the following table:
8. Click Next.
The Review New Hierarchies page of the wizard shows you the user hierarchies that will
be created based on your selection of time properties on the previous page of the wizard.
You’ll learn more about user hierarchies in Chapter 7. You have the option here to
remove the autogenerated hierarchies or to remove levels from a hierarchy. For now,
you’ll leave the hierarchies as they are.
9. Click Next, change the dimension name from Dim Time to Time, and then click Finish
to complete the wizard.

10.In the Attributes list, right-click Date, click Properties, and then, in the Properties window,
scroll to the NameColumn property, click (new) in the property’s drop-down list,
click FullDateAlternateKey, and then click OK.
The key column for this attribute is still TimeKey, which is used to join the dimension to
related fact tables, but the key has no meaning to users. Instead, you can use the Name-
Column property to display the name of an attribute member. In this case, users will see
the value from the FullDateAlternateKey column of the DimTime table, which is a date
value in a mm/dd/yy format.

注意一个问题:就是按时间排序,普通月份是按拼音字母排序的,如何让他按月份排序呢?

16. Click the Dimension Structure tab, right-click Month, click Properties, and then, in the
Properties window, scroll to the KeyColumns property.
17. Click the ellipsis button (…) in the property’s list box, and then click the ellipsis button
in the Source property in the DataItem Collection Editor dialog box.

Click MonthNumberOfYear in the Source Columns list, and then click OK

19. Click OK to close the DataItem Collection Editor dialog box.
20. Right-click the SSAS Step by Step project in the Solution Explorer window, and then
click Deploy.

基于角色的维度 role-playing dimension

在一个事实表中也许有几个字段都引用到了时间维,比如说,order date ,ship date,due date ,the corresponding role-playing dimensions are automatically added to the cube.而且,Notice also there are no corresponding
.dim files for these dimensions in the Dimensions folder of Solution Explorer. All that
you see is the Time Dimension that you added previously. That is because the three new
dimensions are role-playing dimensions for time.

posted on 2009-04-26 21:30  Love Fendi  阅读(648)  评论(0编辑  收藏  举报