Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
SQL Server Analysis Services 2012 Cube Development Cookbook
SQL Server Analysis Services 2012 Cube Development Cookbook

SQL Server Analysis Services 2012 Cube Development Cookbook: If you prefer the instructional approach to a lot of theory, this cookbook is for you. It takes you straight into building data cubes through hands-on recipes, helping you get to grips with SQL Server Analysis Services fast.

eBook
€35.98 €39.99
Paperback
€49.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

SQL Server Analysis Services 2012 Cube Development Cookbook

Chapter 2. Defining Analysis Services Dimensions

In this chapter, we will cover the following recipes:

  • Defining data sources
  • Defining data source views
  • Defining entity relationships in DSV
  • Extending data source views
  • Creating named calculations and queries
  • Creating simple dimensions
  • Building dimension hierarchies
  • Setting up dimension properties
  • Setting up the essential attribute properties
  • Browsing dimension data
  • Sorting the attributes
  • Customizing advanced attribute properties
  • Creating parent-child dimensions
  • Creating date and time dimensions

Introduction

This chapter explains how to build and configure most commonly encountered SQL Server Analysis Services (SSAS) dimensions. Each Analysis Services multidimensional project consists of dimensions and cubes; knowing how to define and customize dimensions is essential for building successful business intelligence solutions. Analysis Services builds data structures based on one or multiple relational data sources. Therefore, before creating dimensions and cubes, you need to define data sources and their corresponding data source views—layers of abstraction between the relational database and Analysis Services objects. After you define data source views, you can create simple dimensions using a dimension wizard and subsequently customize and enhance dimensions as needed using a dimension editor.

SQL Server Data Tools (SSDT) is the primary client tool for developing Analysis Services solutions. In prior versions of SQL Server, the same tool was called Business Intelligence...

Defining data sources

Each Analysis Services project could use multiple data sources. The traditional approach is to first build a staging relational database where you import data from various data repositories within your enterprise. Subsequently, you would build a dimensional model using a Star or Snowflake schema, as opposed to a normalized model you would typically use for a transactional database, for your data warehouse that has fact and dimension tables. Lastly, you build the Analysis Services solution using the dimensional model within the relational data source. This approach is still recommended, because it allows you to have more control over your data cleansing routines prior to building Analysis Services objects.

On the other hand, SSDT does give you the flexibility to connect to various relational databases and define necessary data structures within data source views, if you don't have the luxury of building the staging area or the star schema database. However, this...

Defining data source views

Data source view (DSV) serves as a layer of abstraction between a relational data source and SSAS objects. You can import existing tables and views from relational sources into a DSV. DSVs also allow defining new columns and views (named calculations and named queries, respectively) based on the existing structures within your data sources. Let's learn how to create and enhance DSVs.

Getting started

A prerequisite to building a DSV is defining at least one data source. Build a data source before working on DSVs by following a previous recipe.

How to do it...

To define a DSV, perform the following steps:

  1. Right-click on the Data Source Views folder in SSDT's Solution Explorer and choose New Data Source View. This activates the Data Source View Wizard. This wizard allows using the existing data source or defining a new one. If you choose to create a new data source, you will go through the same steps we discussed earlier in this chapter. For this example let...

Defining entity relationships in DSV

While creating a data source view, you noticed that SSDT automatically detected primary and foreign keys between DimDate and fact tables and established their respective relationships. If our data source does not have referential integrity constraints, we would have to define the logical primary keys and necessary relationships directly within the DSV.

To set up relationships between two objects within a DSV, dimension objects (tables or views) must have a primary key column and fact tables must reference this column. The column names in fact and dimension tables do not need to match, but they must have compatible data types. For example, you cannot create a relationship between an integer and string columns.

How to do it...

Let's get started; the following are the steps to define the entity relation in DSV:

  1. To define a logical primary key on an object that does not already have one, right-click on the column that uniquely identifies each record in...

Extending data source views

Now that you know how to create a DSV, you are ready to learn how to extend it. In the previous recipe we imported a few tables from a relational data source, but that might not be sufficient to complete your data model. You may need to import objects from multiple data sources, define calculations, or add new data views.

