10778A-ENU-TrainerHandbook-Part 2
10778A-ENU-TrainerHandbook-Part 2
10778A
Implementing Data Models and Reports
with Microsoft® SQL Server® 2012
MCT USE ONLY. STUDENT USE PROHIBITED
ii Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Information in this document, including URL and other Internet Web site references, is subject to change
without notice. Unless otherwise noted, the example companies, organizations, products, domain names,
e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with
any real company, organization, product, domain name, e-mail address, logo, person, place or event is
intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the
user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in
or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written permission of
Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these
patents, trademarks, copyrights, or other intellectual property.
The names of manufacturers, products, or URLs are provided for informational purposes only and
Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding
these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a
manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links
may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not
responsible for the contents of any linked site or any link contained in a linked site, or any changes or
updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission
received from any linked site. Microsoft is providing these links to you only as a convenience, and the
inclusion of any link does not imply endorsement of Microsoft of the site or the products contained
therein.
© 2012 Microsoft Corporation. All rights reserved.
Released: 5/2012
MCT USE ONLY. STUDENT USE PROHIBITED
MICROSOFT LICENSE TERMS
OFFICIAL MICROSOFT LEARNING PRODUCTS
MICROSOFT OFFICIAL COURSE Pre-Release and Final Release Versions
These license terms are an agreement between Microsoft Corporation and you. Please read them. They apply to
the Licensed Content named above, which includes the media on which you received it, if any. These license
terms also apply to any updates, supplements, internet based services and support services for the Licensed
Content, unless other terms accompany those items. If so, those terms apply.
BY DOWNLOADING OR USING THE LICENSED CONTENT, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT
THEM, DO NOT DOWNLOAD OR USE THE LICENSED CONTENT.
If you comply with these license terms, you have the rights below.
1. DEFINITIONS.
a. “Authorized Learning Center” means a Microsoft Learning Competency Member, Microsoft IT Academy
Program Member, or such other entity as Microsoft may designate from time to time.
b. “Authorized Training Session” means the Microsoft-authorized instructor-led training class using only
MOC Courses that are conducted by a MCT at or through an Authorized Learning Center.
c. “Classroom Device” means one (1) dedicated, secure computer that you own or control that meets or
exceeds the hardware level specified for the particular MOC Course located at your training facilities or
primary business location.
d. “End User” means an individual who is (i) duly enrolled for an Authorized Training Session or Private
Training Session, (ii) an employee of a MPN Member, or (iii) a Microsoft full-time employee.
e. “Licensed Content” means the MOC Course and any other content accompanying this agreement.
Licensed Content may include (i) Trainer Content, (ii) sample code, and (iii) associated media.
f. “Microsoft Certified Trainer” or “MCT” means an individual who is (i) engaged to teach a training session
to End Users on behalf of an Authorized Learning Center or MPN Member, (ii) currently certified as a
Microsoft Certified Trainer under the Microsoft Certification Program, and (iii) holds a Microsoft
Certification in the technology that is the subject of the training session.
g. “Microsoft IT Academy Member” means a current, active member of the Microsoft IT Academy
Program.
h. “Microsoft Learning Competency Member” means a Microsoft Partner Network Program Member in
good standing that currently holds the Learning Competency status.
i. “Microsoft Official Course” or “MOC Course” means the Official Microsoft Learning Product instructor-
led courseware that educates IT professionals or developers on Microsoft technologies.
MCT USE ONLY. STUDENT USE PROHIBITED
j. “Microsoft Partner Network Member” or “MPN Member” means a silver or gold-level Microsoft Partner
Network program member in good standing.
k. “Personal Device” means one (1) device, workstation or other digital electronic device that you
personally own or control that meets or exceeds the hardware level specified for the particular MOC
Course.
l. “Private Training Session” means the instructor-led training classes provided by MPN Members for
corporate customers to teach a predefined learning objective. These classes are not advertised or
promoted to the general public and class attendance is restricted to individuals employed by or
contracted by the corporate customer.
m. “Trainer Content” means the trainer version of the MOC Course and additional content designated
solely for trainers to use to teach a training session using a MOC Course. Trainer Content may include
Microsoft PowerPoint presentations, instructor notes, lab setup guide, demonstration guides, beta
feedback form and trainer preparation guide for the MOC Course. To clarify, Trainer Content does not
include virtual hard disks or virtual machines.
2. INSTALLATION AND USE RIGHTS. The Licensed Content is licensed not sold. The Licensed Content is
licensed on a one copy per user basis, such that you must acquire a license for each individual that
accesses or uses the Licensed Content.
2.1 Below are four separate sets of installation and use rights. Only one set of rights apply to you.
ii. Use of Instructional Components in Trainer Content. You may customize, in accordance with the
most recent version of the MCT Agreement, those portions of the Trainer Content that are logically
associated with instruction of a training session. If you elect to exercise the foregoing rights, you
agree: (a) that any of these customizations will only be used for providing a training session, (b) any
customizations will comply with the terms and conditions for Modified Training Sessions and
Supplemental Materials in the most recent version of the MCT agreement and with this agreement.
For clarity, any use of “customize” refers only to changing the order of slides and content, and/or
not using all the slides or content, it does not mean changing or modifying any slide or content.
2.2 Separation of Components. The Licensed Content components are licensed as a single unit and you
may not separate the components and install them on different devices.
2.4 Third Party Programs. The Licensed Content may contain third party programs or services. These
license terms will apply to your use of those third party programs or services, unless other terms accompany
those programs and services.
2.5 Additional Terms. Some Licensed Content may contain components with additional terms,
conditions, and licenses regarding its use. Any non-conflicting terms in those conditions and licenses also
apply to that respective component and supplements the terms described in this Agreement.
3. PRE-RELEASE VERSIONS. If the Licensed Content is a pre-release (“beta”) version, in addition to the other
provisions in this agreement, then these terms also apply:
a. Pre-Release Licensed Content. This Licensed Content is a pre-release version. It may not contain the
same information and/or work the way a final version of the Licensed Content will. We may change it
for the final version. We also may not release a final version. Microsoft is under no obligation to
provide you with any further content, including the final release version of the Licensed Content.
b. Feedback. If you agree to give feedback about the Licensed Content to Microsoft, either directly or
through its third party designee, you give to Microsoft without charge, the right to use, share and
commercialize your feedback in any way and for any purpose. You also give to third parties, without
charge, any patent rights needed for their products, technologies and services to use or interface with
any specific parts of a Microsoft software, Microsoft product, or service that includes the feedback. You
will not give feedback that is subject to a license that requires Microsoft to license its software,
technologies, or products to third parties because we include your feedback in them. These rights
MCT USE ONLY. STUDENT USE PROHIBITED
survive this agreement.
c. Term. If you are an Authorized Training Center, MCT or MPN, you agree to cease using all copies of the
beta version of the Licensed Content upon (i) the date which Microsoft informs you is the end date for
using the beta version, or (ii) sixty (60) days after the commercial release of the Licensed Content,
whichever is earliest (“beta term”). Upon expiration or termination of the beta term, you will
irretrievably delete and destroy all copies of same in the possession or under your control.
4. INTERNET-BASED SERVICES. Classroom Devices located at Authorized Learning Center’s physical location
may contain virtual machines and virtual hard disks for use while attending an Authorized Training
Session. You may only use the software on the virtual machines and virtual hard disks on a Classroom
Device solely to perform the virtual lab activities included in the MOC Course while attending the
Authorized Training Session. Microsoft may provide Internet-based services with the software included
with the virtual machines and virtual hard disks. It may change or cancel them at any time. If the
software is pre-release versions of software, some of its Internet-based services may be turned on by
default. The default setting in these versions of the software do not necessarily reflect how the features
will be configured in the commercially released versions. If Internet-based services are included with the
software, they are typically simulated for demonstration purposes in the software and no transmission
over the Internet takes place. However, should the software be configured to transmit over the Internet,
the following terms apply:
a. Consent for Internet-Based Services. The software features described below connect to Microsoft or
service provider computer systems over the Internet. In some cases, you will not receive a separate
notice when they connect. You may switch off these features or not use them. By using these features,
you consent to the transmission of this information. Microsoft does not use the information to identify
or contact you.
b. Computer Information. The following features use Internet protocols, which send to the appropriate
systems computer information, such as your Internet protocol address, the type of operating system,
browser and name and version of the software you are using, and the language code of the device
where you installed the software. Microsoft uses this information to make the Internet-based services
available to you.
• Accelerators. When you use click on or move your mouse over an Accelerator, the title and full web
address or URL of the current webpage, as well as standard computer information, and any content
you have selected, might be sent to the service provider. If you use an Accelerator provided by
Microsoft, the information sent is subject to the Microsoft Online Privacy Statement, which is
available at go.microsoft.com/fwlink/?linkid=31493. If you use an Accelerator provided by a third
party, use of the information sent will be subject to the third party’s privacy practices.
• Automatic Updates. This software contains an Automatic Update feature that is on by default. For
more information about this feature, including instructions for turning it off, see
go.microsoft.com/fwlink/?LinkId=178857. You may turn off this feature while the software is
running (“opt out”). Unless you expressly opt out of this feature, this feature will (a) connect to
Microsoft or service provider computer systems over the Internet, (b) use Internet protocols to send
to the appropriate systems standard computer information, such as your computer’s Internet
protocol address, the type of operating system, browser and name and version of the software you
are using, and the language code of the device where you installed the software, and (c)
automatically download and install, or prompt you to download and/or install, current Updates to
the software. In some cases, you will not receive a separate notice before this feature takes effect.
MCT USE ONLY. STUDENT USE PROHIBITED
By installing the software, you consent to the transmission of standard computer information and
the automatic downloading and installation of updates.
• Auto Root Update. The Auto Root Update feature updates the list of trusted certificate authorities.
you can switch off the Auto Root Update feature.
• Customer Experience Improvement Program (CEIP), Error and Usage Reporting; Error Reports. This
software uses CEIP and Error and Usage Reporting components enabled by default that
automatically send to Microsoft information about your hardware and how you use this software.
This software also automatically sends error reports to Microsoft that describe which software
components had errors and may also include memory dumps. You may choose not to use these
software components. For more information please go to
<http://go.microsoft.com/fwlink/?LinkID=196910>.
• Digital Certificates. The software uses digital certificates. These digital certificates confirm the
identity of Internet users sending X.509 standard encrypted information. They also can be used to
digitally sign files and macros, to verify the integrity and origin of the file contents. The software
retrieves certificates and updates certificate revocation lists. These security features operate only
when you use the Internet.
• Extension Manager. The Extension Manager can retrieve other software through the internet from
the Visual Studio Gallery website. To provide this other software, the Extension Manager sends to
Microsoft the name and version of the software you are using and language code of the device
where you installed the software. This other software is provided by third parties to Visual Studio
Gallery. It is licensed to users under terms provided by the third parties, not from Microsoft. Read
the Visual Studio Gallery terms of use for more information.
• IPv6 Network Address Translation (NAT) Traversal service (Teredo). This feature helps existing
home Internet gateway devices transition to IPv6. IPv6 is a next generation Internet protocol. It
helps enable end-to-end connectivity often needed by peer-to-peer applications. To do so, each
time you start up the software the Teredo client service will attempt to locate a public Teredo
Internet service. It does so by sending a query over the Internet. This query only transfers standard
Domain Name Service information to determine if your computer is connected to the Internet and
can locate a public Teredo service. If you
· use an application that needs IPv6 connectivity or
· configure your firewall to always enable IPv6 connectivity
by default standard Internet Protocol information will be sent to the Teredo service at Microsoft at
regular intervals. No other information is sent to Microsoft. You can change this default to use non-
Microsoft servers. You can also switch off this feature using a command line utility named “netsh”.
• Malicious Software Removal. During setup, if you select “Get important updates for installation”,
the software may check and remove certain malware from your device. “Malware” is malicious
software. If the software runs, it will remove the Malware listed and updated at
www.support.microsoft.com/?kbid=890830. During a Malware check, a report will be sent to
Microsoft with specific information about Malware detected, errors, and other information about
your device. This information is used to improve the software and other Microsoft products and
services. No information included in these reports will be used to identify or contact you. You may
disable the software’s reporting functionality by following the instructions found at
MCT USE ONLY. STUDENT USE PROHIBITED
www.support.microsoft.com/?kbid=890830. For more information, read the Windows Malicious
Software Removal Tool privacy statement at go.microsoft.com/fwlink/?LinkId=113995.
• Microsoft Digital Rights Management. If you use the software to access content that has been
protected with Microsoft Digital Rights Management (DRM), then, in order to let you play the
content, the software may automatically request media usage rights from a rights server on the
Internet and download and install available DRM updates. For more information, see
go.microsoft.com/fwlink/?LinkId=178857.
• Microsoft Telemetry Reporting Participation. If you choose to participate in Microsoft Telemetry
Reporting through a “basic” or “advanced” membership, information regarding filtered URLs,
malware and other attacks on your network is sent to Microsoft. This information helps Microsoft
improve the ability of Forefront Threat Management Gateway to identify attack patterns and
mitigate threats. In some cases, personal information may be inadvertently sent, but Microsoft will
not use the information to identify or contact you. You can switch off Telemetry Reporting. For
more information on this feature, see http://go.microsoft.com/fwlink/?LinkId=130980.
• Microsoft Update Feature. To help keep the software up-to-date, from time to time, the software
connects to Microsoft or service provider computer systems over the Internet. In some cases, you
will not receive a separate notice when they connect. When the software does so, we check your
version of the software and recommend or download updates to your devices. You may not receive
notice when we download the update. You may switch off this feature.
• Network Awareness. This feature determines whether a system is connected to a network by either
passive monitoring of network traffic or active DNS or HTTP queries. The query only transfers
standard TCP/IP or DNS information for routing purposes. You can switch off the active query
feature through a registry setting.
• Plug and Play and Plug and Play Extensions. You may connect new hardware to your device, either
directly or over a network. Your device may not have the drivers needed to communicate with that
hardware. If so, the update feature of the software can obtain the correct driver from Microsoft and
install it on your device. An administrator can disable this update feature.
• Real Simple Syndication (“RSS”) Feed. This software start page contains updated content that is
supplied by means of an RSS feed online from Microsoft.
• Search Suggestions Service. When you type a search query in Internet Explorer by using the Instant
Search box or by typing a question mark (?) before your search term in the Address bar, you will see
search suggestions as you type (if supported by your search provider). Everything you type in the
Instant Search box or in the Address bar when preceded by a question mark (?) is sent to your
search provider as you type it. In addition, when you press Enter or click the Search button, all the
text that is in the search box or Address bar is sent to the search provider. If you use a Microsoft
search provider, the information you send is subject to the Microsoft Online Privacy Statement,
which is available at go.microsoft.com/fwlink/?linkid=31493. If you use a third-party search
provider, use of the information sent will be subject to the third party’s privacy practices. You can
turn search suggestions off at any time in Internet Explorer by using Manage Add-ons under the
Tools button. For more information about the search suggestions service, see
go.microsoft.com/fwlink/?linkid=128106.
• SQL Server Reporting Services Map Report Item. The software may include features that retrieve
content such as maps, images and other data through the Bing Maps (or successor branded)
MCT USE ONLY. STUDENT USE PROHIBITED
application programming interface (the “Bing Maps APIs”). The purpose of these features is to
create reports displaying data on top of maps, aerial and hybrid imagery. If these features are
included, you may use them to create and view dynamic or static documents. This may be done only
in conjunction with and through methods and means of access integrated in the software. You may
not otherwise copy, store, archive, or create a database of the content available through the Bing
Maps APIs. you may not use the following for any purpose even if they are available through the
Bing Maps APIs:
• Bing Maps APIs to provide sensor based guidance/routing, or
• Any Road Traffic Data or Bird’s Eye Imagery (or associated metadata).
Your use of the Bing Maps APIs and associated content is also subject to the additional terms and
conditions at http://www.microsoft.com/maps/product/terms.html.
• URL Filtering. The URL Filtering feature identifies certain types of web sites based upon predefined
URL categories, and allows you to deny access to such web sites, such as known malicious sites and
sites displaying inappropriate or pornographic materials. To apply URL filtering, Microsoft queries
the online Microsoft Reputation Service for URL categorization. You can switch off URL filtering. For
more information on this feature, see http://go.microsoft.com/fwlink/?LinkId=130980
• Web Content Features. Features in the software can retrieve related content from Microsoft and
provide it to you. To provide the content, these features send to Microsoft the type of operating
system, name and version of the software you are using, type of browser and language code of the
device where you run the software. Examples of these features are clip art, templates, online
training, online assistance and Appshelp. You may choose not to use these web content features.
• Windows Media Digital Rights Management. Content owners use Windows Media digital rights
management technology (WMDRM) to protect their intellectual property, including copyrights. This
software and third party software use WMDRM to play and copy WMDRM-protected content. If the
software fails to protect the content, content owners may ask Microsoft to revoke the software’s
ability to use WMDRM to play or copy protected content. Revocation does not affect other content.
When you download licenses for protected content, you agree that Microsoft may include a
revocation list with the licenses. Content owners may require you to upgrade WMDRM to access
their content. Microsoft software that includes WMDRM will ask for your consent prior to the
upgrade. If you decline an upgrade, you will not be able to access content that requires the upgrade.
You may switch off WMDRM features that access the Internet. When these features are off, you can
still play content for which you have a valid license.
• Windows Media Player. When you use Windows Media Player, it checks with Microsoft for
· compatible online music services in your region;
· new versions of the player; and
· codecs if your device does not have the correct ones for playing content.
You can switch off this last feature. For more information, go to
www.microsoft.com/windows/windowsmedia/player/11/privacy.aspx.
• Windows Rights Management Services. The software contains a feature that allows you to create
content that cannot be printed, copied or sent to others without your permission. For more
information, go to www.microsoft.com/rms. you may choose not to use this feature
MCT USE ONLY. STUDENT USE PROHIBITED
• Windows Time Service. This service synchronizes with time.windows.com once a week to provide
your computer with the correct time. You can turn this feature off or choose your preferred time
source within the Date and Time Control Panel applet. The connection uses standard NTP protocol.
• Windows Update Feature. You may connect new hardware to the device where you run the
software. Your device may not have the drivers needed to communicate with that hardware. If so,
the update feature of the software can obtain the correct driver from Microsoft and run it on your
device. You can switch off this update feature.
c. Use of Information. Microsoft may use the device information, error reports, and malware reports to
improve our software and services. We may also share it with others, such as hardware and software
vendors. They may use the information to improve how their products run with Microsoft software.
d. Misuse of Internet-based Services. You may not use any Internet-based service in any way that could
harm it or impair anyone else’s use of it. You may not use the service to try to gain unauthorized access
to any service, data, account or network by any means.
5. SCOPE OF LICENSE. The Licensed Content is licensed, not sold. This agreement only gives you some rights
to use the Licensed Content. Microsoft reserves all other rights. Unless applicable law gives you more
rights despite this limitation, you may use the Licensed Content only as expressly permitted in this
agreement. In doing so, you must comply with any technical limitations in the Licensed Content that only
allows you to use it in certain ways. Except as expressly permitted in this agreement, you may not:
• install more copies of the Licensed Content on devices than the number of licenses you acquired;
• allow more individuals to access the Licensed Content than the number of licenses you acquired;
• publicly display, or make the Licensed Content available for others to access or use;
• install, sell, publish, transmit, encumber, pledge, lend, copy, adapt, link to, post, rent, lease or lend,
make available or distribute the Licensed Content to any third party, except as expressly permitted
by this Agreement.
• reverse engineer, decompile, remove or otherwise thwart any protections or disassemble the
Licensed Content except and only to the extent that applicable law expressly permits, despite this
limitation;
• access or use any Licensed Content for which you are not providing a training session to End Users
using the Licensed Content;
• access or use any Licensed Content that you have not been authorized by Microsoft to access and
use; or
• transfer the Licensed Content, in whole or in part, or assign this agreement to any third party.
6. RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not expressly granted to you in
this agreement. The Licensed Content is protected by copyright and other intellectual property laws and
treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in the
Licensed Content. You may not remove or obscure any copyright, trademark or patent notices that
appear on the Licensed Content or any components thereof, as delivered to you.
7. EXPORT RESTRICTIONS. The Licensed Content is subject to United States export laws and regulations. You
must comply with all domestic and international export laws and regulations that apply to the Licensed
Content. These laws include restrictions on destinations, End Users and end use. For additional
information, see www.microsoft.com/exporting.
MCT USE ONLY. STUDENT USE PROHIBITED
8. LIMITATIONS ON SALE, RENTAL, ETC. AND CERTAIN ASSIGNMENTS. You may not sell, rent, lease, lend or
sublicense the Licensed Content or any portion thereof, or transfer or assign this agreement.
9. SUPPORT SERVICES. Because the Licensed Content is “as is”, we may not provide support services for it.
10. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this agreement if you fail
to comply with the terms and conditions of this agreement. Upon any termination of this agreement, you
agree to immediately stop all use of and to irretrievable delete and destroy all copies of the Licensed
Content in your possession or under your control.
11. LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the Licensed Content.
The third party sites are not under the control of Microsoft, and Microsoft is not responsible for the
contents of any third party sites, any links contained in third party sites, or any changes or updates to third
party sites. Microsoft is not responsible for webcasting or any other form of transmission received from
any third party sites. Microsoft is providing these links to third party sites to you only as a convenience,
and the inclusion of any link does not imply an endorsement by Microsoft of the third party site.
12. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates and support services are
the entire agreement for the Licensed Content.
b. Outside the United States. If you acquired the Licensed Content in any other country, the laws of that
country apply.
14. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of
your country. You may also have rights with respect to the party from whom you acquired the Licensed
Content. This agreement does not change your rights under the laws of your country if the laws of your
country do not permit it to do so.
15. DISCLAIMER OF WARRANTY. THE LICENSED CONTENT IS LICENSED "AS-IS," "WITH ALL FAULTS," AND "AS
AVAILABLE." YOU BEAR THE RISK OF USING IT. MICROSOFT CORPORATION AND ITS RESPECTIVE
AFFILIATES GIVE NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS UNDER OR IN RELATION TO
THE LICENSED CONTENT. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS
WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS,
MICROSOFT CORPORATION AND ITS RESPECTIVE AFFILIATES EXCLUDE ANY IMPLIED WARRANTIES OR
CONDITIONS, INCLUDING THOSE OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NON-INFRINGEMENT.
16. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. TO THE EXTENT NOT PROHIBITED BY
LAW, YOU CAN RECOVER FROM MICROSOFT CORPORATION AND ITS SUPPLIERS ONLY DIRECT
DAMAGES UP TO USD$5.00. YOU AGREE NOT TO SEEK TO RECOVER ANY OTHER DAMAGES, INCLUDING
CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES FROM MICROSOFT
CORPORATION AND ITS RESPECTIVE SUPPLIERS.
MCT USE ONLY. STUDENT USE PROHIBITED
This limitation applies to
o anything related to the Licensed Content, services made available through the Licensed Content, or
content (including code) on third party Internet sites or third-party programs; and
o claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence,
or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The
above limitation or exclusion may not apply to you because your country may not allow the exclusion or
limitation of incidental, consequential or other damages.
Please note: As this Licensed Content is distributed in Quebec, Canada, some of the clauses in this agreement
are provided below in French.
Remarque : Ce le contenu sous licence étant distribué au Québec, Canada, certaines des clauses dans ce
contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le contenu sous licence visé par une licence est offert « tel quel ». Toute
utilisation de ce contenu sous licence est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie
expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection dues
consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties
implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage.
Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects,
accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera
pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus
par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays
si celles-ci ne le permettent pas.
Acknowledgments
Microsoft Learning would like to acknowledge and thank the following for their contribution towards
developing this title. Their effort at various stages in the development has ensured that you have a good
classroom experience.
Contents
Module 1: Introduction to Business Intelligence and Data Modeling
Lesson 1: Introduction to Business Intelligence 1-3
Lesson 2: The Microsoft Business Intelligence Platform 1-11
Lab 1: Reporting and Analyzing Data 1-23
Module 5
Creating Multidimensional Databases
Contents:
Lesson 1: Introduction to Multidimensional Analysis 5-4
Module Overrview
The fundamental purpose of using Microsoft® ® SQL Server®® Analysis Servvices (SSAS) on
nline analyticaal
proccessing (OLAP P) solutions is to build cubes that you can u
use to perform
m complex que eries and returrn the
resu
ults in a reason
nable time. Typ pically, you use
e SQL Server D
Data Tools to d
develop cubes.
Mulltidimensional databases, whhich are also known as OLAP P cubes, conneect to relationaal databases by
usin
ng connection information inn data sourcess and data sou rce views. Wit h the addition
n of dimensionns and
meaasures, they make it possible
e to navigate aggregated
a da ta by using these dimension ns.
Org
ganization of data
d in this wayy has many be
enefits includin
ng:
• Measures are
e preaggregate
ed, enabling exxtremely fast q
queries when ccompared to rrelational databases.
• Multidimensional structures are logical an ward to navigaate for informaation workers who
nd straightforw
use tools such
h as Microsoft Excel®.
• It is possible to
t create persppectives of the make the pertinent
e cube to focuss on key areass of data and m
facts even mo ore accessible.
• Create a cube.
Lesson 1
Introduction to
t Multtidimen
nsional A
Analysiss
Afte
er completing this lesson, yo
ou will be able to:
• Define a data
a source.
• Define a data
a source view.
• Describe a dimension.
• Define measu
ures and measure groups.
• Create an OLA
AP cube.
• Describe the advantages off using SSAS ass an OLAP plattform.
The
T Business Problem
m
Most
M database systems are de esigned for on
nline transactio
on processing (OLTP). Many small updatess and
in
nserts are happ
pening in real time
t he most granular level possib
and data is stored at th ble. This level o
of detail
is required and is useful for many
m ns, but there a re also many iinstances when
operation n these systemms are
noot optimal.
Fo
or example, Ad dventure Work ks sells bicycles and associat ed accessoriess. It is vital thatt every item frrom
evvery sale is reccorded and the
ese updates to o the database must happen nearly instanttaneously. The e
problem occurss when the trad ding manager requires a bro oad overview o of sales for thee past month b by
product category. The query to t generate th his data involvees filtering all sales to find o
only those thatt occur
in
n the past mon nth and then grouping
g m by product caategory beforee calculating the total sales by
them
product group. Not only is this query very slow s in itself, b
but it causes lo
ocking and con ntention on the
daatabase, which h slows down its
i primary role e as a transacttional system.
OLTP
O systems have
h mitations for use as a source of data for reporting and analysis:
several lim
• Aggregated
d spanning queries are slow to generate.
• Normalized
d relational datta models are not intuitive ffor business ussers.
MCT USE ONLY. STUDENT USE PROHIBITED
5-6 Creating Multidimensional Dataabases
Mulltidimensional analysis takess a data warehouse and storees the data in a multidimenssional cube. Th
he
cube consists of measures,
m whicch are the values that are ag gregated, and which are the axes
d dimensions, w
of the cube and give
g the measu ures their conteext.
For example, a sales cube mightt have Sales Value
V ures and Time, Product, and
and Unitts Sold measu d
Cusstomer dimensions.
You
u can also filterr by using dimension values that use slicin g and dicing:
Data
D Sources
• The provide
er name.
• The information that is neeeded to conn nect to the datta source by using the speciffied provider. The
property se
ettings for partticular data source objects vaary according to the provideer.
• Other prop
perties that the
e provider supp
ports or requirres.
MCT USE ONLY. STUDENT USE PROHIBITED
5-8 Creating Multidimensional Dataabases
Da
ata Source Views
A da
ata source vieww is used to de
efine the speciific tables thatt are retrieved from the dataa source. It can
n also
change the presen ntation of thosse tables and their
t columns to make it mo ore user friendly to users of
Ana
alysis Services, for example by
b changing co olumn names.
A da
ata source view
w contains the
e following item
ms:
• A definition of
o any subset of
o the schema retrieved fromm one or moree data sources, up to and
including the whole schema, including th
he following:
• Table nam
mes
• Column names
n
• Data type
es
• Nullabilitty
• Column lengths
l
• Primary keys
k
• Primary key–foreign
k ke
ey relationship
ps
• Named queries
q that retturn columns from
f one or m
more data sourrces (that show
w as tables in tthe
schema).
• Named calculations
c tha
at return colum umns in tables or
mns from a daata source (thaat show as colu
views).
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5-9
• Logical primary keys (needed if a primary key is not defined in the underlying table or is not
included in the view or named query).
• Logical primary key–foreign key relationships between tables, views, and named queries.
You can create multiple diagrams that show different subsets of the data source view. Unlike different
data source views, different diagrams reference the same schema. Therefore, any changes that you make
in one diagram apply to all other diagrams in the data source view. Diagrams are useful when you create
multiple cubes within the same solution.
MCT USE ONLY. STUDENT USE PROHIBITED
5-10 Creating Multidimensional Daatabases
Dim
mensions
Dim
mensions providde the contextt for the facts that are stored
d in the OLAP cube. If you vvisualize an OLA
AP
mensions are the axes of the cube. The dim
cube as a physical cube, the dim mension has a key attribute tthat
enables SSAS to jo
oin records to related data inn the fact tabl e.
Dim
mensions are hierarchical, nott flat. Thereforre, a time dimeension typicallly has years, m
months, and daays
and a geography dimension typ d town. A dim
pically has country, state, and mension can haave more than one
hierrarchy, enablin
ng you to drill down from ye ear to month to o day, but usin
ng another hie erarchy to drill
dowwn from year to week to dayy.
Dim
mensions can also be unbalan nced and ragg ged. An unbalaanced dimension does not h have the same
nummber of levels in every brancch. For example e, the Sales Di rector reports to the Chief EExecutive Officcer
(CEOO) and has thrree levels of sta aff below her. The Executivee Assistant also
o reports to thee CEO, but hass no
leve
els below him. A ragged dim mension is a particular type oof unbalanced dimension wh here there are
misssing or duplica t hierarchy. For example, i n a hierarchy tthat contains C
ated levels in the Continent, Cou untry,
he city-state off Monaco would either have the values of Europe, Monaaco, Monaco,
Statte, and City, th
Mon naco, or the va alues of Europpe, Monaco, NU ULL, NULL.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-11
Measures
M and
a Measu
ure Groupss
Th
here is a particcular dimensioon called the Measures
M dimeension. Measuures are the faccts that are
ag
ggregated at each
e intersection of dimension members. TThey are typiccally numeric aand additive, and are
ggregated by using a sum ca
ag alculation, alth hat do not meet these criteria.
hough there arre measures th
Measures
M ause there are often multiplee measures in a cube. For exxample,
are allso part of a diimension beca
yo
ou could select the state of California
C from
m the Geograp phy dimension 10 from the Time
n, the year 201
diimension, and the Sales Uniits measure froom the Measu ures dimensio n. You could tthen modify th his by
ch
hanging to thee Sales Amount measure fro om the Measu ures dimensio n.
Yo
ou can use a measure
m e the value of a measure. Th
expression to define u to apply calculations
his enables you
to
o measure valu
ues, or use multiple columnss from a fact taable in a measure expression
n.
Yoou can also use attribute collumns from dimension tablees to define a m measure. These e attributes wo
ould not
tyypically contain
n facts and wo
ould not typica
ally be additivee, but could prrovide useful information. Foor
exxample, you co ould use them
m to provide a count
c of memmbers.
Measures
M are grouped into measure
m groups based on theeir underlying fact tables. Measure groupss are
t relationship between the
ussed to define the e dimensions aand the measu ures. When a d dimension or a
measure
m group is added to th
he cube, SSAS will examine tthe relationshipp that exists between the facct table
an he data source and automatiically set the M
nd the dimenssion table in th Measure Grou up information
n in the
Dimension
D Usaage tab of the Cube Designeer. You can theen modify thiss to your requirements.
MCT USE ONLY. STUDENT USE PROHIBITED
5-12 Creating Multidimensional Daatabases
Cubes
A cu
ube is the unit that defines the
t dimensionss and measurees and is the usser’s point of aaccess to the
mulltidimensional data.
Cubbes bring togetther all of the functionality ofo dimensions and measuress and enable yyou to display tthis in
a usser-friendly intterface such ass an Excel Pivo h SSAS enables you
otTable table. TThe PivotTablee interface with
to display
d aggregated measure data and slice e and dice this data by usingg dimension m members.
By providing
p a muultidimensiona al structure and the ability to
o use a user-frriendly interfacce such as Exce
el,
cubes are highly intuitive for bu
usiness users to
o navigate.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-13
SS
SAS provides a service in which you can ho
ost multidimen nsional databaases. These dattabases contaiin the
da
ata sources, da
ata source view
ws, dimensionss, measures, an
nd cubes that business userss need to perfoorm
multidimension
m nal analysis.
SS
SAS is a scalab
ble enterprise OLAP
O solution.. It optimizes p
performance b
by using innovvative techniqu
ues such
ass block compuutation and is highly
h scalable
e due to tools such as the Ag
ggregation De esign Wizard.
SS
SAS provides you
y with a wide range of too ols for your OLLAP data includ
ding key perfo
ormance indicaators
KPIs), multilingual translation
(K n capabilities, and
a data minin ng analysis on
n your data. Th
his functionalityy will be
co
overed in more e detail in subsequent modu ules.
Microsoft
M provid
des intuitive frront-end toolss through Micrrosoft Office and Microsoft SSharePoint®,
en
nabling busineess users to qu
uickly access th
he data that th
hey need with little or no knoowledge of the
e
un
nderlying syste
em.
MCT USE ONLY. STUDENT USE PROHIBITED
5-14 Creating Multidimensional Daatabases
Sofftware Req
quirementts for Multtidimensio
onal Analysis
• SQL Server 20
012 Standard, Business Intellligence, Enterp
prise, Develop er, or Evaluatio
on Edition.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-15
Lesson
n2
Creatting Datta Sourcces and Data Source V
Views
OLAP
O and data mining projeccts in SSAS are designed bas ed on a logicaal data model of related tablles,
views, and querries from one or
o more data sources.
s This lo
ogical data moodel is called a data source vview.
Data source views enable youu to define a suubset of the daata that popullates a large data warehouse e.
Th
his lesson desccribes how to create
c and mo
odify a data so urce.
• Describe ho
ow to modify a data source view.
v
MCT USE ONLY. STUDENT USE PROHIBITED
5-16 Creating Multidimensional Daatabases
Cre
eating a Data
D Source
e
You
u can use the Data
D Source Wizard
W in SQL Server Data Toools to define o
one or more daata sources for an
SSA a sources use a Connection object that deefines the connection string. In the first ste
AS project. Data ep of
the Data Source Wizard,
W you must define the Connection o object or use aan existing Connection obje ect.
The default provid
der for a new connection
c is the
t Native OL E DB\SQL Servver Native Clie
ent provider. O
Other
supported providers include:
If yo
ou have an existing data sou urce that is deffined in an SSA want to create a
AS database orr project and w
neww data source object
o that con
nnects to the same
s underlyin
ng data sourcee, you can sim
mply copy propperties
of the first data so
ource object in
nto a new data a source objectt.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-17
Creating
C a Data Sourrce View
SS
SAS design toools use data so
ource views to maintain a cacche of relation
nal metadata aand to take advantage
off some of the annotations
a within
w a data so
ource view. Ad
dvantages of th his approach in
nclude:
Mo
odifying a Data Sourrce View
Afte
er you have cre
eated a data so
ource view, yoou can modify it to make thee data more usser-friendly. OOften,
und
derlying data sources use namming conventiions to help deevelopers understand the scchema. Also th he
und
derlying data does
d not typica
ally store addittional formattiing informatio Data Source View
on. Using the D
Designer, you can
n make several modificationss to a data sou urce view withoout modifyingg the underlyin
ng
source data or database schema as. This enable
es you to preseent user-frienddly names and formatting without
makking any changges to the source database systems.
s For exxample, you caan:
• Create a nammed query and named calcula ations that enaable you to exxtend the relational schema of
existing table
es in a data sou
urce view without modifying g the underlyinng data sourcee.
• ams to reduce the visual cluttter when you only want to vview a subset o
Create diagra of the tables in
n the
data source view.
v
To make
m changes to a data source view:
2. Click Propertties.
Demonstra
D ation: Creating a Datta Source aand a Dataa Source V
View
2.. On the Welcome to the Data Source Wizard page,, click Next.
2. On the Welcome to the Data Source View Wizard page, click Next.
6. In the Name field, type AdventureWorks Demo DSV, and then click Finish.
2. In Data Source Designer, navigate through the database diagram until you locate the
FactInternetSales table.
3. Click the table name of the FactInternetSales table and press F4.
4. In the Properties pane, change the FriendlyName property to Internet Sales.
5. Right-click the DimCustomer table, and then click New Named Calculation.
7. In the Expression field, type FirstName + ' ' + LastName, and then click OK.
8. On the File menu, click Save All. Then minimize SQL Server Data Tools. You will return to it in a later
demonstration.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-21
Lesson
n3
Creatting a Cube
A cube is a multidimensional structure that contains dimeensions and m measures. Dime ensions define the
sttructure of the cube, and me easures provide the numeric al values of intterest to the e end user. As a llogical
sttructure, a cub
be enables a cliient applicatio
on to retrieve vvalues as if cellls in the cube d
defined every
po ossible summa arized value.
Th
his lesson desccribes how to create
c and mo
odify cubes in aaddition to some considerattions for cube design.
After completin
ng this lesson, you
y will be able to:
• Create a multidimensiona
al cube.
• Describe th
he consideratio
ons for time dimensions.
• ube by using the Cube Desig
Modify a cu gner.
• Browse a multidimension
m nal cube.
MCT USE ONLY. STUDENT USE PROHIBITED
5-22 Creating Multidimensional Daatabases
Op
ptions for Creating
C a Cube
Considerat
C ions for Tiime Dimen
nsions
Most
M cubes include a time dimmension, althoough some sol utions do not use time and instead use an
nother
fa
actor to delineate the data, such
s o work or a p roject.
as a unit of
Often,
O time requires multiple hierarchies. Fo
or example, yoou could have a hierarchy thhat has Years, WWeeks,
nd Days and a hierarchy that has Years, Months, and Daays, but not a h
an hierarchy that has Years, Moonths,
Weeks,
W and Dayys because We eeks do not fit into Months. TTherefore, youu need two hieerarchies to represent
th
his. You can cre
eate multiple time
t dimensio
ons or one timee dimension th ple hierarchies. In the
hat has multip
previous examp ple, you would typically creatte one time diimension that has multiple h hierarchies, but if you
re
equire a time dimension
d for a different purrpose, such as Fiscal Time, yyou would typ
pically create itt as a
eparate dimension.
se
Yo
ou can either use
u a Server TimeT dimensio on, or use a dim
mension table that contains time data. A SServer
Tiime dimensionn avoids joins and can be fasster to processs. However, m any time dime ensions include
e
dditional data,, for example, corporate time information such as quarteers, which do not follow cale
ad endar
qu
uarters, or pub
blic holidays. A time dimensiion table enabbles you to add
d detail to the time memberrs. This
en
nables you to store the additional properties for each daate.
Se
erver time dim
mensions contaain hierarchies,, levels, and atttributes, but t hese are stored on the serve
er rather
th
han in a separa
ate dimension table.
MCT USE ONLY. STUDENT USE PROHIBITED
5-24 Creating Multidimensional Daatabases
The Cube De
esigner
Alth
hough the Cub be Wizard crea ates the cube, many of the p
properties of thhe cube will be
e set by using the
Cubbe Designer. Thhe Cube Desig gner in SQL Serrver Data Toolls enables you to view and eedit the properrties
of the cube and itts objects, and to browse cube data:
• You can modify cube structture, dimensio
on usage, and ccalculations.
Browsing
B a Cube
SS
SAS enables yoou to browse the
t cube from within SQL Seerver Data Too ols. This enable
es you to test tthe cube
without
w having to switch back
kward and forwward between QL Server Data Tools.
n a client appli cation and SQ
Fu
urthermore, yoou can change
e the security context
c and brrowse the cubee as another uuser. Before bro owsing
cu
ube data in the
e Cube Browsser tab, the cube must be deeployed.
Additionally, yo
ou can click the
e Analyze in Exxcel icon on th he Browser tab to create an Excel
he toobar in th
workbook
w with a connection to the cube. This enables yo ou to see how the cube behaaves when used as a
so
ource for an Exxcel PivotTable
e.
MCT USE ONLY. STUDENT USE PROHIBITED
5-26 Creating Multidimensional Daatabases
De
emonstration: Creating and Browsing a C
Cube
X Task 1: Crea
ate a cube
1. Ensure that you have comp
pleted the prevvious demonsttration in this m
module.
7. On the Selectt Measures pa age, clear the Internet Sale s checkbox to clear all selections, and then
select the Tottal Product Cost and Sales Amount meaasures. Then click Next.
8. nsions page, cllear the parentt Internet Sal es checkbox, aand click Nextt.
On the Selectt New Dimen
X Task 2: Dep
ploy and bro
owse a cube
1. In Solution Exxplorer, right-cclick Demo an
nd click Deployy. If prompted
d, enter the password Pa$$ww0rd
for the ADVE ENTUREWORK KS\Student usser. Then wait for the deployyment processs to finish.
2. t Browser tab.
In the cube designer, click the
3. In the Metada
ata pane, expa
and Measuress and expand IInternet Saless. The wizard h
has created the
e
measures youu selected.
4. Drag the Salees Amount me easure to the Drag levels o r measures here to add to
o the query area.
The total sale a Internet sales is shown.
es amount for all
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5-27
5. In the Metadata pane, note that the wizard has created dimensions for the DimCustomer and
DimProduct tables. It has also determined that there are three relationships defined between the
Internet Sales table and the DimDate table, and so has a dimension for each related column (Due
Date, Order Date, and Ship Date).
6. Expand each of the dimensions and note the wizard has only created attributes for key columns. You
will need to modify the dimensions to add meaningful attributes for analysis.
7. Drag the Product Key attribute from the Dim Product dimension and drop it to the left of the Sales
Amount value in the grid. The browser now shows the aggregated sales amount totals for each
product key.
2. Right-click the Total Product Cost measure and click Rename. Then change the name of the
measure to Cost.
3. In the Dimensions pane, right-click Dim Customer and click Rename, and change the name of the
dimension to Customer. Then rename Dim Product to Product.
4. Right-click the Product dimension and click Edit Dimension. This opens the dimension designer for
the Dim Product dimension (the dimension is named Product in the Demo Cube cube, but still
named Dim Product in the database).
5. In the Data Source View pane, in the DimProduct table, drag the EnglishProductName field to the
Attributes pane.
6. In the Attributes pane, right-click English Product Name and click Rename. Then rename the
attribute to Product Name.
7. In Solution Explorer, right-click Demo and click Deploy. If prompted, enter the password Pa$$w0rd
for the ADVENTUREWORKS\Student user. Then wait for the deployment process to finish.
8. Click the Demo Cube.cube [Design] tab to return to the cube designer, and then in the cube
designer, click the Browser tab.
9. On the Browser tab, click the Reconnect button in the upper left. If the grid contains any data from
previous queries, right-click in the grid and click Clear Grid.
10. In the Metadata pane, expand Measures and Internet Sales, and drag Cost to the Drag levels or
measures here to add to the query area.
11. Expand the Product dimension, and then drag Product Name to the left of the Cost value. The total
cost associated with sales for each product is shown.
12. On the File menu, click Save All, and then minimize SQL Server Data Tools. You will use it again in a
later demonstration.
MCT USE ONLY. STUDENT USE PROHIBITED
5-28 Creating Multidimensional Daatabases
Lesson 4
Overviiew of Cube
C Se
ecurity
Afte
er you install an instance of SSAS,
S only the members of tthe server rolee have server-w
wide permissio ons to
perfform any task within the insttance of SSAS. By default, no have any accesss permissions to
o other users h
the objects in the instance. Memmbers of the SSAS server rolee can grant otther users acce
ess to server an
nd
dataabase objects by using Micro osoft SQL Servver Managemeent Studio, SQL Server Data Tools, or an XML
for Analysis
A (XMLA A) script.
• Describe data
abase roles.
SS
SAS relies on Windows®
W autthentication to
o authenticatee users. After a user has been
n authenticated
d, SSAS
co
ontrols permissions within th
he databases based
b on the uuser’s role memmbership:
• Principals are
a entities that can request SQL Server ressources.
• Securables are the resourrces to which the
t SQL Serverr Database Eng
gine authorizaation system re
egulates
access.
Ad
dding Mem
mbers to th
he Server Role
R
The server role is a fixed role at the server level. You cannott change its peermissions and
d you cannot aadd
further server role
es.
The server role givves the administrator accesss to SSAS. Memmbers of this ro
ole have accesss to all SSAS
data
abases and objbjects on that instance of SSA wer-level admiinistrative rights, you should
AS. To give low d
consider adding users
u to a database role and granting the rrelevant perm issions to that.
Creating
C Da
atabase Ro
oles
To
o assign permissions to users, or to administrators who d
do not have seerver-wide adm
ministrative rig
ghts,
yo
ou should crea
ate database rooles.
In
nitially, you sho
ould decide wh hat levels of acccess are requ ired within your organizatio
on including baasic
ussers through power
p users, managers,
m and department ad dministrators. Remove groups with dupliccated
peermissions and d, where possible, consolidatte groups with h similar permiissions as long
g as this does n
not give
an
ny sensitive pe ermission to annother group. After you havee defined the groups, you sh hould then creeate the
groups and add d users to these groups.
To
o create a data
abase role:
Gra
anting Datta Source and Cube Permissio
ons
To access
a data witthin the datab
base, users musst be memberss of a role thatt has permissio
ons to access tthe
cube. Permissionss to access a da
ata source are not required tto access cubee data:
• Access to
o the individua
al cells within the
t cube.
Granting
G Cell Permisssions
Note MD
DX statementss are discussed
d in more detaail in Module 8
8, “Introduction
n to MDX.”
Gra
anting Dim
mension an
nd Dimension Data Permissions
By default,
d a role that has accesss to a cube ha
as read access to all of the diimensions in the cube. You ccan
moddify this accesss and deny acccess to one or more membeers in the dimeension.
The default accesss is read-only, so users cannot process thee cube. Howevver, if you chan
nge the permisssions
of a relevant role to read/write, it will enable users to proceess the cube.
By default,
d permisssions apply to
o all dimension
n members, bu
ut you can writte an MDX statement to deffine a
subset of the dimension.
Note MDX
X statements are discussed in
n more detail iin Module 8, ““Introduction tto MDX.”
You
u can use an MDX
M statementt for an allowed member sett or a denied m member set. Yoou can also deefine a
defa
ault member to control whicch member use ers see when tthey first conn
nect to the cub
be. You can alsso
defiine this by usin
ng MDX, enabling you to cre eate versatile d
default membeers. For exampple, you could use
an MDX
M statemen nt to use the cu
urrent calenda
ar year as the ddefault member of a time diimension.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-35
Testing
T Seccurity Perm
missions
Th
he most straightforward metthod for testin ng security is to
o use SQL Servver Data Toolss. This enables you to
te
est and modifyy security in on
ne place. Using
g SQL Server D Data Tools to teest user permiissions:
De
emonstration: Applying Cube Security
S
X Task 1: Crea
ate a role
1. Ensure that you have comp
pleted the prevvious demonsttration in this m
module.
3. In Solution Exxplorer, right-cclick Roles, and click New RRole. Then in SSolution Explorrer, right-click the
Role.role icon that has bee en added, clickk Rename, and d change the n name to Restrricted User.ro ole.
When promp pted to change e the object naame as well, cliick Yes.
4. In the role de
esigner, on the
e General tab, note that by d
default this rolle has no database permissio
ons.
5. On the Membership tab, note
n that this is where you caan add Windo groups to the role.
ows users and g
7. On the Cubes tab, change the Access value for Demo Cube to Read
d. This allows tthe role to acccess
the cube and read its data.
11. In the Dimension list, under Demo Cube, select Product, and on the Basic tab, in the Attribute
hierarchy list, select Product Name.
12. Select Deselect all members. Then scroll to the bottom of the list of product names and select only
the products that begin with the word Touring.
2. When deployment is complete, in Solution Explorer, double-click Demo Cube.cube to return to the
cube designer.
3. On the Browser tab, click the Reconnect button at the top left. If the grid contains any data from
previous queries, right-click in the grid and click Clear Grid.
4. In the Metadata pane, expand Measures and Internet Sales, and drag Sales Amount and Cost to
the Drag levels or measures here to add to the query area. Then expand the Product dimension
and drag Product Name to the left of the measure values. The browser shows cost and sales amount
for all products.
5. In the top left area of the browser window, click the Change User button. Then, in the Security
Context – Demo Cube dialog box, select Roles, and in the drop-down list, select Restricted User
and click OK. Click OK again to return to the browser window.
6. Note that the grid has been cleared. Then, in the Metadata pane, expand Measures and Internet
Sales, and drag Sales Amount to the Drag levels or measures here to add to the query area. Note
that members of this role cannot access the Cost measure.
7. Expand the Product dimension and drag Product Name to the left of the measure values. The
browser shows sales amount for only the Touring products.
8. On the File menu, click Save All, and then close SQL Server Data Tools.
MCT USE ONLY. STUDENT USE PROHIBITED
5-38 Creating Multidimensional Daatabases
Lab
b Scenario
o
You
u have created a reporting soolution at Adveenture Works Cycles, but some business aanalysts have
requ n that enables them to “slicee and dice” bussiness data to perform their own
uested an analytical solution
business analysis.
To accomplish
a this, you will crea
ate a multidim udes an OLAP cube.
mensional data base that inclu
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-39
Lab 5:
5 Creating a Multidim
mensionaal Datab
base
2.. Create a ne
ew SSAS projecct.
3.. Create a da
ata source for the
t AdventureWorksDW reelational datab
base.
Results: After this exercise, you should see the Adventure Works Data Warehouse.ds data source in the
Data Sources folder.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5-41
• Change the FriendlyName property of the remaining tables to remove the “Dim” prefix from the
name.
• Verify that the modified data source resembles the following image.
• Add a named calculation named Full Name to the Customer table. The expression should
concatenate the FirstName, MiddleName (if it exists), and LastName columns.
Results: After this exercise, you have created a data source view for the cube that you need to create.
MCT USE ONLY. STUDENT USE PROHIBITED
5-42 Creating Multidimensional Databases
You need to modify the attributes of the dimension used for dates in your cube to ensure uniqueness
across temporal periods. For example, the month of January is not unique because it occurs in every year,
so you must modify the month attribute so that its key is based on both month and year, and then specify
which of these key columns is to be used when displaying the attribute name.
The main tasks for this exercise are as follows:
1. Create a cube.
3. Modify dimensions.
• Add the CustomerAlternateKey, Title, FirstName, MiddleName, LastName, and Full Name
attributes from the Customer table to the dimension.
• In the properties for the Calendar Semester attribute, set the KeyColumns property so that the
key columns are CalendarYear followed by CalendarSemester.
• Set the NameColumn property so that the Source column value is Calendar Semester.
• Modify the Calendar Quarter attribute so that the keys that a quarter is uniquely identified by both
the calendar year and the calendar quarter, but displayed using only the calendar quarter value:
• In the properties of the Calendar Quarter attribute, set the KeyColumns property so that the
key columns are CalendarYear followed by CalendarQuarter.
• Set the NameColumn property so that the Source column value is Calendar Quarter.
• Modify the English Month Name attribute so that a month is uniquely identified by both the
calendar year and the month number of year, but displayed using the month name value:
• In the properties for the English Month Name attribute, change the Name property to Month.
• Set the KeyColumns property so that the key columns are Calendar Year followed by
MonthNumberOfYear.
• Set the NameColumn property so that the Source column value is EnglishMonthName.
• Open Microsoft Excel 2010, and then on the Data tab, make a connection to get external data from
Analysis Services.
• Your connection should connect to the localhost server by using Windows authentication.
• You should import the data as a PivotTable Report in cell A1 of the existing worksheet.
• When the PivotTable Field List pane is displayed, under Internet Sales, select Sales Amount; and
under Customer, select Full Name so that the PivotTable resembles the following image.
Results: After this exercise, you should have successfully deployed the cube and reviewed the
modifications made to ensure that they are reflected when users browse the cube.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-47
Modu
ule Reviiew and
d Takeaw
ways
Review
R Quesstions
1.. What are so
ome of the name matching methods availlable when creeating a data ssource view?
Module 6
Working with Cubes and Dimensions
Contents:
Lesson 1: Configuring Dimensions 6-3
Module Overrview
In Microsoft®
M SQ
QL Server® Ana alysis Services, dimensions a re a fundamenntal componen nt of cubes. Th
he
factts, or measuress, provide the values
v that intterest you, how
wever, dimens ions provide the business coontext
by which
w these measures are agggregated. Dim mensions orga nize your dataa by category aand show resu ults
grouped by these e categories such as product,, customer, or month.
Dim
mensions in Analysis Services contain attribbutes that correespond to coluumns in dimen nsion tables. T
These
attributes appear as attribute hiierarchies and can be organ ized into user--defined hierarchies, or can be
defiined as parent-child hierarch
hies based on columns in thee underlying ddimension tablle. Hierarchies are
usedd to organize measures thatt are contained d in a cube.
Thiss module provides an insightt into the creation and confiiguration of diimensions and
d dimension
hierrarchies.
Afte
er completing this module, you
y will be able to:
• Configure dim
mensions.
• Define attribu
ute hierarchiess.
• Sort and grou
up attributes.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 6-3
Lesson
n1
Configuring Dimensions
After completin
ng this lesson, you
y will be able to:
• he concepts of a dimension.
Describe th
• Describe th
he use of dimension attribute
es.
Dim
mension Concepts
C
Dim
mensions form the contexts for the facts, an
nd define the aspects of thee business by w
which the factss are
agg
gregated. For example,
e Produuct and Time dimensions
d miight provide coontext to the SSalesValue me
easure.
Dim
mensions are coollections of atttributes from tables or view
ws. You can usee dimensions in multiple cub
bes
and link to them from
f remote in nstances.
e primary key of the dimens ion table. The Key attribute is the column in
The Key attribute is typically the
the dimension tabble that links too the fact table. The Name aattribute proviides a friendly name for the
dim
mension enablinng you to disp play an alternative, more releevant, name th
han the source e table name too end
userrs.
Attrributes are typically arrangedd into hierarchhies that definee the drill-dow
wn paths throu
ugh aggregatioons.
Eachh layer of the hierarchy is called a level. Fo
or example, a TTime dimensio on might have a hierarchy w
with
Dayy, Month, and Year
Y ut other hierarcchies could bee defined with attributes such as Week, Qu
levels, bu uarter,
and Century.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 6-5
Every attribute that is defined within a dimension, by default, is part of a two level hierarchy known as an
attribute hierarchy. The top level is named ALL, the second level is the leaf level that contains values for
each individual member of the attribute. While they can help in browsing the data, typically the data
within an attribute hierarchy can be too large and difficult to navigate. As a result, attribute hierarchies are
often replaced with user defined hierarchies which enable you to define more levels and make the data
more manageable. For example, a Date attribute hierarchy has an ALL level and a second level containing
all the dates within the dimension. To make this more manageable, you replace the attribute hierarchy for
Date with a user defined hierarchy named Calendar Year that contains Year, Quarter and Month levels to
make the data easier to navigate within the hierarchy.
Analysis Services can add dimension intelligence to some dimensions. For example, time dimensions have
a fixed structure and this can be used by Analysis Services. It knows which months are in each quarter,
which days are in each month, and so on.
MCT USE ONLY. STUDENT USE PROHIBITED
6-6 Working wiith Cubes and Dimennsions
Configuring
C g Dimension Storage
Th
he two dimenssion storage modes
m in Analyysis Services ar e Multidimenssional OLAP (M
MOLAP) and
Re
elational OLAP P (ROLAP). The
ese storage mo odes define wh here, and in w
what structure ttype, the dime
ension
da
ata is stored.
Co
onfiguring Dimension Attributtes
The Cube Wizard and Dimensio on Wizard crea ate attributes ffor a dimension. Other wizarrds and elements of
the Analysis Servicces user interfaace may furtheer modify thesse attributes. TThese default ssettings are
suffficient in most situations, butt you can use Dimension Deesigner to edit the attributes if necessary.
Havving many attributes for a dimension can be b confusing fo for users. You ccan organize aattributes into
play folders to simplify browsing. Using follders only affe cts the way cliient applicatio
disp ons display the
dim
mension and ha as no other efffects on the hie
erarchies or atttributes. Afterr you have creaated display fo
olders,
you should deploy the solution and reconnecct to see the reesults on the B Browser tab.
Attrributes can be used to create
e hierarchies. For
F example, a Product dimeension might h have Product
Cateegory, Productt Sub-Categorry, and Producct Name attribu
utes. Hierarchiies are covered
d in more detaail in
the next lesson.
Attrributes can also o be used to add
a additional detail to dimeension membeers and do nott need to be th he
basiis for a hierarcchy method. Thherefore, in the previous exaample, you mig ght have Product Descriptioon and
Prodduct Image atttributes. These e attributes are
e not used for a hierarchy annd are not use
ed to sort or grroup
mem mbers, but are e often needed d to provide addditional detaiil to dimension
n members witthout having tto
drill-down to relational data.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 6-9
Attribute
A Column
C Bin
ndings
To
o control the output
o from atttributes, you can
c define thee column that cconnects to th
he fact table, th
he
co
olumn that useers see, and an
n optional valuue column thatt you can use for MDX calcuulations.
• The KeyColumn is the co olumn, or columns, that are used to conneect to the fact table. This is typically
the primaryy key of the dimension table
e, and is used w
when you chooose to order thhe hierarchy b by key.
• The NameC Column provides the value that a user willl see. This can provide moree useful inform
mation
han the key column. You can
to a user th n define a nam
me column as a calculated co olumn that you u have
created in a data source view.
v For exam
mple, an Emplooyee dimensio on might have an EmployeeID key
column, bu ut you might want
w the name of the employyee to be disp played. To do this, you can crreate a
calculated column
c based on first name and last namee in the data ssource view, annd then use thhis as the
name colum mn.
Dim
mension Types
T
Initiially all dimenssions have a tyype of Regularr, but you can also define th
he type of a dimension as Time,
Orgganization, Ge eography, BilllOfMaterials, Accounts, Cu ustomers, Products, Scenarrio, Quantitative,
Utillity, Rates, Channel, or Prom motion.
In most
m cases the type of the dimension has no n effect in Annalysis Servicess and it is mere
ely a value thaat is
passsed to client applications. Th
hey could use this
t example tto alter formattting, for exam mple. However, there
are three types thhat have a funcctional effect in
n Analysis Servvices, the Time
e dimension tyype, the Curre ency
dim
mension type, and
a the Accou unts dimension n type.
Tim
me Dimensio
ons
If yo
our time data is stored as a regular
r dimenssion (not as a sserver time dim
mension), and it has a Timee
dimmension type, you
y can add tim me intelligence. The Businesss Intelligence Wizard will create a hierarch
hy for
the dimension and enable you to t use time-de ependent MDX X functions succh as Periodsttodate.
Currrency Dime
ensions
Currency dimensions store values in one base e currency and
d then convert the value to a local currencyy
base
ed on the loca
ale of the client. You must ha
ave a measuree group that co
ontains the excchange rate.
To create
c a currenncy dimension change the Type
T of the dim
mension Curre ency. You can then run the
nce Wizard and this will desiign the curren cy conversion process.
Business Intelligen
Acccounts Dime
ensions
Finaancial accounts are not stand
dard dimensions. The aggreg gation of acco
ounts is non-sttandard and wwithout
a mechanism to adda specific accounts functio
onality, you wo ould have to crreate custom rrollup formulaas and
calcculated membe ers. Accounts dimensions arre parent child
d dimensions wwith accounts being children n of
othe er accounts.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 6-11
To create a financial account dimension set the dimension type to Accounts and then run the Business
Intelligence Wizard to add account intelligence to the dimension. The wizard will then guide you through
the process of defining individual accounts as an account type such as income or expense.
For More Information For more information about how to Add Account Intelligence to a
Dimension, see http://go.microsoft.com/fwlink/?LinkID=246781.
For More Information For more information about Dimension Types, see
http://go.microsoft.com/fwlink/?LinkID=246782.
MCT USE ONLY. STUDENT USE PROHIBITED
6-12 Working with
w Cubes and Dimeensions
Lesson 2
Definin
ng Attribute Hierarch
H ies
Hierrarchies define
ed the multi-le
evel structure of
o a dimension
n and the relattionships betw
ween the levelss in a
hierrarchy can affe
ect query and processing
p perrformance..
• Describe hierarchies.
• Describe ragg
ged hierarchies and the options you have to configure tthem.
What
W Are Hierarchies
H s?
Attributes are exposed to use ers through atttribute hierarch hies. An attrib ute hierarchy in a dimensionn
in
ncludes an optional All level and distinct members
m of thee attribute. Forr example, a CCustomer dime ension
might
m include a Name attribu w two levelss: the All level aand a second level with a member
ute hierarchy with
fo
or each name. It is attribute hierarchies
h thaat define the sp pace of a cubee. You can thinnk of a cube ass the
multidimension
m nal space created by the prod duct of its attrribute hierarchhies. Dimension ers for
ns are containe
atttribute hierarcchies. A dimen
nsion can also contain user h hierarchies as a navigational convenience, but
hese do not afffect the space in the cube.
th
Defining relatio
onships betweeen levels in a hierarchy
h enab ne more useful
bles Analysis Seervices to defin
ag
ggregations too increase query performancce and can also o save memoryy during proce essing perform
mance,
which
w can be immportant with large or comp plex cubes.
When
W attributess are arranged
d into user-deffined hierarchi es, you definee relationships between hieraarchy
le
evels. The levels are related in
n a many-to-oone or a one-to o-one relation nship (called a natural relatio
onship).
Fo
or example, in a Calendar Time hierarchy, a Day level sh ould be relateed to the Montth level, the M Month
evel related to the Quarter le
le evel, and so on
n.
Natural hierarch hies are preferrred for performance reason s. The dimensiion designer w will warn you iff you
crreate a hierarchy that is non-natural. You canc ignore thiss warning wheen it makes sen nse to use a noon-
naatural hierarch
hy – for examp ple, it is quite plausible
p that yyou would wan
nt to drill dow
wn from maritaal status
to
o gender. You might be prim marily intereste ed in whether a customer is married and th hen drill downn to
th
heir gender. Thhe gender on itsi own is of no o use to you, bbut when commbined with the e marital statu
us it
re
eturns useful data.
d
MCT USE ONLY. STUDENT USE PROHIBITED
6-14 Working with
w Cubes and Dimeensions
Parent-Child
d Hierarchiies
A paarent-child hie
erarchy exists when
w you have
e a self-referen
ncing dimension table. For e example, an
Empployee dimenssion might havve a Manager attribute.
a Onlyy the most sennior employee has no manag ger; all
othe
er employees have a position in the hierarrchy that is deffined by the id
dentities of the
eir managers aand of
thosse that they manage.
m
A paarent-child hie
erarchy is an unbalanced hie erarchy. This im
mbalance occu
urs when the n
number of leve
els
from
m leaf to root is different forr different leaf members. Forr example, som
me managers mmight have thrree
els of employee working for them while otthers have justt two.
leve
Pare
ent-child hiera
archies are nott defined by th d are defined by
he order in wh ich attributes aare added, and
the relationships in
i the dimension table instea ad.
Pare
ent-child dime
ensions are chaanging dimenssions. This meaans that rows can be modified without the
e
ng. They are also the only diimension typee that you can write-enable.
need for processin
You should also consider what to do with non-leaf data. In the example we have used the sales manager
can also make sales. If this is the case, and you have data in the fact table associated to non-leaf members,
you must change the dimension's Members With Data property to Nonleaf data visible or Nonleaf
data hidden. Otherwise, processing the cube fails. If you use Nonleaf data visible the parent, in this
case, the sales manager, will also appear in the level below. They will appear to report to themselves. If
you use Nonleaf data hidden, the sales manager will not appear in the level below, however if you
perform a sum on all employee sales, the value will not include the sales manager and, therefore, will not
equal the total for that department.
For More Information For more information about Parent-Child Dimensions, see
http://go.microsoft.com/fwlink/?LinkID=246783.
MCT USE ONLY. STUDENT USE PROHIBITED
6-16 Working with
w Cubes and Dimeensions
Ragged Hierrarchies
Raggged hierarchiees often seem similar to pareent-child hieraarchies to the uuser. Like a parent-child
hierrarchy, a ragge
ed hierarchy will
w also have a different num mber of levels in different parrts of the hieraarchy,
but these levels are formed from m different collumns in the ddimension tablle rather than from a self-
refe
erencing relatio ample, in a Location dimenssion you mightt have Location, Region, Statte
onship. For exa
nly be used fo r the United States, Canada,, and Australia. All
and Country levells, but the Statte level may on
otheer countries in
n the dimension may skip the e State level.
The HideMembe
erIf property makes
m a regular hierarchy rag e values for this
gged. There arre five possible
property:
• ParentName
e This value hides
h a level member
m when iit has the samee name as its p
parent.
Youu can use a rag
gged hierarchyy as an alternattive to a paren
nt-child dimen
nsion. The aggrregates are
calcculated when the
t cube is pro ocessed improvving query perrformance, ho owever a raggeed hierarchy is not a
changing dimensiion and thereffore the flexibility of parent- child dimensio
ons is lost.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 6-17
Using
U Hiera
archies
Yo
ou typically cre
eate user-defined hierarchiees to allow useers to drill-up aand drill-down
n through the d
data,
an
nd to allow Annalysis Servicess to create mea
aningful aggreegations of thee measures.
Th
here are severa
al important hierarchy
h prope
erties:
• The AttribuuteHierarchyOOptimizedSta ate can be set to NotOptim mized to preven nt Analysis Serrvices
from creating indexes on the attribute hierarchy. Thiss will reduce p
processing timee but increase query
time, and you
y should only use this whe en you do not query the attrribute hierarch hy.
• If you set th
he AttributeH
HierarchyEnab bled property to False, the h hierarchy is dissabled and Analysis
Services only creates the attribute hiera
archy as a mem mber propertyy. This is useful if the attributte is
providing detail,
d but you do not want tot use it as a leevel for aggreg
gation.
• If you set th
he AttributeHHierarchyVisib ble property too False, the atttribute is only visible from u
user-
defined hieerarchies. This is useful if there are large nu
umbers of disttinct values in tthe attribute
hierarchy thhat would cause confusion and a would nott add any beneefit.
MCT USE ONLY. STUDENT USE PROHIBITED
6-18 Working with
w Cubes and Dimeensions
Atttribute Relationships
In most
m dimensions however, th here are levels and relationshhips between llevels. For example, you havve a
Cusstomer dimension containing attributes fo or CustomerK Key, Name, Ad ddress, City, R
Region, and
Couuntry. Name and
a Address relate directly to t the CustommerKey, but yo ou want to creeate relationships for
the other attributes. You create a relationship
p from Countryry to Region, ffrom Region tto City, and fro om
City
y to CustomerrKey. This relationship now supports
s the leevels within th
he data and wiill be used to ccreate
agggregates to impprove query peerformance.
Demonstra
D ation: Creating a Pare
ent-Child Hierarchyy
• In the Name
N Column box select FullName.
• Click Next.
N
9.. mpleting the Wizard page, in the Name box, type Emp
On the Com ployee and cliick Finish.
Task 2: Na
ame the levels in a pare
ent-child hieerarchy
1.. On the Dim
mension Struccture tab, In th
he Attributes section, click P
Parent Emplo
oyee Key.
3. In the Level Naming Template dialog box type Senior Management in the first blank cell.
4. Move down one cell and type Middle Management and move down another cell and type
Employee.
5. Click OK.
8. When deployment has completed, click the Browser tab and expand the employees in the hierarchy.
Note that when you select an employee, the hierarchy level name is displayed at the top of the
browser area.
Lesson
n3
Sortin
ng and Grouping Attributes
• Sort attribu
utes.
• Group attributes.
MCT USE ONLY. STUDENT USE PROHIBITED
6-22 Working with
w Cubes and Dimeensions
Sorting Attributes
You
u can choose any attribute too sort the hiera
archy by. This attribute can b
be the key, the
e name, or anyy
othe
er secondary attribute
a in the
e dimension taable.
• If you order by
b name, Analyysis Services will
w order the m
members in alp
phanumeric orrder.
• If you order by
b key, you cann specify one or
o more key co olumns and usse these to sorrt the memberrs. This
allows you to
o sort dates by quarters. With
h a single key, the order of q
quarters would
d be Q1, Q2, Q
Q3,
and Q4 with all
a years aggreegated, for exa
ample, Q1 wou uld aggregate all Q1 data fro
om every yearr. If
you add the Year
Y column too the key, the order would bbe Q1 2000, Q Q2 2000, Q3 20000, Q4 2000, QQ1
2001, Q2 200 01, Q3 2001, an
nd so on.
Grouping
G Attributes
A
So
ome hierarchiees have no nattural levels, so Analysis Servicces only createes an All level and the leaf le
evel.
Th t cube difficult to navigate
his can make the many member s of the hierarrchy. You can u
e if there are m use
grouping to orgganize these members
m into groups
g to simp
plify cube browwsing. For example, custome ers
co
ould be grouped into incom me brackets rather than show wing individuall incomes. You u can then drilll-down
in
nto the groupss to show the detail
d as neede ed.
To
o enable grouping, you musst set the DiscrretizationMetthod propertyy of the attribu
ute. This can be
e set to:
Lab
b Scenario
o
Somme hierarchies have no naturral levels, so Annalysis Servicees only creates an All level an
nd the leaf leve
el.
e cube difficultt to navigate iff there are ma ny members o
Thiss can make the of the hierarchhy. You can usee
grouping to organize these mem mbers into gro oups to simpliffy cube browssing. For example, customerss
could be grouped d into income brackets rathe er than showin g individual inncomes. You can then drill-d down
into
o the groups to
o show the dettail as needed..
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 6-25
Lab 6:
6 Definiing Dim
mensions
Exercise 1: Configurin
ng Dimenssions
Scenario
Se
everal users in the Adventure e Works Cycle
e company havve reported th at they want to be able to vview
da
ata across timee periods, so you
y need to co onfigure the DDate dimension n as a Time dimension so th
hat
Analysis Service
es can apply teemporal calcula
ations to valuees in this dimeension.
Th
he main tasks for this exercisse are as follow
ws:
2.. Remove un
nused attribute
es from dimensions.
Task 2: Re
emove unussed attribute
es from dimeensions
• Open the Adventure
A Wo
orks OLAP.sln
n solution in th
he D:\10778A\\Labfiles\Lab06
6\Starter folde
er in SQL
Server Data
a Tools.
• Delete the Commute Distance, Number Cars Owned, and Number Children At Home attributes
from the Customer dimension.
• Delete the Days To Manufacture and Safety Stock Level attributes from the Product dimension.
Month Month
Results: After this exercise, the Customer and Product dimensions have had some attributes removed,
and time intelligence has been added to the Date dimension.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 6-27
Calendar Quarter Calendar Semester Rigid (will not change over time)
Calendar Semester Calendar Year Rigid (will not change over time)
MCT USE ONLY. STUDENT USE PROHIBITED
6-28 Working with Cubes and Dimensions
When you have finished, the Attribute Relationships pane should resemble the following image.
• Add the following attributes to the <new level> indicator in the hierarchy in this order:
Calendar Semester
Calendar Quarter
Month
Simple Date
• Set the AttributeHierarchyVisible property of all of the attributes you added to the hierarchy to
False. This defines these attributes as member properties rather than hierarchies in their own
right, so that users can only browse them through the Calendar Date hierarchy.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 6-29
• In the Attribute Relationships tab, create the following new attribute relationships. Note that all of
these relationships are flexible (because, for example, a particular city could potentially be re-
designated as belonging to a different state; or a customer who is single could get married).
State-Province Name English Country Region Name Flexible (may change over time)
When you have finished, the Attribute Relationships pane should resemble the following image.
• Drag the English Country Region Name attribute to the Hierarchies pane.
MCT USE ONLY. STUDENT USE PROHIBITED
6-30 Working with Cubes and Dimensions
• Add the State Province Name, City, Postal Code, and Full Name attributes to the hierarchy.
• Change the hierarchy name to Customer Geography, so that the completed hierarchy resembles
the following image.
• Create a second hierarchy named Gender - Marital Status in this dimension, with levels for Gender
and Marital Status, as shown in the following image.
• Set the AttributeHierarchyVisible property of all of the attributes you added to the hierarchies to
False.
• In the Attribute Relationships tab, create the following new attribute relationships. Note that all of
these relationships are flexible (because, for example, a particular product could potentially be re-
categorized as belonging to a different subcategory).
English Product Subcategory Name English Product Category Name Flexible (may
change over time)
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 6-31
When you have finished, the Attribute Relationships pane should resemble the following image.
• Drag the English Product Category Name attribute to the Hierarchies pane.
• Add the English Product Subcategory Name and English Product Name attributes to the
hierarchy.
• Change the hierarchy name to Product Category, so that the completed hierarchy should
resemble the following image.
• Set the AttributeHierarchyVisible property of all of the attributes you added to the hierarchies to
False.
MCT USE ONLY. STUDENT USE PROHIBITED
6-32 Working with Cubes and Dimensions
• Browse the Customer dimension, and verify that the Customer Geography and Gender – Marital
Status hierarchies behave as expected.
• Open the Adventure Works Cube.cube cube in the cube designer, and then on the Browse tab,
view the Sales Amount measure aggregated by the Product Category hierarchy, and verify that the
hierarchy displays product by category, subcategory, and product name.
Results: After this exercise, you should have created a Calendar Date hierarchy, a Customer Geography
hierarchy, a Gender - Marital Status hierarchy, and a Product Category hierarchy.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 6-33
• On the Dimension Structure tab for the Date dimension, modify the following properties of the
Month Number of Year attribute:
• AttributeHierarchyOptimizedState: NotOptimized
• AttributeHierarchyOrdered: False
Month Month Number of Year Rigid (will not change over time)
• On the Dimension Structure tab for the Date dimension, modify the following properties of the
Month attribute:
• OrderBy: AttributeKey
• OrderByAttribute: Month Number Of Year
• Deploy the project and browse the Calendar Date hierarchy to verify that the values are now sorted
in the correct order.
MCT USE ONLY. STUDENT USE PROHIBITED
6-34 Working with
w Cubes and Dimeensions
Task 2: Gro
oup the Yearrly Income attribute hie rarchy mem
mbers
• Open the Cusstomer dimen nsion in Dimen nsion Designerr, and browse YYearly Incom
me hierarchy. N
Note
that the salaries have no hie
erarchy, as sho
own in the foll owing image.
• DiscretizzationMethod
d: Automatic
• DiscretizzationBucketC
Count: 5
• OrderBy
y: Key
Results: After thiss exercise, you should be ablle to view the correctly sorteed and groupe
ed dimensions in
the cube.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 6-35
Modu
ule Reviiew and
d Takeaw
ways
Review
R Quesstions
1.. How do dim
mensions, attriibutes, and facct tables relatee to one anoth er?
Module 7
Working with Measures and Measure Groups
Contents:
Lesson 1: Working with Measures 7-3
Module Overrview
Meaasures and me
easure groups provide the da ata values thatt your cube caan aggregate in
n order to pro
ovide
mmary values for analysis. This module describes measurres and measure groups. It also explains ho
sum ow
you can use them
m to define factt tables and asssociate dimennsions with meeasures.
Afte
er completing this module, you
y will be able to:
• Describe mea
asures.
• Describe mea
asure groups.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 7-3
Lesson
n1
Work
king witth Meassures
• Describe th
he concept of a measure.
Inttroducing Measures
A measure
m represents a column n that contains quantifiable ddata, usually numeric, that yyou can aggreg gate.
Typically, measurees occur as a column
c in the fact
f table and are the valuess that are of m
most interest to
o the
business user. Measures are org ganized into measure
m groupss.
For example, in a retail cube thaat has dimensiions for stores,, products, tim
me, and salespe
eople, the meaasures
mig
ght include salees value and sa ales units. These measures a re then aggregated to provide total sales units
and total sales vallue for each store, product, day,
d and salesp person.
Callculated Me
easures
Youu can create ca
alculated meassures based on n other measurres in the fact table. You use e a measure
o a calculated measure, baseed on a colum
expression to defiine the value of mn in a fact tab
ble as modified d by a
Mulltidimensional Expression (M MDX) statemen nt. You should consider the p performance im mpact of using g
calcculated measures because th hey are calculated at run tim e. If a calculat ed measure is infrequently u used
and is quite a simple calculationn—for example, the sum of ttwo measures— —it will have llittle performaance
imppact on your quueries, but it might
m reduce processing
p tim es. Converselyy, if a measure is frequently u used
and involves a commplex calculattion, it might cause
c unaccepptable query tim mes.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7-5
Aggregation
The aggregation behavior of each measure is determined by the aggregation function that is associated
with the measure.
For More Information For more information about aggregation, see the Aggregation
Functions topic later in this lesson.
Granularity
You should consider the granularity of measures. You cannot make a measure more granular than the
highest level of granularity in the dimension tables, but you can make it less so. For example, if you have a
time dimension that stores data at levels of day, month, quarter, and year, it is not possible to store sales
measures at a granularity of hours, but it would be possible to store them at a granularity of months. You
can specify the granularity of a measure group with relation to a specific dimension by using the
Dimension Usage tab of the Cube Designer.
Note Granularity refers to how specific something is. For example, an hour is more
granular than a day, and a day is more granular than a week.
MCT USE ONLY. STUDENT USE PROHIBITED
7-6 Working wiith Measures and Meeasure Groups
Me
easure Pro
operties
Mea
asures have prroperties that enable
e you to define how th
he measures fu
unction and to
o control how tthe
mea
asures appear to users. You can
c configure measures on tthe Cube Stru ucture tab of tthe Cube Desig
gner.
Mea
asure propertie
es determine:
• How measure
es are aggrega
ated.
• The data type
e of the colum
mn in the underlying fact tab le to which thee measure is b
bound.
• The descriptio
on of the measure, which may be exposed
d in client appllications.
• at is displayed to the user.
The name tha
• The display fo
ormat of the measure.
m
• The unique id
dentifier (ID) of
o the measure. Note that thiis property is rread-only.
• The visibility of
o the measure
e.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 7-7
Configuring
C g How Me
easures Are
e Displayeed
Th
he measure prroperty Forma atString determines how meeasure values aare displayed tto users, and yyou can
co
onfigure it by using the Prop
perties window
w of a measuree in the Cube D
Designer.
Tyypical FormatString values include Generral Number o or Medium Da ate, but althouugh a list of dissplay
ormats is provided, you can specify
fo s many additional
a form
mats that are n
not in the list b
by specifying aany
naamed or user-defined forma at that is valid in Microsoft® ®. This might include changing the
® Visual Basic®
orrder of a date or introducing
g currency sym mbols.
Th
he table on the slide assume
es that the regional setting in nt computer is English
n Control Paneel on the clien
(U
United States).
MCT USE ONLY. STUDENT USE PROHIBITED
7-8 Working wiith Measures and Meeasure Groups
Ag
ggregation
n Functions
1. An additive measure.
m This iss also called a fully additive m
measure, and you can aggre egate it along all of
the dimensions that are inccluded in the measure
m groupp that containss the measure,, without restriiction.
Additive measures are the most
m common nly used in Miccrosoft SQL Seerver® Analysiss Services (SSA
AS)
and consist of the SUM and d COUNT funcctions.
2. A semiadditivve measure. Yo ou can aggrega ate this along some, but nott all, dimensionns that are included
in the measurre group that contains the measure.
m An exxample of a seemiadditive aggregation wou uld be
a units-in-sto
ock value for warehouse
w gooods. This would d be additive b
by region to giive you the tottal
units in stock, but it would not be additivve by time beccause if you addd last week's sstock to this w
week's
stock, you could end up witth a value thatt lists twice as much stock ass you have.
Use the AggregateFunction property to define the function that is used to aggregate the measure.
Commonly used aggregation functions include:
• The Sum function. This is additive and calculates the sum of all values for every child member. Sum is
the default function.
• The Count function. This is additive and calculates the quantity of child members.
• The Min function. This is semiadditive and calculates the lowest value for each child member.
• The Max function. This is semiadditive and calculates the highest value for each child member.
• The DistinctCount function. This is nonadditive and calculates the count of all unique child members.
• The None function. This is nonadditive, performs no aggregation, and supplies values directly from
the fact table.
• The ByAccount function. This calculates the aggregation according to the aggregation function that
is assigned to the account type for a member in an account dimension.
• The AverageOfChildren function. This calculates the average of values for all non-empty child
members.
• The FirstChild function. This retrieves the value of the first child member.
• The LastChild function. This retrieves the value of the last child member.
• The FirstNonEmpty function. This retrieves the value of the first non-empty child member.
• The LastNonEmpty function. This retrieves the value of the last non-empty child member.
For More Information For more information about how to Configure Measure
Properties, see http://go.microsoft.com/fwlink/?LinkID=246784.
MCT USE ONLY. STUDENT USE PROHIBITED
7-10 Working with
w Measures and Measure
M Groups
Lesson 2
Workin
ng with
h Measu
ure Grou
ups
You
u use measure groups to asso
ociate dimensiions with mea sures. There a re a number o
of properties th
hat
you can configure ure group level, including:
e at the measu
• Partitions. These are containers for a porttion of the meeasure group d
data.
Afte
er completing this lesson, yo
ou will be able to:
• Describe mea
asure groups.
• Explain how to
t configure measure
m group storage.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 7-11
In
ntroducing
g Measure
e Groups
In
n a cube, meassures are group
ped by their underlying fact tables into measure groupss. You use meaasure
groups to assocciate dimensions with the meeasures in the fact table.
A measure grou
up defines:
• The dimenssions the meassures can be aggregated by.. This is achievved by creating
g relationshipss
between measure
m groupss and dimensio
ons in the cub e. For examplee, you might relate an Internnet
Sales meassure group to Product,
P Date
e, and Custommer dimensions; and in the same cube you u might
relate a Resseller Sales measure
m group to Product, D
Date, and Rese eller dimensioons. Measures iin both
groups can be aggregate ed by product and date, Inteernet sales meaasures can be aggregated byy
customer, and
a reseller sales measures can
c be aggreg ated by reselleer.
• The granulaarity at which the measures are related to the dimension ns. For examplle, a cube might
include a Reseller
R Sales measure group that is relateed to the Date e dimension baased on a key for an
individual day
d (because each
e sale is asssociated with tthe specific datte on which th
he sale occurre
ed), and
a Sales Quoota measure group
g that is reelated to the D
Date dimensio on based on th he year (because sales
quotas are set for each yeear, not for inddividual days, wweeks, or mon nths).
Thhe DistinctCount aggregatiion looks for th he number of distinct valuess in a column oof the fact tab
ble. For
exxample, you might
m want to know
k how many salespeoplee sold a particu ular product. T
This is query iss very
re
esource-intensive and, thereffore, Analysis Services
S createes a separate m
measure group p for DistinctC Count
measures.
m
MCT USE ONLY. STUDENT USE PROHIBITED
7-12 Working with
w Measures and Measure
M Groups
Me
easure Gro
oup Properties
Meaasure group properties determine behavio ors for the entiire measure grroup and set the default
beh
haviors for certtain propertiess of measures within
w a measuure group. Meeasure group p properties inclu
ude:
• ProactiveCacching This defines how data is reprocesssed when theree are changes in the underlyying
data source.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7-13
• ProcessingMode This indicates whether indexing and aggregating should occur during or after
processing. You can use lazy processing to enable SSAS to choose a time when workload is low;
however, if you use lazy processing, you will not know exactly when the indexing workload will occur
or when indexing has occurred and queries will be at peak performance.
• ProcessingPriority This determines the processing priority of the cube during background
operations, such as lazy aggregations and indexing.
• StorageLocation This is the file system storage location for the measure group. If none is specified,
the location is inherited from the cube that contains the measure group.
• StorageMode This determines the storage mode for the measure group.
Relationships Between
n Measure Groups an
nd Dimenssions
A re
elationship bettween a dimen nsion and a meeasure group cconsists of thee dimension an nd fact tables tthat
are participating in
i the relationsship and a gra
anularity attrib
bute that speciffies the granularity of the
dim
mension in the particular mea asure group. This relationshi p is configuredd in the Dimeension Usage tab of
the Cube Designe er.
Reg
gular Dimen
nsion Relatiionship
A re
egular dimensiion relationship represents the relationship
p between dimmension tabless and a fact tabble in
a tra
aditional star schema
s design
n. The key colu
umn for the dimmension is join
ned directly to
o the fact table
e.
Refference Dim
mension Rela
ationship
A re
eference dimennsion relationsship represents the relationsship between d
dimension tables and a fact table
in a snowflake sch
hema design. The
T key colum mn for the dimeension is joined indirectly to
o the fact table
e.
Facct Dimensio
on Relationsship
If a dimension con
nsists entirely of values in a fact
f table and does not havee a separate dimension table
e it
has a fact dimension relationshiip.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7-15
You can use the Granularity attribute list to define the granularity of a particular relationship. Most
cubes will have time data, so it is common to have a fact dimension table. This will store time data at the
highest level of granularity of any fact table, but, although some fact tables may require data that is
accurate to the minute, many will have day, month, or quarter granularity. By allowing you to specify the
granularity of a measure group, you can use one time dimension for all of these fact tables.
MCT USE ONLY. STUDENT USE PROHIBITED
7-16 Working with
w Measures and Measure
M Groups
De
emonstration: Defining Relatio
onships Beetween Dim
mensions aand
Me
easure Gro
oups
3. In Solution Exxplorer, right-cclick Adventure Works OLA AP and click D mpted, specify the
Deploy. If prom
user name AD DVENTUREWORKS\Studen nt and the passsword Pa$$ww0rd.
4. In Solution Exxplorer, double
e-click Adventture Works C
Cube.cube, and
d on the Browwser tab, expand
Measures an nd Internet Sales and drag the
t Sales Amo ount measure to the Drag le
evels or meassures
here to add to the query area. Then exp pand the Geoggraphy dimennsion and drag
g Country-Reg gion
to the left of the Sales Amoount value.
6. In Solution Exxplorer, right-cclick Customeer.dim, and theen click View Designer. Notte that this
dimension is based on the Customer
C tab
ble, which inclu
udes a GeograaphyKey attrib
bute that relattes it
to the Geogrraphy table.
8. On the Dimension Usage tab, click the intersection of the Internet Sales measure group and the
Geography dimension, click the ellipses (…) button.
11. In the Reference dimension attribute list, select Geography Key, and in the Intermediate
dimension attribute list, select Geography Key.
13. In Solution Explorer, right-click Adventure Works OLAP and click Deploy. If prompted, specify the
user name ADVENTUREWORKS\Student and the password Pa$$w0rd.
14. Click the tab for the Adventure Works Cube.cube, and on the Browser tab, click the Reconnect
button. Then in the data grid area, click the Click to execute the query link.
Note that the values for each region are now correct.
15. On the Dimension Usage tab, in the Dimensions list, right-click Geography, and then click
Rename.
16. Change the name of this cube dimension to Reseller Geography, and then press Enter to make this
name change take effect.
MCT USE ONLY. STUDENT USE PROHIBITED
7-18 Working with
w Measures and Measure
M Groups
Ag
ggregation
ns
Agggregations are precalculated summaries off data from leaaf cells that im
mprove query response time by
prep
paring the ansswers before th
he questions are asked.
A simple Aggrega
ation object consists
c of:
• Basic informa
ation that inclu
udes the name
e of the aggreg
gation, the ID, annotations, aand a descripttion.
• A collection of
o Aggregatio ontain the list of granularityy attributes for the
onDimension objects that co
dimension.
Agggregations are what give mu ultidimensional cubes their p
performance benefits. They pprecalculate th
he
answwer to queriess at processing time; therefore, when the q
query is run, th
he performancce is hugely
imp
proved. If you consider
c that a query might have to aggreegate thousands of individuaal values to produce
one
e summarized output
o a there mayy be hundreds of output val ues, it become
value, and es clear that
ese results will have enormous benefits.
preccalculating the
It might
m seem app propriate to prrecalculate eveery single posssible result; ho
owever, some aaggregations
provvide little bene
efit. The Aggre
egation Design n Wizard proviides options fo or you to speccify storage and
perccentage constraints on the algorithm
a to acchieve a satisfaactory tradeofff between que ery response time
and storage requiirements. For example,
e if SSA
AS stores aggrregates at a mo onth level, it taakes little
proccessing to gen nerate quarter data at query run time. Typ ically, there is little benefit from preprocessing
morre than 35 percent of aggreg gations, and yo ggregation Design Wizard.
ou can specifyy this in the Ag
SSA
AS incorporatess a sophisticate
ed algorithm tot select aggreegations for prrecalculation sso that other
agg
gregations can be quickly computed from the precalculaated values. To o improve aggregation desig gn for
your specific syste
em further, you
u can use SSAS S for some tim
me with normal workloads an nd then run thhe
Usage-Based Optimization Wiza ard. This is alm
most identical tto the Aggregation Design W Wizard; howevver, it
base
es the optimizzation on queries submitted to SSAS and th herefore should give better query responsse
with
h less processin
ng time.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 7-19
Configuring
C g Measure
e Group Sttorage
Th
here are three modes of multidimensionall storage in SSA
AS: multidimeensional online
e analytical pro
ocessing
(M
MOLAP), relatio
onal OLAP (RO
OLAP), and hyb
brid OLAP (HO OLAP).
MOLAP
M
MOLAP
M storagee stores both the aggregations and a copyy of the sourcee data in the m
multidimensionnal cube.
MOLAP
M he greatest performance butt requires morre storage spacce due to the d
gives th duplication. Th
here is
la
atency when yoou use MOLAP P storage beca
ause the cube ddata is only reefreshed when the cube is
processed, so ch
hanges from the data source e are only upd
dated periodicaally.
Tyypically the cube is availablee during processing; howeveer, query performance is affe ected, and if structural
chhanges occur tot cube objectts, the cube ma ay need to be taken offline. To avoid these issues, you ccan
scchedule processsing to occur when the cub be is rarely use d, for examplee, at night. Oftten, this is not
poossible becausse many system ms are in use 24
2 hours a dayy, seven days a week and you u must therefo ore use
otther strategiess. If you processs the cube to a storage servver, you can th
hen use databaase synchronizzation to
coopy the processsed data to th he production server. You co ould also use p
proactive caching.
Prroactive cachinng uses MOLA AP storage, butt it incorporatees changes maade to the dataa source by ussing
nootifications. While
W the cache
e is rebuilt with
h new data, yo
ou can choose to send querie es to ROLAP data,
which
w is up-to-d
date but slowe
er, or to the orriginal MOLAPP storage, whicch is faster butt will not have the
neew data.
ROLAP
R
ROOLAP storage stores the agg gregations in indexed relatioonal data alongg with the sou
urce data. It do
oes not
usse multidimensional storagee, so ROLAP da ata is slower to
o query and sloower to processs than MOLAP or
HOLAP, but it enables
e real-tim
me access to data
d and uses l ess storage sp
pace.
MCT USE ONLY. STUDENT USE PROHIBITED
7-20 Working with Measures and Measure Groups
HOLAP
HOLAP storage stores aggregations in the multidimensional cube and leaves source data in the relational
database. This can provide a good compromise when leaf-level data is rarely accessed. If leaf-level data is
frequently accessed MOLAP would provide improved performance
Note You should also consider tabular data model storage, particularly as an alternative
to ROLAP and HOLAP. The tabular data model is covered in more detail in Module 10,
“Implementing a Tabular Data Model with Microsoft PowerPivot”
Storage Settings
You can use the Storage Settings dialog box to configure storage.
Storage settings for partitions are set in the Storage Options dialog box, which you can open in one of
several different ways.
To configure default storage settings for new measure groups that are added to a cube:
• In the Cube Wizard, on the Cube Builder tab, in either the Measures or Dimensions pane, click the
cube object, and in the Properties window, click the browse button for the ProactiveCaching
property setting.
• To configure default storage settings for new partitions that are added to a measure group, in the
Cube Wizard on the Partitions tab, expand the measure group, and then click the Storage Settings
link for that measure group. This displays the Storage Settings dialog box for the selected measure
group.
To configure storage for an existing partition, in the Cube Wizard on the Partitions tab, expand the
measure group, and then use one of the following methods:
• Click the partition, and on the Cube menu, click Storage Settings.
• Click the partition, and on the toolbar, click Set Proactive-cache Settings.
• Click the partition, and in the Properties window, click the ellipses (...) button for the
ProactiveCaching property setting.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 7-21
Partitions
P
A partition is a container
c for all,
a or a portion
n of, the meassure group datta.
SS
SAS Enterprisee Edition uses partitions
p to manage
m and sto
ore data and aaggregations ffor a measure g
group
in
n a cube. By sp
plitting the data into multiple
e partitions, th
here are a num
mber of performmance benefits:
• If you partittion based on date, you onlyy need to proccess the latest partition, whicch reduces pro
ocessing
time.
• You can stoore frequently used data diffferently from aaggregated daata. This enable
es you to use higher
levels of ag
ggregation andd a faster stora
age mode to im mprove query times and red duce processing times
and storage e requirementts for older datta.
When
W you incre
ementally upda ate a partition, a temporary partition is creeated that hass an identical sstructure
to
o the source pa emporary partition is then m
artition. The te merged with th he original parttition. You shoould
co
onsider data in
ntegrity when you incrementtally update in ndividual partittions. For exammple, if a channge in
he source data results in a re
th ecord moving from
f one part ition to anotheer, but only on
ne partition is
up
pdated, the daata may either disappear or be duplicated..
• Basic information that includes the name of the partition, the storage mode, and the processing
mode.
• An aggregation design that is a collection of aggregation definitions that you can share across
multiple partitions.
In a horizontally partitioned measure group, each partition in a measure group is based on a separate
table, and these fact tables can be from different data sources.
In a vertically partitioned measure group, a measure group is based on a single table, and each partition is
based on a source system query that filters the data for the partition.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 7-23
Lab Scenario
Bu
usiness users are
a performing g analysis of In
nternet sales w
with the multidimensional cube you have ccreated.
However, they also
a need to analyze resellerr sales. You havve reseller salees data in the d
data warehousse on
which
w the cube is based, so yo
ou plan to add d a second meeasure group ccontaining the reseller measu ures.
Users have also requested thaat you remove some measurres that they d
do not need to
o use when anaalyzing
da
ata, and ensurre that the rem
maining measures are clearlyy named.
Finally, the data nistrator is concerned about the disk spacee used by the ccube, but your users
a center admin
arre concerned about
a perform
mance when an nalyzing Intern must optimize the storage and
net sales. You m
ag
ggregations off the cube to balance
b these concerns.
MCT USE ONLY. STUDENT USE PROHIBITED
7-24 Working with
w Measures and Measure
M Groups
Exe
ercise 1: Configuring
g Measure
es
Sce
enario
Youu are refining the OLAP cube e for your company. Your useers can curren ntly view measures for Internnet
sale
es, but you havve additional data
d for reseller sales in yourr data warehou use and they wwould like to
analyze this data as well as Internet sales. When you add th he reseller saless measures, yo
our users have
requuested that yoou remove som me measures th hat are not reqquired for busiiness analysis, and ensure th
hat the
meaasures in the cube are clearlyy named.
In th
his exercise, yo
ou will configu
ure format strin
ngs and displaay folders for m
measures.
1. Prepare the la
ab environmen
nt.
Task 1: Prep
pare the lab
b environment
• Ensure that th
he MIA-DC1 and MIA-SQLBII virtual machiines are both rrunning, and then log on to MIA-
SQLBI as ADV VENTUREWORKS\Student with the passw word Pa$$w0rd.
• Run the Setup Windows Co ommand Scrip
pt file (Setup.cm 10778A\Labfiles\Lab07\Startter
md) in the D:\1
folder as Adm
ministrator.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7-25
• Open the Adventure Works DSV data source view and add the FactResellerSales table, together
with all related tables.
• Open Adventure Works Cube in cube designer, and add a new measure group named Reseller
Sales based on the FactResellerSales table.
• Review the names of the measures in both the Internet Sales and Reseller Sales measure groups.
Note that when the Reseller Sales measure group was created, measures were created for all of the
numerical fields in the FactResellerSales table. In cases where an measure with the same field name
already existed, a new measure was created with “ - Fact Reseller Sales” appended to its name, as
shown in the following image.
MCT USE ONLY. STUDENT USE PROHIBITED
7-26 Working with Measures and Measure Groups
Tip Click the Show Measures Grid icon to view all of the measures in the cube as a grid.
In this view, you can multi-select measures by holding the Ctrl key.
• Promotion Key
• Currency Key
• Revision Number
• Extended Amount
• Discount Amount
• Product Standard Cost
• Freight
Total Product Cost – Fact Reseller Sales Total Product Cost – Reseller Sales
2. Create a dimension.
• Open Adventure Works Cube in the cube designer, and on the Browse tab, review the measures
and dimensions available for each measure group by selecting each measure group in turn in the
Measure Group drop-down list in the Metadata pane.
• When the Internet Sales measure group is selected, the Product dimension should be listed.
• When the Reseller Sales measure group is selected, there is no Product dimension.
When you have defined the relationship, the Dimensions Usage tab should resemble the
following image.
• Deploy the Adventure Works OLAP project, and then browse the cube, verifying that you can view
Sales Amount – Reseller Sales by Product Category.
Results: After this exercise, you should have defined a regular relationship to enable you to analyze
reseller sales data.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7-29
Task 1: Configure the storage mode of the Internet Sales measure group
• Configure proactive caching for the Internet Sales measure group in the Adventure Works Cube
cube.
• Set all aggregation usage to the default before starting the configuration.
• Deploy the Adventure Works OLAP project, entering the user name ADVENTUREWORKS\Student
and the password Pa$$w0rd if prompted. Then close SQL Server Data Tools.
• Start SQL Server Management Studio and connect to the localhost instance of Analysis Services.
• In Object Explorer, expand Databases, expand Adventure Works OLAP, expand Cubes, expand
Adventure Works Cube, expand Measure Groups, expand Internet Sales, and expand
Aggregation Designs to verify that the InternetSalesAgg aggregation has been deployed.
Results: After this exercise, you should have defined the storage mode aggregations and for the Internet
Sales measure group.
MCT USE ONLY. STUDENT USE PROHIBITED
7-30 Working with
w Measures and Measure
M Groups
Modulle Revie
ew and Takeaw
ways
Rev
view Questiions
1. Give an exam
mple of an additive measure, a semiadditivee measure, an d a nonadditivve measure.
Module 8
Introduction to MDX
Contents:
Lesson 1: MDX Fundamentals 8-3
Module Overrview
Mulltidimensional Expressions (M
MDX) is the quuery language that you use tto work with aand retrieve
mulltidimensional data in Microsoft® SQL Serrver® 2012 An nalysis Servicess (SSAS). This m
module describ
bes
the fundamentals of MDX. It alsso explains how
w to build calcculations, such
h as calculated members and d
nam
med sets.
Afte
er completing this module, you
y will be able to:
• Describe MDX
X.
• Add calculatio
ons to a cube.
• Describe how
w to use MDX in client appliccations.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 8-3
Lesson
n1
MDX Fundam
mentalss
After completin
ng this lesson, you
y will be able to:
• Describe MDX.
M
• Specify que
ery and slices axes.
a
• Establish th
he cube contexxt.
MCT USE ONLY. STUDENT USE PROHIBITED
8-4 Introduction to MDX
Wh
hat Is MDX
X?
MDX is an industrry-standard sp
pecification, and a wide rang e of online an
nalytical processsing (OLAP)
vendors have ado opted it. MDX was
w specifically created to q query OLAP cu bes; using Struuctured Queryy
Language (SQL) expressions
e wo
ould be long an nd complex beecause the SQL language is designed to
navigate two-dim es. With MDX, it is straightfo rward to navig
mensional table gate multidime ensional cubess and
also u down, and across hierarchies.
o to navigate up,
Termms that occur frequently when describing MDX statemeents and expressions include cell, tuple, and set.
A ceell is the intersection betwee
en a member ofo the measurees dimension aand a memberr of one or mo ore
othe er dimensions from which yo ou can obtain data. To identtify or extract such data, whe ether it is a sin
ngle
cell or a block of cells,
c MDX usees a system called tuples. A sset is a collectio
on of tuples th
hat defines mu ultiple
cellss from the samme dimensions.
MDX is not limited to multidimensional cubes. You can also use MDX with tabular data models alongside
the new Data Analysis Expressions (DAX) language, which is designed specifically for tabular data model
use.
For More Information For more information about the DAX language, see Module 11,
“Introduction to DAX.”
MCT USE ONLY. STUDENT USE PROHIBITED
8-6 Introduction to MDX
In MDX,
M the SELEC
CT statement specifies
s a resu
ult set that con
ntains a subsett of multidime
ensional data tthat
has been returned
d from a cube..
To identify the qu
uery axes, the cube
c nd the slicer axxis, the MDX SELECT
that sets the context off the query, an
statement uses thhe following cla
auses:
• use. This determines the que
A SELECT clau ery axes of thee displayed res ult set by using an MDX SELLECT
statement.
Bra
acketing Ob
bject Namess
So that
t MDX can interpret names, you need to t put square b brackets aroun
nd the name o of any object frrom
an OLAP
O database
e, that is, a cub
be, dimension,, hierarchy, levvel, or memberr, in the follow
wing three casees:
• If the name is the same as a keyword, such as an MDX function. For example, SELECT is an MDX
keyword, so if you have a level named SELECT, you must refer to the level as [Select].
• If the name begins with a numeric character. For example, you must refer to the member 2011 as
[2011].
If a name does not meet any of these conditions, you can still put brackets around the name, but they are
not required.
• In a Time dimension, the member Q1 might appear as a child of multiple years. Q1 for each year
would be qualified as follows: [2010].[Q1], [2011].[Q1], and so on.
• A cube could have West as a member name in the Region dimension and an employee with the
name West in the Sales Rep dimension. The two members would be qualified as follows:
Region].[West] and [Sales Rep].[West].
• If you use [Q1] as a name in a cube that includes the years 2010 and 2011, MDX interprets the name
as [2010].[Q1] because 2010 is the first occurrence in the Time dimension.
• If you use [West] in a cube that includes that member name in both the Region and the Sales Rep
dimensions, MDX interprets the name according to which of the two dimensions appears first in the
Cube Editor.
Note The slide uses SELECT, FROM, and WHERE clauses, has bracketed object names, and
qualifies names to avoid ambiguity.
MCT USE ONLY. STUDENT USE PROHIBITED
8-8 Introduction to MDX
Specifying Query
Q and Slicer Axes
• To explicitly specify
s a slicer axis, you use the
t <SELECT sslicer axis clausse> in MDX.
• If a member from
f a hierarchy within the cube
c is not ex plicitly includeed in a query aaxis, the default
member from hy is implicitly included in th e slicer axis.
m that hierarch
You
u can specify axxes by using either a name or
o an integer. FFor example, tthe query in th
he following co
ode
exam
mple uses nam mes to place daates on the co
olumn axis, cusstomer geograaphy on the ro ow axis, and sales
amoount at the inttersections.
SE
ELECT
[Measures].[
[Sales Amount
t] On COLUMNS
S,
NonEmpty([Pr
roduct Catego
ory].[Product
t Category Ke
ey].Members, [Measures].[Sales Amoun
nt])
On ROWS
FR
ROM [Adventur
re Works]
SE
ELECT
[Measures].[
[Sales Amount
t] On 0,
NonEmpty([Pr
roduct Catego
ory].[Product
t Category Ke
ey].Members, [Measures].[Sales Amoun
nt])
On 1
FR
ROM [Adventur
re Works]
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 8-9
You should define a default member before you work with slicer axes. The default member of an attribute
hierarchy is used to evaluate expressions when an attribute hierarchy is not included in a query. To avoid
name resolution problems, define the default member in the cube's MDX script in the following situations:
if the cube refers to a database dimension more than once, if the dimension in the cube has a different
name from the dimension in the database, or if you want to have different default members in different
cubes.
You should be aware that an MDX query cannot skip query axes. That is, a query that includes one or
more query axes must not exclude lower-numbered or intermediate axes. For example, a query cannot
have a ROWS axis without a COLUMNS axis or have COLUMNS and PAGES axes without a ROWS axis.
MCT USE ONLY. STUDENT USE PROHIBITED
8-10 Introductiion to MDX
Every MDX query runs within a specified cube e context. Thiss context defin
nes the membe
ers that are
evaluated by the expressions wiithin the queryy.
In th
he SELECT stattement, the FRROM clause de etermines the ccube context. Although the FROM clause
speccifies the cube
e context as within a single cube,
c you can sstill work with data from mo
ore than one cube
at a time.
In addition to spe
ecifying a compplete cube, you can also speecify a subcubee. Initially, you
u create the subcube
and then any que ery against the cube in that session
s will be limited to thee subcube. The e following MDDX
code example limmits the Budge et cube to onlyy two accountss for the sessioon.
CR
REATE SUBCUBE
E Budget AS SELECT
S {[Acco
ount].[Accoun
nt].&[4200],
[A
Account].[Acc
count].&[4300
0] } ON 0 FRO
OM Budget
WITH MEMBER ME
EASURES.LOOKU
UPCUBEARCHIVE
E AS
LO
OOKUPCUBE("Ad
dventureWorks
sArchive", "[
[Measures].[I
Internet Sale
es Amount]")
SE
ELECT MEASURE
ES.LOOKUPCUBE
EARCHIVE ON 0
FR
ROM [Adventur
re Works]
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 8-11
Note The LOOKUPCUBE function is likely to cause poor performance, and if you use it
often, you should consider a cube redesign.
The FILTER function filters the results based on a search condition. The following code example filters the
results to only display records that have a Sales Value that is greater than 1000.
Lesson 2
Adding
g Calculations to a Cu
ube
In SSAS, calculatioons include callculated memb bers and nameed sets. Calculaated memberss and named ssets
are combinations of cube data, arithmetic operators, numb bers, and functtions. In MDX, a calculated
mem mber is a mem mber that is ressolved by calcu
ulating an MD DX expression tto return a value, and a nammed
set is a set of dimension membe ers or expressions that are g
grouped togeth her for reuse in MDX queriees. The
ability to construcct and use calcculated membe ers and named d sets in an M DX query provvides a great d
deal of
man nipulation capability for multidimensional data.
• Describe how
w to add calculations to a cub
be.
• Explain the co
oncepts of calcculated memb
bers.
• Describe nam
med sets.
The
T Calcula
ations Tab of the Cube Design
ner
To
o create a calcculated membeer, use the New Calculated Member buttton on the too olbar of the
Ca
alculations ta e Designer. This command d isplays a form to specify sevveral options fo
ab of the Cube or the
ca
alculated memmber:
• Use the Scrript Editor pane in script view m view to edit script
w to edit the eentire cube script and in form
commands that the cube e script containns.
• Use the Callculated Memb
ber Form Edito
or pane in form embers in the cube
m view to edit calculated me
script.
• The de
efault dimensio
on for a calcula
ated member is the measurees dimension.
• ave the option of selecting any of the cubee dimensions in the Parent d
You ha dimension listt.
Note Th he parent mem mber does not determine thee aggregation of the calculatted member,
because ca
alculated mem mbers do not aggregate.
a Thee parent memb ber merely dicctates the
placementt of the calcula
ated member in the dimensiion hierarchy.
MCT USE ONLY. STUDENT USE PROHIBITED
8-14 Introduction to MDX
• The second region contains the Value expression box, where you enter an MDX expression. You
type the expression in the Value expression box, double-click the dimension, or drag function
values to the box.
• The third region is the metadata area. On the left is a Data list that includes all of the dimensions
in the cube. In the center is a Functions list that displays all of the MDX functions. On the right
are buttons to help you construct an MDX expression.
• The fourth region displays information about the currently selected item in the Data and
Functions lists.
• The bottom region contains standard OK, Cancel, and Help buttons.
Calculations are solved in the order that is listed in the Script Organizer pane. You can reorder the
calculations by right-clicking any calculation and then clicking Move Up or Move Down on the shortcut
menu. You can also click a calculation and then click Move Up or Move Down on the toolbar.
For best performance with cell calculations, specify only a single member when possible. The Non-empty
behavior option stores the names of measures that are used to resolve NON EMPTY queries in MDX. If
this property is blank, the calculated member must be evaluated repeatedly to determine whether a
member is empty. If this property contains the name of one or more measures, the calculated member is
treated as empty if all of the specified measures are empty. This property is an optimization hint to SSAS
to return only records that are not NULL. Returning only records that are not NULL improves the
performance of MDX queries that use the NON EMPTY operator or the NonEmpty function or that
require the calculation of cell values.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-15
Calculated
C Members
A calculated me ember is a mem mber whose value is calculatted at run time by using an MDX expression that
yo
ou specify whe en you define the calculated member. A caalculated mem mber is availab
ble to business
ntelligence (BI) applications just like any otther member.
in
Calculated memmbers do not in ncrease the sizze of the cube because only the definition
ns are stored in
n the
cu
ube; values are
e calculated in memory as re equired to answwer a query.
Although calcullated members are typically based on dataa that already exists in the cube, you can ccreate
co
omplex expresssions by comb
bining data witth arithmetic o
operators, nummbers, and fun nctions.
Th
here are two ways
w to create calculated me
embers:
2.. Session-sco
oped. A calculated member whose
w he context of tthe query and whose
scope iss wider than th
scope is the
e lifetime of th
he MDX session
n.
Na
amed Sets
A na
amed set is an
n MDX expression that return ns a set of dim
mension memb bers. You can d define named ssets
and save them as part of the cu
ube definition; you can also ccreate named sets in client aapplications.
Nam
med sets have a number of useful
u featuress:
Demonstra
D ation: Using
g Named Sets in a C
Cube
In
n this demonsttration you will create a nam
med set a brow
wse the cube ussing this name
ed set.
Task 1: De
efine a Core
e Products named set
1.. Ensure thatt the MIA-DC1
1 and MIA-SQLLBI virtual macchines are both
h running, and
d then log on tto MIA-
SQLBI as ADDVENTUREW WORKS\Studen nt with the passsword Pa$$ww0rd. Then in tthe
D:\10778A\\Demofiles\Mood08 folder, ru
un Setup.cmd d as Administraator.
3. In the Metadata pane, expand Measures, expand Reseller Sales, and then drag the Sales Amount –
Reseller Sales measure to the Drag levels or measures here to add to the query area.
4. In the Measure Group pane, expand the Product dimension, and then add the Product Category
hierarchy to the left of Sales Amount.
5. In the Measure Group pane, in the Product Category dimension, drag Accessories onto <Select
dimension>. The data now shows only sales for accessories.
Useful
U MDX
X Function
ns (Non-Fa
amily Funcctions)
CURRENTME
C EMBER
Th
he CURRENTM MEMBER functiion returns the e current mem
mber of a dimeension. You typ
pically use this with
an
nother functio
on to return a property
p of the
e current mem
mber. For exam
mple, the MDX X expression in the
fo
ollowing code example returrns the name ofo the current member in thee Product dimmension.
Product.CurrentMember.Na
ame
NAME
N
As you can see in the preceding code exam mple, the NAM E function retu urns the name e of the curren
nt
member,
m but it has other usess. The NAME function
f can reeturn the nam e of a dimensiion, level, or m
member.
Th
he syntax is exxactly the same
e and dependss entirely upon n the object th ed before the NAME
hat is reference
fu
unction.
DIMENSION,
D , HIERARCH
HY, and LEVEL
Thhe DIMENSION N, HIERARCHY
Y, and LEVEL fu
unctions return
n the current d
dimension, hie
erarchy, or leve
el. This
is often followed by the NAM
ME function to return the nam
me of the objeect.
PARALLELPE
P ERIOD
Thhe PARALLELP PERIOD functio on returns a member from th he previous peeriod with the same relative
exxpression. Therefore, if you use
u the paralleel period of Maarch 2011 at th
he Year level aand define a laag of 2
to
o go back two years, it would d return March
h 2009. You caan use the DAX X DATEADD fu unction to perfform a
similar task by using
u DAX.
NONEMPTY
NONEMPTY is a useful function because it returns the rows that are not empty from a set, as in the
following code example.
For More Information For more information about MDX functions, see “Microsoft® SQL
Server® 2008 MDX Step by Step” by Bryan C. Smith et al. (ISBN-10: 0735626189) or the
Multidimensional Expressions (MDX) Reference, at
http://go.microsoft.com/fwlink/?LinkID=246786.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-21
Useful
U MDX
X Function
ns (Family Functionss)
Within
W an OLAP P database, relationships can
n be described between diffeerent memberrs within the saame
diimension by using terms thaat are analogous to a family tree. Understaanding the relaationships thatt exist is
im
mportant. MDX X contains a wide range of fu
unctions that p
pertain to the relationships bbetween the
members
m within
n a dimension..
Exxamples includ
de:
• The PARENNT function returns the member from one level above th
he current mem
mber, as in the
e
following code example.
Product.Cu
urrentMember.Parent.Name
• The ANCES STOR function returns the member from a specified leveel above the cu urrent member, or
from a speccified number of levels abovve the current member. For eexample, you ccould use this to
return the parent,
p and this code examp evious example.
ple would retu rn the same vaalue as the pre
Ancestor(P
Product.Curre
entMember,1).Name
• The FIRSTCHILD and LASTCHILD functions return thee first or last m members respectively from th
he level
below the current
c member. For example, the first chiild of CA in thee example wou
uld be Los Ang
geles,
and the lastt child of USA would be WA
A.
MCT USE ONLY. STUDENT USE PROHIBITED
8-22 Introduction to MDX
• The FIRSTSIBLING and LASTSIBLING functions return the first or last members respectively from the
level of the current member. For example, the first sibling of San Diego in the example would be Los
Angeles and the last sibling of Los Angeles would be San Francisco.
For More Information For more information about MDX functions, see “Microsoft® SQL
Server® 2008 MDX Step by Step” by Bryan C. Smith et al. (ISBN-10: 0735626189) or the
Multidimensional Expressions (MDX) Reference, at
http://go.microsoft.com/fwlink/?LinkID=246786.
.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-23
Scoped Asssignments
Th
he SCOPE statement limits the scope of sp
pecified MDX sstatements to a specified sub
bcube.
A scoped assign
nment uses the e SCOPE comm
mand to definee a subcube. Y
You can then aapply MDX statements
to
o this subcube,, including the
e CALCULATE statement.
s u can use the TTHIS function to refer to the
You e
su
ubcube.
SC
COPE statements will create subcubes thatt expose "holees" in ragged d dimensions reg gardless of the
e MDX
Compatibility seetting. For example, the statement SCOPE (Customer.Staate.members) ccan include the e states
in
n countries or regions
r o not contain states, but forr which otherw
that do wise invisible placeholder me embers
were
w inserted.
MCT USE ONLY. STUDENT USE PROHIBITED
8-24 Introductiion to MDX
Lesson 3
Using MDX to
o Query
y a Cube
e
So far
f this module e has looked at
a MDX in SSAS S, but many MMDX statementts are used in cclient applications
to execute
e queries against the multidimensio
m nal cube. This lesson describ
bes how to use
e MDX in comm monly
usedd client applications.
Using
U MDX
X in SQL Se
erver Mana
agement SStudio
Management
M ded purely for testing purpo ses and is not intended as a user interface
Sttudio is intend e. Users
arre likely to con
nsume the resu ults of MDX qu orting Services reports or as EExcel spreadsh
ueries as Repo heets.
Management
M Sttudio cannot pass
p ers. Therefore, if you use SQLL Server Profile
paramete er to trace que
eries
ag
gainst your cube from SQL Server
S Reportin
ng Services, yo
ou must replacce the parametters with fixed d values.
In
n the illustratio
on on the slide, you can see a simple exammple of an MDX X query to retu
urn the sales vvalues
fo
or each city forr sales made in
n California. Yo
ou can use it to
o test the que ry before you deploy it in an
nother
client applicatioon.
MCT USE ONLY. STUDENT USE PROHIBITED
8-26 Introductiion to MDX
Using MDX in
i Excel
Microsoft Excel 20
010 is one of the most comm monly used clieent application
ns for SSAS multidimensionaal
cubes. By using Exxcel, you can browse
b the cub
be in an intuitiive way withou
ut the need to
o understand M
MDX
statements. Excel automatically generates the e MDX statemeents. Howeverr, if you want to inspect them
m, you
can run SQL Serveer Profiler to trrace the MDX statements th at are being eexecuted againnst your cube.
Usin
ng Excel as youur client appliccation has the benefit that uusers can interaact with the daata. They can
change which axe es dimensions appear on, the ey can filter th
he results, and they can use tthe full functio
onality
of Excel
E to modifyy the format of the output. Most
M consumeers of OLAP daata are very fam miliar with Exccel,
and using Excel ass a client provides the power of an OLAP ssolution with a familiar and powerful interrface.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-27
Using
U MDX
X in SQL Se
erver Repo
orting Servvices
When
W you are using
u SSAS datta in Reporting
g Services, it is very straightfforward to con
nfigure. You caan
simply specify Microsoft
M SQL L Server Analyysis Services aas the data typ pe when you aare creating a new
daata source and
d then specify your deployedd SSAS databaase as the dataa source.
Reeporting Services uses the saame SQL Serve er Data Tools d dialog boxes t o build a multtidimensional d data
soource as SSAS. SQL Server Da ata Tools givess you a very faamiliar view, an
nd in most insttances, you caan
simply select the measures an nd members th hat you requiree without usin ng MDX statemments. Howeve er, you
caan also click th
he Design Mode button and d then you wil l have compleete control of tthe MDX, as th he
illustration on the slide showss.
Yo
ou should be aware
a that thee output from Reporting Servvices is two-diimensional wh hereas a cube iis three-
diimensional; therefore, the re
esults go throuugh a flattenin g process. Thiss flattening prrocess results in
n
multiple-level
m dimensions
d havving a field forr each level of the dimensionn.
For More e Informationn For more in nformation abo out Reporting Services, see MModule 2,
“Implemeenting Reportss with SQL Servver Reporting Services,” Mod dule 3, “Suppoorting Self-
Service Re
eporting,” and Module 4, “Managing Repo ort Execution aand Delivery.”
MCT USE ONLY. STUDENT USE PROHIBITED
8-28 Introductiion to MDX
Lab
b Scenario
o
You
u are a BI developer for the Adventure
A Works Cycles commpany, and yo ou are creatingg a custom anaalysis
app
plication for the O). The applicattion must retu
e Chief Financce Officer (CFO urn sales data ffor products,
custtomers, and daates from the Adventure
A Wo
orks Cube, so yyou have initiaally decided to
o experiment w with
MDX syntax to qu uery the cube and
a retrieve business data.
The CFO has also asked you to extend the cub be to include m
measures for pprofit and grosss profit margin, so
you must create calculated
c mem mbers for these and ensure tthat you can in
nclude them inn queries fromm the
custtom applicatio
on you plan to build.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-29
Lab 8:
8 Using MDX
• When deployment has completed successfully, close SQL Server Data Tools.
SELECT
[Measures].[Sales Amount – Internet Sales] On 0,
NonEmpty([Product].[Product Category].[English Product Category Name].Members) On 1
FROM [Adventure Works Cube]
• Create and execute another MDX query that that displays the Internet Sales Count measure for each
English Country Region Name in the Customer Geography hierarchy.
SELECT
[Measures].[Internet Sales Count] On 0,
NonEmpty([Customer].[Customer Geography].[ English Country Region Name].Members) On
1
FROM [Adventure Works Cube]
SELECT
NonEmpty([Order Date].[Calendar Date].[Calendar Year].Members) ON COLUMNS,
[Customer].[Customer Geography].[City].Members ON ROWS
FROM [Adventure Works Cube]
WHERE [Measures].[Sales Amount - Internet Sales]
Results: After this exercise, you should have written MDX queries to return data from the Adventure
Works Cube cube.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-31
In e a calculated member to ag
n this exercise, you will create ggregate saless information aand two additiional
ca
alculated mem mbers that retu urn gross profitt margins.
Th
he main tasks for this exercisse are as follow
ws:
Task 1: De
efine a Profiit calculated
d member baased on phyysical measu
ures
• Use SQL Se
erver Data Tools to open the Adventure WWorks OLAP.ssln solution in the
D:\10778A\\Labfiles\Lab08
8\Starter\Adve
enture Works O
OLAP folder.
• On the Calcculations tab of the cube de
esigner for Addventure Worrks Cube.cube e, create a new
w
calculated member
m name ed [Profit] tha
at subtracts thee Total Produ ernet Sales measure
uct Cost – Inte
from the Saales Amount – Internet Salles measure.
• Format the calculated me ember as curreency, add the ffields used in tthe expression
n to the Non-e
empty
behavior liist, and associa
ate the calculated member wwith the Intern net Sales meaasure group. Th
he
completed calculated me ember should match the foll owing image.
MCT USE ONLY. STUDENT USE PROHIBITED
8-32 Introductiion to MDX
• Format the neew calculated member to display as a perccentage, add tthe Sales Amo ount – Interneet
Sales measurre to the Non--empty behav vior list, and asssociate the caalculated mem
mber with the
Internet Sale
es measure grooup . The completed calculaated member sshould match the following
image.
• Deploy the so
olution, overwriting the existting database and entering tthe user name
e
ADVENTURE EWORKS\Stud dent and the password
p Pa$$
$w0rd if prommpted. Then cloose SQL Serve
er Data
Tools.
Task 3: Que
ery the new calculated members
m
• In SQL Serverr Managementt Studio, create
e and execute a new MDX q
query to return
n the calculated
measures.
SELECT
{[Measures].[Profit], [Measures].[Gross Prof
fit Margin]} ON COLUMNS,
NonEmpty([Product].[Product Cate
egory].[Engli
ish Product C
Category Namee]) ON ROWS
FROM [Adventure Works Cube]
Modu
ule Reviiew and
d Takeaw
ways
Review
R Quesstions
1.. What do yo
ou use MDX qu
ueries and exp
pressions for in
n SQL Server?
Module 9
Customizing Cube Functionality
Contents:
Lesson 1: Working with Key Performance Indicators 9-3
Module Overrview
In th
his module, yo
ou will learn ho
ow to customizze cube functiionality by usin
ng several tech
hnologies avaiilable
to you
y in Microso oft® SQL Serve er® 2012 Analysis Services. C
Cubes function n perfectly well without
custtomization; ho
owever custom mization provid
des enhanced u user interfacess, automation, and translatio
on.
In th
his module, yoou will learn ab
bout Key Perfo ormance Indicaators and how w they can be uused to obtain a
quicck and accuratte historical summary of business success. You will learn about actionss and how theyy
allow end-users to o go beyond traditional analysis to initiatee solutions to d
discovered prooblems and
defiiciencies. You will
w learn abou ut perspectivess and how theyy allow users tto see the cube in a simpler way,
enabling users to focus on the most
m relevant data to them. Finally you wiill learn about translations, aand
howw they can be used
u to translaate various elements of a cu be enabling users from all oover the world can
view
w and understa and cube and dimension data.
• Implement Actions.
• Explain Persp
pectives.
• Describe Tran
nslations.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 9-3
Lesson
n1
Work
king witth Key Perform
P mance In
ndicatorrs
In
n business term
minology, a Key Performance e Indicator (KPPI) is a quantifiiable measuremment for gaugging
buusiness success. A KPI is freq
quently evaluatted over time. For example, the sales depaartment of an
orrganization maay use monthly gross profit as a KPI, but t he human reso ources department of the saame
orrganization maay use quarterrly employee turnover. Each is an examplee of a KPI. Business executive es
frequently consume KPIs thatt are grouped together
t in a b
business scoreecard to obtainn a quick and aaccurate
hiistorical summ
mary of businesss success.
After completin
ng this lesson, you
y will be able to:
• Describe KP
PIs.
• List the elem
ments of a KPII.
• Browse a KPI.
MCT USE ONLY. STUDENT USE PROHIBITED
9-4 Customizinng Cube Functionalityy
Inttroducing KPIs
In Microsoft
M SQL Server
S Analysiss Services, a Ke
ey Performancce Indicator (K KPI) is a collection of calculattions,
which are associatted with a meaasure group in n a cube, that aare used to evvaluate businesss success. Thee KPI
meaasures the valu
ues in the cube
e against a goa al. The KPI can
n also evaluatee the values ovver time to pro ovide
tren
nd informationn.
To provide
p at-a-g
glance compan ny performance to business u users, there is an MDX expre ession that returns a
status between -1 1 (worst) and +1+ (best). The presentation
p o
of this data is uultimately up tto the client
appplication. Howe ever status andd trend indicattors can be sett to suggest th he graphical ouutput. For exam mple,
you have created a company pe erformance da ashboard to di splay KPI dataa on a SharePo oint site. On the
SharePoint site, a status of -1.0 to -0.34 displa
ays a red trafficc light, a statu +0.33 displays an
us of -0.33 to +
ambber traffic lightt and a status of +0.34 to +11.0 displays a g
green traffic ligght.
Elements of
o a KPI
Value
V
A value expression is a physiccal measure such as Sales, a calculated meeasure such as Profit, or a
ca MDX) expression.
alculation that is defined witthin the KPI byy using a Multiidimensional EExpressions (M
Goal
G
A goal expressio
on is a value, or
o an MDX exp nes the target for the
pression that reesolves to a vaalue, that defin
measure
m that th
he value expression defines. For example, tthe following g goal expressioon for a Profit
measure
m has a value
v of 0.6 (or 60%) for Acccessories and 0.3 (30%) for aall other categ gories:
Case
When [Product].[Cate
egory].Curren
ntMember Is
[Product].[Categor
ry].[Accessor
ries]
Then .60
Else .30
End
MCT USE ONLY. STUDENT USE PROHIBITED
9-6 Customizing Cube Functionality
Status
A status expression is an MDX expression that Analysis Services uses to evaluate the current status of the
value expression compared to the goal expression with a result in the range of -1 to +1. -1 is the worst
result, and +1 is the best result. The status expression displays with a graphic to help you easily determine
the status of the value expression compared to the goal expression. For example, the following code
returns a value of 1 if you achieve the goal, a value of 0 if you are at least half way to achieving the goal,
and a value of -1 if you are less than halfway to achieving the goal:
Case
When KpiValue( "Gross Profit Margin" ) /
KpiGoal ( "Gross Profit Margin" ) >= 1
Then 1
When KpiValue( "Gross Profit Margin" ) /
KpiGoal ( "Gross Profit Margin" ) < 0.5
Then -1
Else 0
End
Trend
A trend expression is an MDX expression that Analysis Services uses to evaluate the current trend of the
value expression compared to the goal expression. The trend expression helps the business user to quickly
determine whether the value expression is getting better or worse relative to the goal expression. You can
associate one of several graphics with the trend expression to help business users be able to quickly
understand the trend. For example, the following code returns a value of 1 if the Gross Profit Margin is
increasing over the last year, -1 if it is decreasing, and 0 if it is the same:
Case
When KpiValue( "Gross Profit Margin" ) >
(KpiValue( "Gross Profit Margin" ),
ParallelPeriod
( [Date].[Fiscal Time].[Fiscal Year], 1,
[Date].[Fiscal Time].CurrentMember ))
Then 1
When KpiValue( "Gross Profit Margin" ) <
(KpiValue( "Gross Profit Margin" ),
ParallelPeriod
( [Date].[Fiscal Time].[Fiscal Year], 1,
[Date].[Fiscal Time].CurrentMember ))
Then -1
Else 0
End
• Display Folder. This is the folder in which the KPI will appear if you are browsing the cube.
• Parent KPI. This defines the parent of the current KPI. This causes the browser to display the KPI as a
child and also allows the parent to access the values of the child. This allows you to have KPIs based
on other KPIs. You can also apply a Weight to adjust the importance of a child KPI against its siblings.
• Current Time Member. This is an MDX expression that defines the current time member for the KPI.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 9-7
Browsing
B KPIs
K
A key advantage of KPIs in An nalysis Servicess is that they aare server-baseed and are con nsumable by d different
client applicatio
ons. Being servver-based enab bles all of the llogic to be bu ilt in Analysis SServices and sttored
with
w the cube. However,
H it is possible
p for client applicatioons to apply the same logic aagainst the cub be data
ussing MDX expressions. You can c use MDX functions
f in cliient applicatio
ons to retrieve individual secttions of
th
he KPI, such as the value or goal,
g for use in
n MDX expresssions, statemen nts, and scriptss.
It should be notted that the in a defined in SQL Server Daata Tools may or may not be
ndicators that are e
im
mplemented by client applications. Third party
p plications might not display the indicatorss that
client app
yoou have define
ed and you sho ould verify tha
at the KPI disp lays correctly.
De
emonstration: Using KPIs
Task 1: Crea
ate a KPI
1. Ensure that th
he MIA-DC1 and MIA-SQLBII virtual machiines are both rrunning, and then log on to MIA-
SQLBI as ADV VENTUREWORKS\Student with the passw word Pa$$w0rd. Then in the
D:\10778A\Demofiles\Mod09 folder, run Setup.cmd a s Administrato or.
3. In the Solutio
on Explorer panne, right-click Adventure WWorks OLAP, aand then click Deploy. If
prompted, sp pecify the passw
word Pa$$w0 0rd and click O
OK.
4. After deploym
ment is comple ete, in Solution
n Explorer righ
ht-click Adven
nture Works C
Cube.cube, click
Open, and thhen click the KPIs tab.
5. ar of the KPIs tab, click New
On the toolba w KPI.
8. On the Metadata tab in the Calculation Tools pane, expand Measures, expand Sales Quota, and
then drag the Sales Amount Quota measure to the Goal Expression box.
9. Verify that Gauge is selected in the Status indicator list, and then type the following MDX expression
in the Status expression box (you can copy this from KPI Status Expression.txt in the demo folder):
Case
When
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")>=.95
Then 1
When
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")<.95
And
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")>=.5
Then 0
Else -1
End
10. Verify that Standard arrow is selected in the Trend indicator list, and then type the following
expression in the Trend expression box (you can copy this from KPI Trend Expression.txt in the
demo folder):
Case
When IsEmpty
(ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
Then 0
When (
KpiValue("Reseller Revenue") -
(KpiValue("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
/
(KpiValue ("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember)))
>=.02
Then 1
When(
KpiValue("Reseller Revenue") -
(KpiValue ( "Reseller Revenue" ),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
/
(KpiValue("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember)))
<=.02
Then -1
Else 0
End
MCT USE ONLY. STUDENT USE PROHIBITED
9-10 Customizing Cube Functionality
2. In SQL Server Data Tools, on the Build menu of, click Deploy Adventure Works OLAP.
3. When deployment has successfully completed, click Browser View on the toolbar of the KPIs tab,
and then click Reconnect.
4. In the top pane of the KPI browser, click Sales Territory (not Customer – Sales Territory) in the
Dimension list, click Sales Territory Key in the Hierarchy list, and then click Equal in the Operator
list.
5. In the Filter Expression list, expand All, select 1, 2, 3, 4, and 5, and then click OK.
6. Click anywhere in the KPI Browser pane to update the values for the Reseller Revenue KPI.
Lesson
n2
Work
king witth Actio
ons
In
n Microsoft SQQL Server Analyysis Services, an action is a sttored MDX staatement that can be presented to
annd employed byb client applications. In oth nt command that is defined and
her words, an aaction is a clien
sttored on the se
erver.
After completin
ng this lesson, you
y will be able to:
• Describe acctions.
• List the types of actions.
• Implement actions.
MCT USE ONLY. STUDENT USE PROHIBITED
9-12 Customizing Cube Functionaliity
Inttroducing Actions
An action
a is a storred statement that can be prresented to an nd employed b by client appliccations enablinng
business users to act upon the outcomes
o of th
heir analyses. TThe action is s tored in the A
Analysis Servicees
data
abase and it is important to verify that the e client applicaation supports actions and th hat the client
app
plication correcctly carries outt the events off the action.
Targ
get type could d be level mem mbers, cells, hie
erarchy, hierarcchy members, or others. The e target objectt is a
speccific object of the target type. For example e, if the target type is hierarcchy, then the ttarget object is any
one
e of the defined d hierarchies in the cube.
By saving
s and reu
using actions, end
e users can go g beyond traaditional analyysis, which typically ends with
h
pressentation of da
ata, and initiatte solutions to discovered prroblems and ddeficiencies, the
ereby extendinng
the business intellligence applicaation beyond the
t cube.
Youu can exercise flexibility
f n you create actions: for exaample, an actio
when on can launch an application
n,
retrieve information from a data abase, or openn a webe-maip page in a browwser.
Actiions can be co
onfigured to be e triggered fro
om almost anyy part of a cubee, including diimensions, leve
els,
memmbers, and cellls, or create multiple
m actionss for the same portion of a ccube.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-13
Types
T of Acctions
Actions can be of different types and have to t be created accordingly. TTypically actionns pass an attribute of
th
he current objeect enabling th
hem to be dyn namic. For exammple, you couuld create a URRL action that ddisplays
th
he location of a customer on n a map. To creeate this action
n, you can sim
mply open Bing g Maps and search for
an
ny postal codee. If you then click
c ng will generatte a URL contaaining the postal code. You ccan
Share, Bin
th
hen remove the postal code and concatenate the originaal URL with
Customers].CurrrentMember.Postalcode. Th
[C he above illust ration demonsstrates the exaample.
Th
he following ta
able lists the tyypes of actionss and how theey are used.
Action
A Type Descriiption
Standard - Da
ataset Returns a dataset to
o a client application.
Standard - Prroprietary Performs an operattion by using aan interface other than those
e listed
in thiss table.
Standard - Ro
owset Returns a rowset to
o a client appliccation.
Standard - Sta
atement Runs an OLE DB com
mmand.
Standard - UR
RL Displa
ays a dynamic webpage in aan Internet bro
owser.
• Attribute
e members
• Cells
• Cube
• Dimensio
on members
• Hierarchyy
• Hierarchyy members
• Level
• Level me
embers
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 9-15
Type Description
Proprietary Performs an operation by using an interface other than those listed here.
Property Description
Invocation Specifies how the action is run. Interactive, the default, specifies that the
action is run when a user accesses an object. The possible settings are:
• Batch
• Interactive
• On Open
Caption Provides a caption that is displayed for the action. If the caption is
generated dynamically by an MDX statement, specify True for Caption is
MDX.
To create a new drillthrough action, on the Cube menu, click New Drillthrough Action and then specify
the drillthrough columns required by the action.
To create a reporting action, on the Cube menu, click New Reporting Action, and then specify the
Server name, Server path, and Report format values.
Note For Server path, specify the path to the report on Reporting Services. For example,
AdventureWorks/YearlyInternetSales. For Report format select HTML5, HTML3, Excel, or
PDF based on the client tool your users are most likely to use to access your report.
MCT USE ONLY. STUDENT USE PROHIBITED
9-16 Customizing Cube Functionaliity
Lesson 3
Workin
ng with
h Perspe
ectives
Cubbes can be veryy complex objects for users to t explore in MMicrosoft SQL Server Analysiis Services. A ssingle
cube can represen nt the contents of a complette data wareho ouse, with multiple measure e groups in a cube
reprresenting multtiple fact table
es, and multiple e dimensions based on multtiple dimensio on tables. Such a
cube can be very complex and powerful, but daunting to u sers who may only need to interact with a
smaall part of the cube
c in order to
t satisfy theirr business intellligence and reeporting requiirements.
In Microsoft
M SQL Server
S u can use a perrspective to reeduce the perceived complexxity of
Analysiss Services, you
a cu
ube in Analysiss Services.
• Describe persspectives.
• Implement pe
erspectives.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-17
Introdu
ucing Persp
pectives
A perspective enables administrators to create views of a cube, helping g users to focus on the most
re
elevant data. Although
A cubes are much mo o navigate than relational daatabases, they can
ore intuitive to
ecome very large with severral measure gro
be oups, many m measures, and nnumerous dim mensions. Persppectives
do
o not cause anny additional processing
p ove
erhead. Therefo ore, you can ccreate perspecttives for each vview of
th
he data require
ed by users.
A simple perspeective object iss composed off: basic informaation, dimensiions, measure groups, calcullations,
KPIs, and action
ns. Each of these properties defines
d a subseet of the cubee as follows:
• Basic inform
mation include nd the default measure of th
es the name an he perspective.
Objects
O in a cub e user through a perspective can still be directly referencced and
be that are nott visible to the
re
etrieved using XML for Analyysis (XMLA), Multidimension
M al Expressionss (MDX), or Data Mining Exte ensions
(D
DMX) statemen nts.
Pe
erspectives do nd should not be used as succh; instead,
o not restrict acccess to objectts in a cube an
pe
erspectives are
e used to provvide a better usser experiencee while accessing a cube.
MCT USE ONLY. STUDENT USE PROHIBITED
9-18 Customizing Cube Functionaliity
Cre
eating a Pe
erspective
e
You
u can add a perspective to th
he Perspectivess tab by:
• Clicking New
w Perspective on the Cube menu.
m
• Right-clicking
g any cell in th
he perspective you want to d
delete, and theen clicking Dellete Perspectiive on
the shortcut menu.
m
Wheen you create a perspective, the name is innitially Perspecctive (followed
d by an ordinal number, startting
with
h 1, if there is already
a a persp
pective named
d Perspective).. You can clickk the name to e
edit it.
To hide
h an object from a perspe
ective, clear th
he check box in
n the row that corresponds tto the object in the
colu
umn for the pe
erspective.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-19
Lesson
n4
Work
king witth Transslations
Multilanguage
M support
s in Miccrosoft SQL Se
erver Analysis SServices is acco
omplished by using translations. In
th
his lesson, you will be introdu oncepts involveed in using traanslations and discuss how to
uced to the co
im
mplement cube e translations and dimension n translations.
• Describe tra
anslations.
• Implement cube translations.
Inttroducing Translatio
ons
A trranslation is a simple
s mechan nism to change the displayeed labels and ccaptions from o one language to
ano
other. It is usefuul to be able to o a different laanguage so that
o translate varrious elementss of a cube into
thesse users can view and understand the cube e's metadata. TTranslations a re available fo
or all objects in
n
Anaalysis Services. You can also use
u a translatioon to display aan alternative ccolumn. There efore, if you haave
dataa in multiple laanguages, a diifferent column could be dissplayed for an attribute in eaach language.
In Microsoft
M SQL Server
S Analysiss Services, a cu n is a languagee-specific representation of the
ube translation
namme of a cube object, such as a caption or a display folderr. There is no aautomatic trannslation
funcctionality and you must provvide every required label in eevery requiredd language.
Tran
nslations proviide server suppport for client applications th
hat can suppoort multiple lan
nguages, howe
ever, if
the client applicattion does not support
s transla
ations, the Deffault laanguag
ge is displayedd.
The collation and language infoormation for th
he client compputer is stored in the form off a locale identifier
(LCID). The follow
wing process ta
akes place wheen a client con nects to the cu
ube:
Im
mplementting Cube Translations
Yo
ou can define the following parts of a cub
be translation:
• Default Language: Sets the names of the cube obje cts in the defaault language.
• Object Typ
pe: Displays the property tha
at will be transslated.
• <Language
e>: Type the value
v of the prroperty for thee cube object iin the selected
d language.
MCT USE ONLY. STUDENT USE PROHIBITED
9-22 Customizing Cube Functionaliity
Implementin
ng Dimenssion Transllations
You
u can define th
he following pa
arts of a dimen
nsion translatio
on:
• Default Lang
guage: Sets the names of the dimension o
objects in the d
default languaage.
• Object Type:: Displays the property that will be translatted.
Youu can also transslate member names by specifying anotheer column in th he dimension table that con ntains
nslated values. Select New Caption Colum
tran mn to display tthe Attribute Data Translattion dialog bo ox and
defiine a new capttion column when
w you modiify an attributee in the Transllation Detailss grid. For exam
mple,
you could specify a caption colu
umn of Frenchh Month Nam me for the Mon nth attribute o
of the Time
dim
mension. You ca an use the Edit Caption Collumn and Del ete Caption C Column butto ons to modify o or
ete caption columns.
dele
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-23
Lab Scenario
In
nformation workers in the sales departmen nt at Adventurre Works Cyclees currently use e the cube youu have
crreated to perfoorm analysis of sales data. Se
everal users haave expressed a desire to be able to view
agggregated sale es figures in Microsoft
M ®, and then q uickly drill-thrrough to see d
Excel® details of speciffic
orrders for a give
en aggregatio on – for exampple, when viewiing the sales to otal for bikes iin 2003, the ussers
want
w to be able
e to quickly generate a secon nd Excel workssheet that show ws details of the customer, location,
daate, and individual product for
f each bike sale
s in that yeaar.
Additionally, some sales userss are finding th omplex for theeir needs. Thesse users typically only
he cube too co
ne
eed to analyzee sales amountt by customer, and would likke to be able tto view only th
he measures an nd
diimensions required to suppo ort this require
ement.
Lab 9: Custom
mizing a Cube
Exe
ercise 1: Im
mplementiing an Acttion
Sce
enario
Info
ormation workers in the saless department at Adventure W Works Cycles ccurrently use tthe cube you h have
crea
ated to perform
m analysis of sales
s data. Seveeral users havee expressed a d desire to be abble to view
agggregated sales figures in Exce
el, and then quuickly drill-thro
ough to see deetails of speciffic orders for a
give
en aggregationn – for examplle, when viewing the sales to otal for bikes in
n 2003, the ussers want to bee able
to quickly
q generatte a second Exxcel worksheett that shows deetails of the cu ustomer, location, date, and
individual product for each bikee sale in that year.
y
The main tasks for this exercise are as follows:
1. Prepare the la
ab environmen
nt.
Task 1: Prep
pare the lab
b environment
• he MIA-DC1 and MIA-SQLBII virtual machiines are both rrunning, and then log on to MIA-
Ensure that th
SQLBI as ADV VENTUREWORKS\Student with the passw word Pa$$w0rd.
Task 2: De
eploy an OLLAP database
e
• Use SQL Se
erver Data Tools to open the Adventure W Works OLAP.ssln solution in the
D:\10778A\\Labfiles\Lab09 er. Then deployy the solution,, entering the user name
9\Starter folde
ADVENTUREWORKS\Student and the e password Paa$$w0rd if pro ompted.
• Process the
e solution.
Dimen
nsion Returrn Columns
Custo
omer Engl ish Country R
Region Name
e and Full Nam
me
Produ
uct Engl ish Product N
Name
Task 4: Brow
wse a drillth
hrough actio
on
• In SQL Serverr Data Tools, on the Browser tab of the cu ube designer fo
or Adventure
e Works
Cube.cube, click
c the Analyyze in Excel icon to create a Microsoft Exccel workbook w
with a connecttion
to cube. If a security
s notice is displayed, click
c Enable.
• When you have viewed the order details returned by the drillthrough action, close Excel without
saving your changes, and keep SQL Server Data Tools open for the next exercise.
Results: After this exercise, you should have defined a drillthrough action.
MCT USE ONLY. STUDENT USE PROHIBITED
9-28 Customizing Cube Functionaliity
Exe
ercise 2: Im
mplementiing a Persp
pective
Sce
enario
Som
me sales users are
a finding the e cube too com
mplex for theirr needs. Thesee users typicallyy only need to
o
analyze sales amo
ount by custom mer, and would
d like to be ab
ble to view onlyy the measure es and dimensiions
requ
uired to suppo
ort this require
ement.
Cube Ob
bject Object Type
Sales Am
mount – Interrnet Sales Measure in tthe Internet S
Sales Measure
eGroup
Custom
mer CubeDimen sion
• On the Browser tab of the cube designer for Adventure Works Cube.cube, reconnect to the cube
and if necessary, clear any existing values from the data grid and filter areas.
• In the Cube Selection area above the Metadata pane, select the Sales Summary perspective, and
browse the cube, noting that only the Sales Amount – Internet Sales measure and Customer
dimension are available.
• In the Cube Selection area, select the Adventure Works Cube perspective, and note that all
measures and dimensions defined in the cube are available.
• Keep SQL Server Data Tools open for the next exercise.
Results: After this exercise, you should have defined a perspective and browsed the cube using the new
perspective.
MCT USE ONLY. STUDENT USE PROHIBITED
9-30 Customizing Cube Functionality
In this exercise you will add the final enhancement to the revenue information cube by specifying
translations for the French speakers in your company.
• For the Caption object of the Date dimension, under the French (France) column, enter Date.
• For the Caption object of the Month Number of Year attribute, under the French (France) column,
enter Mois d'Année.
Tip To type é hold the Alt key and type 130 using the number pad on your keyboard
ensuring NumLock is turned on. If this is not possible type the captions without accents.
• Click the ellipses for the French Mois d'Année attribute and modify the attribute data translation to
use the FrenchMonthName column as shown in the following image.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-31
Task 2: Sp
pecify translations for th
he Adventurre Works cube metadataa
• On the Translations tab of the cube designer for Ad dventure Worrks Cube.cube
e, create a new
w
French (Fra
ance) translatiion with the fo
ollowing captio
on translationss.
• Interne
et Sales measure group: Ve
entes d'Intern
net.
• Sales Amount
A ernet Sales measure: Vente
– Inte es Total.
MCT USE ONLY. STUDENT USE PROHIBITED
9-32 Customizing Cube Functionaliity
Task 3: Brow
wse the cub
be using the new translaations
• Deploy the so
olution, enterin
ng the user na
ame ADVENTU
UREWORKS\S
Student and th
he password
Pa$$w0rd if prompted.
• On the Browwser tab of the cube designer for Adventu ure Works Cub be.cube, reconnect to the cube
and if necessa
ary, clear any existing
e valuess from the dataa grid and filteer areas.
• Select French
h (France) in the Language list.
• Browse the cu
ube to show th
he Ventes Tottal measure in
n the Ventes d
d’Internet meaasure group
aggregated by
b the Order Date.Mois
D d’A
Année hierarch hy.
Modu
ule Reviiew and
d Takeaw
ways
Review
R Quesstions
1.. How are KP
PIs useful to th
he business?