Professional Documents
Culture Documents
Step 2 Use Analysis Services to create an OLAP cube, or Universal Dimensional Model (UDM)
1. In BIDS, create a new Analysis Services project named QuickAS. 2. Create a Data Source that references the QuickStartODS database on the local SQL Server. 3. Create a Data Source View (DSV) based on QuickStartODS Design logical relationships by matching columns with the same name Adding all the tables except SalesOrderHeader.
The DTS package created and copied the tables, but it created neither primary keys nor foreign key relationships. The DSV can create keys and relationships logically even if they dont exist in the source database. This allows you to fix problems with the data source, and also integrate data from different sources where no logical relationship exists. 4. Check the DSV for logical relationships. If theyre missing, add them between the following tables, by using matching key names, and creating primary keys as appropriate: SalesOrderDetailProductSubCategoryCategory. 5. Create a standard dimension named Productbased on the existing Quick Start ODS data source view, but not using IntelliCube. Product is the Main table, Product ID is the key, and Name is the member name. Select Subcategory and Category as related tables. As attributes, select Color, Size, Subcategory, and Category, with the appropriate Name columns for the Product Subcategory and Product Category attributes. The dimension is Regular, with no parent-child attribute. IntelliCube still behaves erratically in Beta 2. Essentially, its major contribution is to detect one to many relationships and suggest user hierarchies. 6. In the Designer, on the dimension builder, add a hierarchy to the Product dimension. Drag Product Category to the Hierarchies area. Add Product Subcategory and Product to the hierarchy Rename hierarchy to Category Hierarchy. 7. Create a cube named Salesbased on the existing Quick Start ODS data source view, but not using IntelliCube. Select SalesOrderDetail as a fact table Select all three Product tables as dimension tables. Create measures Order Quantity (renamed from Order Qty) and Sales Amount (renamed from Line Total) in a measure group Orders (renamed from Sales Order Detail). Add the Product dimension. 8. Deploy the project. Choosing Deploy automatically carries out the Save, Build, Deploy, and Process steps. 9. Browse the Sales cube. Add all the measures to the data grid. Add the Product dimension as a Row field. Drill down to show all the Touring Bikes. Slice to show only Blue bikes. Add a filter to include bikes between 46 and 56 in Size.
The slicer (Page Filter) allows you to select a single member. (If you select multiple members in the Page Filter list, it creates a calculated member that aggregates the selected items.) The slicer must come from a hierarchy that is not on rows or columns. The filter area allows you to use more complex expressions and can include members from a dimension that is displayed on another axis. 10. Close all the designer windows.
Step 3 Use a Data Source View (DSV) to simulate a Star Schema warehouse
The transaction database has separate tables for SalesOrderHeader and SalesOrderDetail. This is different from a typical star schema data warehouse where the facts are all assembled into a single fact table. You can use the DSV to logically join the two source tables into one fact table. The transaction database also does not have a time dimension. You can have the server build a time dimension for you. 1. In the designer for the Quick Start ODS DSV, replace the SalesOrderDetail table with a Named Query. Include the tables SalesOrderDetail and SalesOrderHeader, joined by SalesOrderID. Include the ProductID, OrderQty, and LineTotal columns from SalesOrderDetail and OrderDate from SalesOrderHeader. You could add groupings to logically minimize the number of rows, but in a proof of concept database, there are probably no significant benefits of logically reducing the number of fact table rows. 2. Create a Server Time Dimension named Datebased on the existing Quick Start ODS data source view, but not using IntelliCube. Use the default date range Add time periods for Year, Quarter, and Month in addition to the required Date key. Dont add any additional calendars. A Server Time Dimension saves you from having to construct a time dimension table when theres a date-time field in the fact table. The server dimension automatically includes all the dates within the time range, which makes it possible to use it with multiple measure groups. 3. In the dimension designer for Date, rename the hierarchy to Calendar Time. 4. In the cube designer for Sales, on the Cube Builder tab, add Date as a cube dimension. 5. On the Dimension Usage tab, for the Date dimension and the Orders measure group, add a Regular relationship between the Date granularity attribute and the OrderDate measure group column.
Explicitly creating mappings between the dimension and the measure group has two major benefits. First, you can use the same dimension at different grains. For example, you could have one measure group with Date (day level) as its granularity attribute, and another with Month as its granularity attribute. Second, you can use the same dimension with multiple key columns. For example, you could link one instance of the Date dimension to the OrderDate key, and another instance to the ShipDate key. 6. Deploy the project, and browse the revised Sales cube. Add all Measures to the data grid, add Product Category as a Column field, and add the default Date hierarchy (Calendar Time) as a Row field. Drill down to see the daily detail 7. Close all the designers.
3. 4. 5. 6. 7.
8. 9.
In SMS, you can browse dimensions and cubes, and you can delete major objects. You can even create a new empty Analysis Services database, but you cant open a designer to create or edit. In Module 3 you will learn how to execute Analysis Services Scripting Language (ASSL) scripts to create or modify Analysis Services objects from within SMS. 3. In SMS, look for the QuickStartReport on the Report Server. Open the report to see it execute within a browserthe way an end user would see it.