How to do it...

To add or remove objects from the existing DSV, perform the following steps:

  1. Right-click on any blank area within the DSV and choose Add/Remove Tables; this opens the corresponding dialog shown in the following screenshot:
    How to do it...
  2. This screen should look familiar from the previous section when you first created the DSV. You could easily add or remove objects to the DSV by clicking on appropriate buttons. One notable difference is the Data source drop-down box. If we had defined multiple data sources, we could import objects into the same DSV using multiple sources. In order to include objects from multiple data sources into a single DSV...

Introduction


This chapter explains how to build and configure most commonly encountered SQL Server Analysis Services (SSAS) dimensions. Each Analysis Services multidimensional project consists of dimensions and cubes; knowing how to define and customize dimensions is essential for building successful business intelligence solutions. Analysis Services builds data structures based on one or multiple relational data sources. Therefore, before creating dimensions and cubes, you need to define data sources and their corresponding data source views—layers of abstraction between the relational database and Analysis Services objects. After you define data source views, you can create simple dimensions using a dimension wizard and subsequently customize and enhance dimensions as needed using a dimension editor.

SQL Server Data Tools (SSDT) is the primary client tool for developing Analysis Services solutions. In prior versions of SQL Server, the same tool was called Business Intelligence Development...

Defining data sources


Each Analysis Services project could use multiple data sources. The traditional approach is to first build a staging relational database where you import data from various data repositories within your enterprise. Subsequently, you would build a dimensional model using a Star or Snowflake schema, as opposed to a normalized model you would typically use for a transactional database, for your data warehouse that has fact and dimension tables. Lastly, you build the Analysis Services solution using the dimensional model within the relational data source. This approach is still recommended, because it allows you to have more control over your data cleansing routines prior to building Analysis Services objects.

On the other hand, SSDT does give you the flexibility to connect to various relational databases and define necessary data structures within data source views, if you don't have the luxury of building the staging area or the star schema database. However, this flexibility...

Defining data source views


Data source view (DSV) serves as a layer of abstraction between a relational data source and SSAS objects. You can import existing tables and views from relational sources into a DSV. DSVs also allow defining new columns and views (named calculations and named queries, respectively) based on the existing structures within your data sources. Let's learn how to create and enhance DSVs.

Getting started

A prerequisite to building a DSV is defining at least one data source. Build a data source before working on DSVs by following a previous recipe.

How to do it...

To define a DSV, perform the following steps:

  1. Right-click on the Data Source Views folder in SSDT's Solution Explorer and choose New Data Source View. This activates the Data Source View Wizard. This wizard allows using the existing data source or defining a new one. If you choose to create a new data source, you will go through the same steps we discussed earlier in this chapter. For this example let's use the...

Defining entity relationships in DSV


While creating a data source view, you noticed that SSDT automatically detected primary and foreign keys between DimDate and fact tables and established their respective relationships. If our data source does not have referential integrity constraints, we would have to define the logical primary keys and necessary relationships directly within the DSV.

To set up relationships between two objects within a DSV, dimension objects (tables or views) must have a primary key column and fact tables must reference this column. The column names in fact and dimension tables do not need to match, but they must have compatible data types. For example, you cannot create a relationship between an integer and string columns.

How to do it...

Let's get started; the following are the steps to define the entity relation in DSV:

  1. To define a logical primary key on an object that does not already have one, right-click on the column that uniquely identifies each record in the table...

Extending data source views


Now that you know how to create a DSV, you are ready to learn how to extend it. In the previous recipe we imported a few tables from a relational data source, but that might not be sufficient to complete your data model. You may need to import objects from multiple data sources, define calculations, or add new data views.

How to do it...

To add or remove objects from the existing DSV, perform the following steps:

  1. Right-click on any blank area within the DSV and choose Add/Remove Tables; this opens the corresponding dialog shown in the following screenshot:

  2. This screen should look familiar from the previous section when you first created the DSV. You could easily add or remove objects to the DSV by clicking on appropriate buttons. One notable difference is the Data source drop-down box. If we had defined multiple data sources, we could import objects into the same DSV using multiple sources. In order to include objects from multiple data sources into a single DSV,...

