CHAPTER 1
SQL Server Analysis Services is one of several components available as part of Microsoft SQL Server 2012 that you can use to develop a business intelligence analytic solution. In this introduction to SQL Server Analysis Services, I explain the concept of business intelligence and all available options for architecting a business intelligence solution. I also review the process of developing an Analysis Services database at a high level and introduce the tools you use to build, manage, and query Analysis Services.
Business intelligence means different things to different people. Regardless of how broadly or narrowly the term is used, a globally accepted concept is that it supports the decision-making process in organizations. In short, people at all levels of an organization must gather information about the events occurring in their business before making a decision that can help that business make or save money.
A common problem in many businesses is the inability of the operational systems gathering details about business events to facilitate the information-gathering process and consequently the decision-making process is impeded. When the only source of information is an operational system, at worst people rely on gut instinct and make ill-informed decisions because they cannot get the information they need, while at best people have tools or other people to help them compile the needed data, but that process takes time and is tedious.
Most business applications store data in relational systems, which anyone can query if they have the right tools, skills, and security clearance. Why then is it necessary to move the data into a completely different type of database? To understand this requirement and why Analysis Services is included in a business intelligence solution, it’s helpful to compare the behavior of a relational engine like SQL Server with an Online Analytical Processing (OLAP) engine like Analysis Services. First, let’s consider the three types of questions that are important to decision makers as they analyze data to understand what’s happening in the business:
Note: For the purposes of this book, I use summary, comparison, and consolidation questions to represent the business requirements for a business intelligence solution to build. Although the scenario I discuss is extremely simple, the same principles that I describe here also apply to real-world scenarios for which decision-makers have many more questions that require answers that the data can answer, if only it were structured in a better way..
Each of these types of queries can be problematic when the data is available in a relational engine only for the following reasons:
An OLAP engine solves these problems in the following ways:
Multidimensional or Tabular? |
There are several different ways that you can architect Analysis Services:
Note: Although the focus of this book is the multidimensional server mode for Analysis Services, the architecture for an environment that includes Analysis Services in tabular server mode is similar. Whereas a multidimensional database requires relational data sources, a tabular database can also use spreadsheets, text data, and other sources. You can use the same client tools to query the databases.
In the prototype architecture, your complete environment can exist on a single server, although you are not required to set it up this way. It includes a relational data source, an Analysis Services instance, and a client tool for browsing the Analysis Services database, as shown in Figure 1. The relational data source can be a SQL Server, DB2, Oracle, or any database that you can access with an OLE DB driver. For prototyping purposes, you can use the Developer Edition of Analysis Services, but if you think the prototype will evolve into a permanent solution, you can use the Standard, Business Intelligence, or Enterprise Edition, depending on the features you want to implement as described in Table 1. For browsing the prototype database, Excel 2007 or higher is usually sufficient.

Feature | Standard Edition | Business Intelligence Edition | Developer and Enterprise Editions |
|---|---|---|---|
Account Intelligence | Yes | Yes | Yes |
Actions | Yes | Yes | Yes |
Advanced Dimensions (Reference, Many-to-Many) | Yes | Yes | Yes |
Advanced Hierarchy Types (Parent-Child, Ragged) | Yes | Yes | Yes |
Aggregations | Yes | Yes | Yes |
Binary and Compressed XML Transport | Yes | Yes | Yes |
Custom Assemblies | Yes | Yes | Yes |
Custom Rollups | Yes | Yes | Yes |
Dimension and Cell Level Security | Yes | Yes | Yes |
Direct Writeback | No | Yes | Yes |
Drillthrough | Yes | Yes | Yes |
Hierarchies | Yes | Yes | Yes |
High Availability | Yes | Yes | Yes |
KPIs | Yes | Yes | Yes |
Linked Measures and Dimensions | No | Yes | Yes |
MDX Queries and Scripts | Yes | Yes | Yes |
Measure Expressions | No | Yes | Yes |
MOLAP, ROLAP, and HOLAP Storage Modes | Yes | Yes | Yes |
Multiple Partitions | Up to 3 | Yes | Yes |
Perspectives | No | Yes | Yes |
Proactive Caching | No | Yes | Yes |
Programmability (AMO, AMOMD.NET, OLEDB, XML/A, ASSL) | Yes | Yes | Yes |
Push-Mode Processing | No | Yes | Yes |
Role-Based Security Model | Yes | Yes | Yes |
Scalable Shared Databases (Attach/Detach, Read Only) | No | Yes | Yes |
Scalable String Storage | Yes | Yes | Yes |
Semi-additive Measures | LastChild only | Yes | Yes |
Time Intelligence | Yes | Yes | Yes |
Translations | Yes | Yes | Yes |
Writeback Cells | Yes | Yes | Yes |
Writeback Cube | Yes | Yes | Yes |
Writeback Dimensions | No | Yes | Yes |
For a personal or team solution, you introduce automation to keep data current in Analysis Services. You use the same components described in the prototype architecture: a data source, Analysis Services, and a browsing tool. However, as shown in Figure 2, you add Integration Services as an additional component to the environment. Integration Services uses units called packages to describe tasks to execute. You can then use a scheduled process to execute one or more packages that update the data in the Analysis Services database. Excel is still a popular choice as a browsing tool, but you might also set up Reporting Services to provide access to standard reports that use Analysis Services as a data source.

