Browse all of the other dimensions and check for any errors or inconsistencies

Một phần của tài liệu Pro SQL server 2012 BI solutions (Trang 434 - 441)

eXerCISe 10-3: DepLOYING, prOCeSSING, aND BrOWSING the DIMeNSIONS

4. Browse all of the other dimensions and check for any errors or inconsistencies

In this exercise, you deployed, processed, and browsed the dimensions that you created earlier. It is now time to create a cube so that these dimensions can be associated with our measures. Let’s discuss how that can be done in the next chapter.

Moving On

We have now completed the dimensions, but we still need to create cubes that use them! In our next chapter, we create a cube, show how cubes and dimensions are interconnected, and discuss basic cube configurations.

LearN BY DOING

For this “Learn by Doing” exercise, configure dimensions similar to the ones defined in this chapter using the northwind database. we have included an outline of the steps you performed in this chapter and an example of how the authors handled them in two word documents. These documents are found in the folder C:\_BookFiles\_LearnByDoing\Chapter10Files. Please see the ReadMe.doc for detailed instructions.

What’s Next?

At this point, you now have a good idea of how dimensions are created and configured using Visual Studio.

But there is still so much more to tell. We are going to address some of these items in Chapter 11, but for more detailed information on this subject, we have found the following book to be quite useful. And although it is an older book, most of the details still apply to all versions of SSAS from SQL 2005 and on.

Expert Cube Development with Microsoft SQL Server 2008 Analysis Services]

By Marco Russo, Alberto Ferrari, Chris Webb Publisher: Packt Publishing

Creating and Configuring SSAS Cubes

Once I completed the cube and demonstrated it to my students, I realized it was nearly impossible to put down.

—Erno Rubik In the previous two chapters, we prepared dimensions for our cube (or cubes, if you are creating a BI solution that uses more than one). Now it is time to make the cube and find out whether the cube and dimensions are presenting the right report data. We then resolve any issues using common SSAS configurations.

In this chapter, you learn how to create and configure Analysis Server cubes. We show you how to configure the cubes using Business Intelligence Development Studio and how to manage these objects using SQL Server Management Studio. Let’s get going and create our cube now!

Tip

■ As you will see in this chapter, the process of creating dimensions and cubes is similar. Neither will ever interact directly with the data warehouse; instead, they interact with an SSAS Data Source View as an abstraction layer. Microsoft refers to this design as the unified dimensional model (UDM). This terminology can be confusing, because Microsoft also refers to SSAS cubes as UDMs as well, and uses the terms interchangeably.

Creating Cubes

We begin creating our cubes using the dimensions that we recently completed and tested. And surprise, surprise—this is performed using a wizard. Even if you are not a wizard fan, the Cube Wizard is short and to the point and does not limit your control over your cube later, so we consider it a useful tool.

To start the wizard, right-click the Cubes folder and select New Cube from the context menu (Figure 11-1).

When the wizard opens, click Next to navigate from the Welcome dialog window to the Select Creation Method dialog window.

In the Select Creation Method dialog window, typically you would leave the “Use existing tables” radio button checked and click the Next button to continue (Figure 11-2). But, other options may occasionally be useful.

Figure 11-2. Selecting a creation method Figure 11-1. Starting the Cube Wizard

The second radio button, “Create an empty cube,” allows you to create an empty cube that you can add to later. This option bypasses the remainder of the wizard.

The third radio button, “Generate tables in the data source,” allows you to create virtual tables in the data source view. These tables can be scripted into SQL code that can then be run on your data warehouse to create the real relational tables. This is an interesting option because it allows you to start with a blank data warehouse and creates your cube first, designing your measures and your dimensions on top of the blank data warehouse.

After you have finished configuring your cube and dimensions in the SSAS project, you can have Visual Studio generate an entire SQL script that will create your data warehouse tables.