Creating named calculations and queries


Named calculations allow extending an existing object to include data structures necessary for defining a dimension. The most common example is of combining the first and last name columns into a single column named as full_name. Similarly, we could concatenate the quarter and year columns to define a full description for each calendar quarter, as in Quarter 2, 2013. If you have sufficient access to the relational database, you have an option of creating any views you need for building dimensions; this approach is favored by many data warehouse and cube developers. However, it is also plausible that you won't have permission to create or alter relational objects. There is no need to worry though; named calculations are here to help. For example, suppose you have the Employee dimension based on the DimEmployee table, which includes the FirstName and LastName columns. This could be great for relational design, but you'll need to define a named calculation...

Creating simple dimensions


The Analysis Services dimension allows examining data across a specific business vertical. For example, the Product dimension allows managers to see which products generated the most revenue, and the Geography dimension helps determine the most profitable regions. Each dimension is based on a corresponding table or view in the relational data source; dimension table's columns will correspond to SSAS dimension attributes. Analysis Services allows creation of very simple as well as very complex dimension structures. There are many dimension and attribute properties which let us customize each dimension to meet specific business requirements. Let's begin by creating a simple dimension and then working our way through more complex ones.

Getting ready

To complete this recipe, we must have at least one data source view with necessary tables, views, named queries, and named calculations.

How to do it...

To create a dimension perform the following steps:

  1. Right-click on the...

Building dimension hierarchies


Analysis Services hierarchies specify the navigation path for browsing dimension data. There are two types of hierarchies: attribute and user-defined hierarchies. For example, in the promotion dimension we just created, we immediately have a hierarchy for each attribute: Promotion Name, Start Date, End Date, English Promotion Category, English Promotion Type, Discount Percent, Minimum Quantity, and Maximum Quantity. Attribute hierarchies contain two levels.

The top-level is referred to as the All level and includes the aggregated value for all the members included in the attribute. For example, the English Promotion Category attribute hierarchy's All level will show the aggregate value of sales for all the promotion categories: Customer, No Discount, and Reseller. The other level in the same hierarchy will show individual promotion categories, such as Customer.

User hierarchies combine multiple attributes and must be defined explicitly. In this recipe we will...

Setting essential attribute properties


While running the Dimension Wizard to create the Promotion dimension, you learned that each attribute has name and key properties. Choosing appropriate columns for these properties is essential for having the correct attribute design, so we will discuss them in greater detail here.

How to do it...

The steps for setting essential attribute properties are as follows:

  1. The key property must uniquely identify the attribute and could consist of multiple columns. For example, if we have a date dimension that includes the quarter number column, with values quarter 1, quarter 2, and so on, this column alone won't be sufficient to uniquely identify each quarter because quarter names would be duplicated for each year. Instead, the key property should be set to a combination of quarter and year columns. If we don't explicitly specify the attribute key, Analysis Services will use the same column as the attribute key and name, but attribute names might not always be...

Left arrow icon Right arrow icon

Key benefits

  • Develop Business Intelligence solutions using a multi-dimensional model as well as a tabular model
  • Explore cube maintenance with partitions and design effective aggregations, as well as analyzing options for scaling analytics solutions
  • Includes recipes for administering, securing, monitoring, and troubleshooting Analysis Services solutions

Description

Microsoft SQL Server is a relational database management system. As a database, it is a software product whose primary function is to store and retrieve data as requested by other software applications. SQL Server Analysis Services adds OLAP and data mining capabilities for SQL Server databases. OLAP (online analytical processing) is a technique for analyzing business data for effective business intelligence. This practical guide teaches you how to build business intelligence solutions using Microsoft’s core product – SQL Server Analysis Services. The book covers the traditional multi-dimensional model which has been around for over a decade as well as the tabular model introduced with SQL Server 2012. Starting with comparing MultiDimensional and tabular models – discussing the values and limitations of each, you will then cover the essential techniques for building dimensions and cubes. Following on from this, you will be introduced to more advanced topics, such as designing partitions and aggregations, implementing security, and synchronizing databases for solutions serving many users. The book also covers administrative material, such as database backups, server configuration options, and monitoring and tuning performance. We also provide a primer on MultiDimensional eXpressions (MDX) as well as Data Analysis expressions (DAX) languages. This book provides you with data cube development techniques, and also the ongoing monitoring and tuning for Analysis Services.

