- Microsoft SQL Server 2014 Business Intelligence Development Beginner’s Guide
- Reza Rad
- 958字
- 2021-08-13 17:55:21
Time for action – creating the first cube
There are two ways to create a cube: through Cube Wizard or by creating an empty cube. When we create a cube from the wizard, the relationships between measures and dimensions will be created automatically based on the underlying Data Source View (DSV) after choosing it. However, if we create a cube from an empty one, we need to set up a relationship between the measure groups and dimensions in the cube designer. In the next example, we create the cube using Cube Wizard.
- The first step is to create a data source connection. To create a data source connection, right-click on a data sources folder.
- Open the SSAS project and select New Data Source. As shown in the next screenshot, create a connection to the AdventureWorksDW2012 database. In the Impersonation Information field, enter the username and password of a domain/windows account that has the appropriate permissions for that database. Name the data source
AdventureWorksDW2012
. - There is one more step before creating the cube, and that step is the creation of the Data Source View. Right-click on the
Data Source Views
folder and chooseNew Data Source View
. Choose the data source from step 1. In the Select Tables and View step, choose the tables as shown in the next screenshot and name the data source viewAdventureWorksDW2012
: - After creating DSV, you will see a database style diagram of tables with their relationship in the design area. In this example, we just use the DSV as is, but in the next section, we will show you how to modify the DSV.
- Now, it is time to create the cube. Right-click on Cubes and select New Cube. Follow the steps in the wizard, and in the Select Creation Method step, choose Use Existing Tables.
- In the Select Measure Group Tables step, select the checkbox of the FactInternetSales table.
- In the Select Measures step, just leave all the measures as checked. Rename the measure group
Internet Sales
. - In the Select New Dimensions step, leave all the tables as checked except for Fact Internet Sales. Rename all the options in Dimension in this step, and remove Dim from their name, as shown in the following screenshot:
- Rename the cube
Internet Sales
.
What just happened?
In the first step of your example, you created a data source connection to a data warehouse. The credential used to create this connection is important because SSAS will use that credential to connect to the underlying database.
In the next step, a DSV is created from the data source. You can add as many tables and views as you want to the data source view; the data source view creates the base structure for cube development.
In steps 4, 5, and 6, you created a cube through Cube Wizard from the existing tables in the data source view. To create cubes, you should define your measure groups and dimensions. Measure groups are similar to the Fact tables, each measure group may contain one or more facts. In this example, the FactInternetSales table is selected as a measure group, and it contains measures such as Sales Amount and Order Quantity.
In step 7, we saw that dimensions are the second important items that should be defined when you create the cube. In the example, dimensions such as Date, Product, and Sales Territory are used. Each dimension may be connected to a dimension table in DSV or to a view that is a result of joining multiple tables of the database.
After creating the cube, you will see a view of the cube in the cube designer. The following screenshot shows the different parts of SSDT:

The Solution Explorer pane (number 1 in the screenshot) is part of SSDT that shows projects and files, data sources, DSVs, cubes, and other project-related items.
The Properties window (number 2 in the screenshot) is the place where you can view and change the properties of the selected object; for example, in the previous screenshot, the Properties window shows the properties of the Internet Sales cube.
The cube designer (number 3 in the screenshot) is the main designer in the SSDT in which you will spend most of your time as an SSAS developer. Here, you can view the layout of the cube's measure group and dimensions (number 7 in the screenshot); you can go to different tabs (number 8 in the screenshot), such as Dimension Usage, Partitions, Browser, and KPIs. We will walk through many of these tabs in this chapter.
A list of the Measure groups and their measures (number 4 in the screenshot) can be viewed in the Cube Structure tab. You can also see two different lists of dimensions: first is the database's dimensions (number 6 in the screenshot) and second is the cube's dimensions (number 5 in the screenshot). The difference between the cube's and the database's dimension is that there might be some dimensions in the database that are not used in this cube (for example, consider an SSAS project with multiple cubes). On the other hand, there might be a single database dimension that is used multiple times in one cube, which we will call the role-playing dimension (for example, there is only one database dimension, Date, but there are three role-playing dimensions in the cube, which are named Order Date, Ship Date, and Due Date).
One of the benefits of creating a cube from a wizard is that it will automatically create all the relationships between the database dimensions and the measure groups, based on the relationship defined in the DSV.
- Oracle WebLogic Server 12c:First Look
- Learning SQLite for iOS
- Learning Laravel 4 Application Development
- 實(shí)戰(zhàn)Java高并發(fā)程序設(shè)計(jì)(第3版)
- 程序是怎樣跑起來的(第3版)
- Instant Nancy Web Development
- Programming with CodeIgniterMVC
- Building Wireless Sensor Networks Using Arduino
- INSTANT Silverlight 5 Animation
- Python 3 數(shù)據(jù)分析與機(jī)器學(xué)習(xí)實(shí)戰(zhàn)
- 大學(xué)計(jì)算機(jī)基礎(chǔ)實(shí)驗(yàn)指導(dǎo)
- Moodle 3 Administration(Third Edition)
- 算法圖解
- Learning Python Data Visualization
- Python第三方庫開發(fā)應(yīng)用實(shí)戰(zhàn)