The third option, “Generate tables in the data source,” includes a dropdown box that allows you to use predefined templates for your cube and dimensions. These templates are just the XML files that came from another Visual Studio SSAS project. You can make one of these templates yourself by making an SSIS project, configuring it as you like, and then copying all the files and folders for the project to a predefined folder that comes with your SQL installation. Your path may vary, but the standard installation places the folder at this location:

C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Templates\olap\1033\Cube Templates.

The basic concept behind this template option is that a consultant can make a predefined cube and dimension structure that the client’s company recommends. The consultant would then bring it to the client’s site, modify the cube and dimensions to the client’s needs, and then reverse engineer the data warehouse to fit the cubes and dimensions in the SSAS project. Afterward, the developer needs to set up an ETL process to fill the new data warehouse, but this is just one more way to implement a BI project.

After you select the creation method, click Next to advance the wizard to the Select Measure Group Tables dialog window. This window allows you to choose which fact tables will be included in the cube (Figure 11-3).

Figure 11-3. Selecting the measure group tables

In our example, we have two fact tables: one that contains the measures and one that is used as a bridge between the Authors many-to-many dimension. As you can see in Figure 11-3, we select both tables, because both are necessary if we want to use all of the dimensions we created.

Clicking Next moves you to the Select Measures dialog window shown in Figure 11-4. You need to decide which measures are appropriate to use. In our example, we leave them all checked.

The wizard suggests columns and measures to use by comparing the columns’ data types. For example, Author Order is recommended as a measure because it is a fact table and it has a numeric value. This simple criteria is how the wizard decides what should and should not be included.

As you can see in Figure 11-4, Fact Sales Count and Fact Titles Authors Count have been added. The wizard suggests these additional measures to provide row counts for Fact Sales and Fact Titles Authors for your convenience, in case you need totals for each. The wizard labels these as Count measures for you, but you can change the names if you prefer.

Count rows can always be deleted later. And, because measures can be added or subtracted after the wizard is complete, keeping the default settings as is for this dialog window will not be an issue.

Clicking Next moves you to the Select Existing Dimensions dialog window, as shown in Figure 11-5. In this dialog window, you can select one or more of the dimensions you have already created. If no dimensions have been created, the wizard skips over this dialog window to another that allows you to create simple dimensions right from the Cube Wizard. (That particular window will not appear in our example, however, because we already created the dimensions.)

Figure 11-5. Selecting existing dimensions

Figure 11-4. Selecting the measures to use in the cube

After the dimensions have been selected, clicking Next usually brings you to the end of the wizard, as shown in Figure 11-6 (that is, unless the wizard senses that there could be additional dimensions created based on the relationship lines in the data source view). In other words, if you created some of the dimensions, let’s say only four of the five dimension tables, the Cube Wizard will see that there is a missing dimension and offer to create it for you in the Select New Dimensions dialog window (Figure11-6).

Figure 11-6. The optional Select New Dimensions dialog window

the CUBe WIZarD CaN aLSO Create DIMeNSIONS

The Cube Wizard allows you to create dimensions while you create the cube. This means that when you create a Visual Studio SSAS project, you do not necessarily have to start creating the dimensions before you create the cube. instead, you can go right to creating the cube and have the wizard generate the basic outline of your dimensions for you using the Select New Dimensions dialog window, as shown in Figure 11-6. This option does not provide you with any additional advantage over creating your dimensions first. Therefore, we have found that using it is a somewhat redundant feature.

When you create all of the dimensions before launching the Cube Wizard, you immediately proceed to the final dialog window of the wizard from the Select Existing Dimensions dialog window. In this window, you see an overview of your design and have a chance to rename the cube to something appropriate. In our example in Figure 11-7, we named it DWPubsSalesVer1.

After you have finished the Cube Wizard, Visual Studio displays the cube designer window, as shown in Figure 11-8. From here you can configure the cube using the various tabs that are included in the designer.

Figure 11-7. Completing the Cube Wizard

Figure 11-8. The cube designer window

Một phần của tài liệu Pro SQL server 2012 BI solutions (Trang 434 - 441)

Tải bản đầy đủ (PDF)

(823 trang)