Who is this book for?

If you are a BI or ETL developer using SQL Server Analysis services to build OLAP cubes, this book is ideal for you. Prior knowledge of relational databases and experience with Excel as well as SQL development is required.

What you will learn

  • Design commonly encountered dimensions
  • Extend your cubes to include advanced features such as actions, translations, and key performance indicators
  • Maintain cubes by adding/removing data using partitions
  • Administer Analysis Services instance
  • Scale out your solution by synchronizing cube data
  • Build tabular model solutions

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 26, 2013
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781849689816
Vendor :
Microsoft
Category :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 26, 2013
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781849689816
Vendor :
Microsoft
Category :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 129.97
SQL Server Analysis Services 2012 Cube Development Cookbook
€49.99
Microsoft SQL Server 2012 Integration Services: An Expert Cookbook
€37.99
Getting Started with SQL Server 2012 Cube Development
€41.99
Total 129.97 Stars icon

Table of Contents

13 Chapters
1. Introduction to Multidimensional Data Model Design Chevron down icon Chevron up icon
2. Defining Analysis Services Dimensions Chevron down icon Chevron up icon
3. Creating Analysis Services Cubes Chevron down icon Chevron up icon
4. Extending and Customizing Cubes Chevron down icon Chevron up icon
5. Optimizing Dimension and Cube Processing Chevron down icon Chevron up icon
6. MDX Chevron down icon Chevron up icon
7. Analysis Services Security Chevron down icon Chevron up icon
8. Administering and Monitoring Analysis Services Chevron down icon Chevron up icon
9. Using Tabular Models Chevron down icon Chevron up icon
10. DAX Calculations and Queries Chevron down icon Chevron up icon
11. Performance Tuning and Troubleshooting Tabular Models Chevron down icon Chevron up icon
A. Miscellaneous Analysis Services Topics Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Dimitri Shvorob May 11, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The title, and the "Overview" section below it, misrepresent the book and limit its audience by portraying it as a collection of "recipes" for advanced SSAS users. In fact, the book offers a comprehensive tutorial of SSAS Multidimensional, and is suited to beginner and (especially) intermediate audiences. (Beginners can also consider the lighter "Getting started with SQL Server 2012 cube development" by Simon Lidberg, and everybody's learning of MDX should start with "Microsoft SQL Server 2008 MDX Step by Step" by Smith and Clay). Originally I gave the book four stars, but after re-reading it a few months later, I am easily giving it five, recognizing both its quality and its "unique selling proposition" as "the" intermediate SSAS-Multidimensional book on the market.
Amazon Verified review Amazon
Pethuru Raj Jun 11, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I got a golden opportunity to read through the book titled as “SQL Server Analysis Services 2012 Cube Development Cookbook”. This is well-written book for business intelligence (BI) application developers and system administrators. Especially those who are conversant with the Microsoft product “SQL Server Analysis Services” are to be benefited immensely through this easy-to-grasp book. This book gives step-by-step recipes for developing Analysis Services objects that can be composed to craft composite Analytics services that are more business-aware and attuned. Those passionate readers can quickly learn through a flurry of practical examples on deriving robust and resilient BI solutions for a variety of scenarios using the Analysis Services multidimensional model as well as the Tabular model. The book discusses methods beyond the initial cube design, exploring cube maintenance with partitions and designing effective aggregations, as well as options for synchronizing analytics solutions.This book is stuffed with a number of practical techniques and tips and hence is a definite companion for developers, consultants and administrators to go deeper into the fast-enlarging BI space.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.