To set up an architecture for organizational use, as shown in Figure 3, you introduce a data mart or data warehouse to use as a source for the data that is loaded into Analysis Services. Integration Services updates the data in the data mart on a periodic basis and then loads data into Analysis Services from the data mart. In addition to Excel or Reporting Services as client tools, you can also use SharePoint business intelligence features, which include Excel Services, SharePoint status indicators and dashboards, or PerformancePoint scorecards and dashboards.

If you are responsible for creating or maintaining an Analysis Services database, you use the following tools:
SSDT is the environment you use to develop an Analysis Services database. Using this tool, you work with a solution that contains one or more projects, just like you would when developing applications in Visual Studio.
You can use SSMS to configure server properties that determine how the server uses system resources. You can also use Object Explorer to see the databases deployed to the server and explore the objects contained within each database. Not only can you view an object’s properties, but in some cases you can also make changes to those properties. Furthermore, you can create scripts of an object’s definition to reproduce it in another database or on another server.
SSMS also gives you a way to quickly check data either in the cube itself or in individual dimensions. You can use the MDX query window to write and execute queries that retrieve data from the cube. A graphical interface is also available for browsing these objects without the need to write a query.
Another feature in SSMS is the XML for Analysis (XMLA) query window in which you write and execute scripts. You can use XMLA scripts to create, alter, or drop database objects and also to process objects, which is the way that data is loaded into an Analysis Services database. You can then put these scripts into Integration Services packages to automate their execution or you can put them into SQL Server Agent jobs. However, you are not required to use scripts for processing. You can instead manually process objects in SSMS whenever necessary or create Integration Services packages to automate processing.
As part of the development process, you should use the client tools that your user community is likely to use to ensure the browsing experience works as intended. In this chapter, I explain the choice of client tools available from Microsoft, but there are also several third-party options to consider, and of course you can always create a custom application if you want users to have specific functionality available. The Microsoft business intelligence stack includes the following tools:




Before diving into the details of Analysis Services database development, let’s take a look at the general process:
First, you start by designing a dimensional model. You use either an existing dimensional model that you already have in a data mart or data warehouse, or you define the tables or views that you want to use as sources, set up logical primary keys, and define relationships to produce a structure that’s very similar to a dimensional model that you would instantiate in the relational database. I describe this step in more detail in Chapter 2, “Designing the dimensional model.”
Once the dimensional model is in place, you then work through the development of the dimension objects. When browsing a cube, you use dimensions to “slice and dice” the data. You will learn more about this step in the process in Chapter 3, “Developing dimensions.”
The next step is to develop one or more cubes for the database. This is often an iterative process where you might go back and add more dimensions to the database and then return to do more development work on a cube. I will explain more about this in Chapter 4, “Developing cubes.”
Eventually you add calculations to the cube to store the business logic in the cube for data that’s not available in the raw data. There are specialized types of calculations to produce sets of dimension members and key performance indicators. You will learn how to work with all these types of calculations in Chapter 5, “Enhancing cubes with MDX.”
During and after the development work, you deploy the database to the server and process objects to load them with data. It’s not necessary to wait until you’ve completed each step in the development process to deploy. It’s very common to develop a dimension, deploy it so that you can see the results, go back and modify the dimension, and then deploy again. You continue this cycle until you are satisfied with the dimension, and then you are ready to move on to the development of the next dimension.
To start the multidimensional database development process in SSDT, you create a new project in SSDT. Here you can choose from one of the following project types:
Whether you start with an empty Analysis Services project or import objects from an existing Analysis Services database, there are several different types of project items that you have in an Analysis Services project: