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
$65.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781849689809
Vendor :
Microsoft
Category :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Dec 26, 2013
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781849689809
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 $ 169.97
SQL Server Analysis Services 2012 Cube Development Cookbook
$65.99
Microsoft SQL Server 2012 Integration Services: An Expert Cookbook
$48.99
Getting Started with SQL Server 2012 Cube Development
$54.99
Total $ 169.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.