0% found this document useful (0 votes)
65 views198 pages

10778A-ENU-TrainerHandbook-Part 2

Uploaded by

vpuerta.h3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views198 pages

10778A-ENU-TrainerHandbook-Part 2

Uploaded by

vpuerta.h3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 198

MCT USE ONLY.

STUDENT USE PROHIBITED


O F F I C I A L M I C R O S O F T L E A R N I N G P R O D U C T

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.

Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty


/Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other trademarks are
property of their respective owners

Product Number: 10778A

Part Number: X18-29140

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.

a. If you are a Authorized Learning Center:


i. If the Licensed Content is in digital format for each license you acquire you may either:
1. install one (1) copy of the Licensed Content in the form provided to you on a dedicated, secure
server located on your premises where the Authorized Training Session is held for access and
use by one (1) End User attending the Authorized Training Session, or by one (1) MCT teaching
the Authorized Training Session, or
2. install one (1) copy of the Licensed Content in the form provided to you on one (1) Classroom
Device for access and use by one (1) End User attending the Authorized Training Session, or by
one (1) MCT teaching the Authorized Training Session.
ii. You agree that:
1. you will acquire a license for each End User and MCT that accesses the Licensed Content,
2. each End User and MCT will be presented with a copy of this agreement and each individual
will agree that their use of the Licensed Content will be subject to these license terms prior to
their accessing the Licensed Content. Each individual will be required to denote their
acceptance of the EULA in a manner that is enforceable under local law prior to their accessing
the Licensed Content,
3. for all Authorized Training Sessions, you will only use qualified MCTs who hold the applicable
competency to teach the particular MOC Course that is the subject of the training session,
4. you will not alter or remove any copyright or other protective notices contained in the
Licensed Content,
MCT USE ONLY. STUDENT USE PROHIBITED
5. you will remove and irretrievably delete all Licensed Content from all Classroom Devices and
servers at the end of the Authorized Training Session,
6. you will only provide access to the Licensed Content to End Users and MCTs,
7. you will only provide access to the Trainer Content to MCTs, and
8. any Licensed Content installed for use during a training session will be done in accordance
with the applicable classroom set-up guide.

b. If you are a MPN Member.


i. If the Licensed Content is in digital format for each license you acquire you may either:
1. install one (1) copy of the Licensed Content in the form provided to you on (A) one (1)
Classroom Device, or (B) one (1) dedicated, secure server located at your premises where
the training session is held for use by one (1) of your employees attending a training session
provided by you, or by one (1) MCT that is teaching the training session, or
2. install one (1) copy of the Licensed Content in the form provided to you on one (1)
Classroom Device for use by one (1) End User attending a Private Training Session, or one (1)
MCT that is teaching the Private Training Session.
ii. You agree that:
1. you will acquire a license for each End User and MCT that accesses the Licensed Content,
2. each End User and MCT will be presented with a copy of this agreement and each individual
will agree that their use of the Licensed Content will be subject to these license terms prior
to their accessing the Licensed Content. Each individual will be required to denote their
acceptance of the EULA in a manner that is enforceable under local law prior to their
accessing the Licensed Content,
3. for all training sessions, you will only use qualified MCTs who hold the applicable
competency to teach the particular MOC Course that is the subject of the training session,
4. you will not alter or remove any copyright or other protective notices contained in the
Licensed Content,
5. you will remove and irretrievably delete all Licensed Content from all Classroom Devices and
servers at the end of each training session,
6. you will only provide access to the Licensed Content to End Users and MCTs,
7. you will only provide access to the Trainer Content to MCTs, and
8. any Licensed Content installed for use during a training session will be done in accordance
with the applicable classroom set-up guide.

c. If you are an End User:


You may use the Licensed Content solely for your personal training use. If the Licensed Content is in
digital format, for each license you acquire you may (i) install one (1) copy of the Licensed Content in
the form provided to you on one (1) Personal Device and install another copy on another Personal
Device as a backup copy, which may be used only to reinstall the Licensed Content; or (ii) print one (1)
copy of the Licensed Content. You may not install or use a copy of the Licensed Content on a device
you do not own or control.
MCT USE ONLY. STUDENT USE PROHIBITED
d. If you are a MCT.
i. For each license you acquire, you may use the Licensed Content solely to prepare and deliver an
Authorized Training Session or Private Training Session. For each license you acquire, you may
install and use one (1) copy of the Licensed Content in the form provided to you on one (1) Personal
Device and install one (1) additional copy on another Personal Device as a backup copy, which may
be used only to reinstall the Licensed Content. You may not install or use a copy of the Licensed
Content on a device you do not own or control.

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.3 Reproduction/Redistribution Licensed Content. Except as expressly provided in the applicable


installation and use rights above, you may not reproduce or distribute the Licensed Content or any portion
thereof (including any permitted modifications) to any third parties without the express written permission
of Microsoft.

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.

13. APPLICABLE LAW.


a. United States. If you acquired the Licensed Content in the United States, Washington state law governs
the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws
principles. The laws of the state where you live govern all other claims, including claims under state
consumer protection laws, unfair competition laws, and in tort.

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.

LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous


pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement
à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y
compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne:
• tout ce qui est relié au le contenu sous licence , aux services ou au contenu (y compris le code)
figurant sur des sites Internet tiers ou dans des programmes tiers ; et
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité
stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.

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.

Revised March 2012


MCT USE ONLY. STUDENT USE PROHIBITED
xiv Implementing Data Models and Reports with Microsoft® SQL Server® 2012
MCT USE ONLY. STUDENT USE PROHIBITED
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 xv

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.

Graeme Malcolm – Lead Content Developer


Graeme Malcolm is a Microsoft SQL Server subject matter expert and professional content developer at
Content Master—a division of CM Group Ltd. As a Microsoft Certified Trainer, Graeme has delivered
training courses on SQL Server since version 4.2; as an author, Graeme has written numerous books,
articles, and training courses on SQL Server; and as a consultant, Graeme has designed and implemented
business solutions based on SQL Server for customers all over the world.

Geoff Allix – Content Developer


Geoff Allix is a Microsoft SQL Server subject matter expert and professional content developer at Content
Master—a division of CM Group Ltd. Geoff is a Microsoft Certified IT Professional for SQL Server with
extensive experience in designing and implementing database and BI solutions on SQL Server
technologies, and has provided consultancy services to organizations seeking to implement and optimize
data warehousing and OLAP solutions.

Martin Ellis – Content Developer


Martin Ellis is a Microsoft SQL Server subject matter expert and professional content developer at Content
Master—a division of CM Group Ltd. Martin is a Microsoft Certified Technical Specialist on SQL Server and
an MCSE. He has been working with SQL Server since version 7.0, as a DBA, consultant and Microsoft
Certified Trainer, and has developed a wide range of technical collateral for Microsoft Corp. and other
technology enterprises.

Chris Testa-O’Neill – Technical Reviewer


Chris Testa-O’Neill is a Senior Consultant at Coeo (www.coeo.com), a leading provider of SQL Server
Managed Support and Consulting in the UK and Europe. He is also a Microsoft Certified Trainer, Microsoft
Most Valuable Professional for SQL Server, and lead author of Microsoft E-Learning MCTS courses for SQL
Server 2008. Chris has spoken at a range of SQL Server events in the UK, Europe, Australia and the United
States. He is also one of the organizers of SQLBits, SQLServerFAQ and a UK Regional Mentor for SQLPASS.
You can contact Chris at [email protected] , @ctesta_oneill or through his blog at
http://www.coeo.com/sql-server-events/sql-events-and-blogs.aspx
MCT USE ONLY. STUDENT USE PROHIBITED
xvi Implementing Data Models and Reports with Microsoft® SQL Server® 2012

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 2: Implementing Reports with SQL Server Reporting Services


Lesson 1: Introduction to Reporting Services 2-3
Lesson 2: Creating a Report with Report Designer 2-12
Lesson 3: Grouping and Aggregating Data in a Report 2-24
Lab 2A: Creating a Report with Report Designer 2-35
Lesson 4: Showing Data Graphically 2-42
Lesson 5: Filtering Reports By Using Parameters 2-56
Lesson 6: Publishing and Viewing a Report 2-64
Lab 2B: Enhancing and Publishing a Report 2-71

Module 3: Supporting Self Service Reporting


Lesson 1: Introduction to Self Service Reporting 3-3
Lesson 2: Shared Data Sources and Datasets 3-11
Lesson 3: Report Parts 3-22
Lab 3: Implementing Self Service Reporting 3-32

Module 4: Managing Report Execution and Delivery


Lesson 1: Managing Report Security 4-3
Lesson 2: Managing Report Execution 4-10
Lesson 3: Subscriptions and Data Alerts 4-17
Lesson 4: Troubleshooting Reporting Services 4-31
Lab 4: Configuring Report Execution and Delivery 4-37

Module 5: Creating Multidimensional Databases


Lesson 1: Introduction to Multidimensional Analysis 5-4
Lesson 2: Creating Data Sources and Data Source Views 5-15
Lesson 3: Creating a Cube 5-21
Lesson 4: Overview of Cube Security 5-28
Lab 5: Creating a Multidimensional Database 5-39

Module 6: Working with Cubes and Dimensions


Lesson 1: Configuring Dimensions 6-3
Lesson 2: Defining Attribute Hierarchies 6-12
Lesson 3: Sorting and Grouping Attributes 6-21
Lab 6: Defining Dimensions 6-25
MCT USE ONLY. STUDENT USE PROHIBITED
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 xvii

Module 7: Working with Measures and Measure Groups


Lesson 1: Working with Measures 7-3
Lesson 2: Working with Measure Groups 7-10
Lab 7: Configuring Measures and Measure Groups 7-24

Module 8: Introduction to MDX


Lesson 1: MDX Fundamentals 8-3
Lesson 2: Adding Calculations to a Cube 8-12
Lesson 3: Using MDX to Query a Cube 8-24
Lab 8: Using MDX 8-29

Module 9: Customizing Cube Functionality


Lesson 1: Working with Key Performance Indicators 9-3
Lesson 2: Working with Actions 9-11
Lesson 3: Working with Perspectives 9-16
Lesson 4: Working with Translations 9-19
Lab 9: Customizing a Cube 9-24

Module 10: Implementing a Tabular Data Model with Microsoft PowerPivot


Lesson 1: Introduction to Tabular Data Models and PowerPivot
Technologies 10-3
Lesson 2: Creating a Tabular Data Model by Using PowerPivot for Excel 10-13
Lesson 3: Sharing a PowerPivot Workbook and Using PowerPivot Gallery 10-26
Lab 10: Using PowerPivot for Excel 10-32

Module 11: Introduction to DAX


Lesson 1: DAX Fundamentals 11-3
Lesson 2: Using DAX to Create Calculated Columns and Measures in a
Tabular Data Model 11-15
Lab 11: Creating Calculated Columns and Measures by Using DAX 11-29

Module 12: Implementing an Analysis Services Tabular Data Model


Lesson 1: Introduction to Analysis Services Tabular Data Model Projects 12-3
Lesson 2: Developing an Analysis Services Tabular Data Model in
SQL Server Data Tools 12-13
Lab 12: Working with an Analysis Services Tabular Data Model 12-27

Module 13: Creating Data Visualizations with Power View


Lesson 1: Introduction to Power View 13-3
Lesson 2: Visualizing Data with Power View 13-10
Lab 13: Creating Interactive Reports with Power View 13-25
MCT USE ONLY. STUDENT USE PROHIBITED
xviii Implementing Data Models and Reports with Microsoft® SQL Server® 2012

Module 14: Performing Predictive Analysis with Data Mining


Lesson 1: Overview of Data Mining 14-3
Lesson 2: Creating a Data Mining Solution 14-13
Lesson 3 Validating a Data Mining Model 14-19
Lesson 4: Consuming Data Mining Data 14-26
Lab 14: Using Data Mining to Support a Marketing Campaign 14-34

Appendix: Lab Answer Keys


Module 1 Lab: Reporting and Analyzing Data L1-1
Module 2 Lab A: Creating a Report with Report Designer L2-5
Module 2 Lab B: Enhancing and Publishing a Report L2-11
Module 3 Lab: Implementing Self Service Reporting L3-21
Module 4 Lab: Configuring Report Execution and Delivery L4-29
Module 5 Lab: Creating a Multidimensional Database L5-35
Module 6 Lab: Defining Dimensions L6-43
Module 7 Lab: Configuring Measures and Measure Groups L7-51
Module 8 Lab: Using MDX L8-57
Module 9 Lab: Customizing a Cube L9-61
Module 10 Lab: Using PowerPivot for Excel L10-65
Module 11 Lab: Creating Calculated Columns and Measures by
Using DAX L11-75
Module 12 Lab: Working with an Analysis Services Tabular Data Model L12-81
Module 13 Lab: Creating Interactive Reports with Power View L13-91
Module 14 Lab: Using Data Mining to Support a Marketing Campaign L14-97
MCT USE ONLY. STUDENT USE PROHIBITED
5-1

Module 5
Creating Multidimensional Databases
Contents:
Lesson 1: Introduction to Multidimensional Analysis 5-4

Lesson 2: Creating Data Sources and Data Source Views 5-15

Lesson 3: Creating a Cube 5-21


Lesson 4: Overview of Cube Security 5-28

Lab 5: Creating a Multidimensional Database 5-39


MCT USE ONLY. STUDENT USE PROHIBITED
5-2 Creating Multidimensional Dataabases

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.

A simple example e could have a Sales Value measure


m and T
Time, Productt, and Custom mer dimensionss. You
can navigate the dimensions
d to find the total sales value fo r the previous month, a speccific customer,, and
a pa
articular produ
uct.

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.

Thiss module provides an introduction to multtidimensional databases and


d introduces th
he core compo
onents
of an
a OLAP cube.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5-3

After completing this module, you will be able to:

• Describe the considerations for a multidimensional database.

• Create data sources and data source views.

• Create a cube.

• Implement security in a multidimensional database.


MCT USE ONLY. STUDENT USE PROHIBITED
5-4 Creating Multidimensional Dataabases

Lesson 1
Introduction to
t Multtidimen
nsional A
Analysiss

Mulltidimensional analysis that uses


u OLAP reqquires the creattion of OLAP ccubes alongsid de data source
es and
a source viewss. This lesson describes data sources, data ssource views, aand the core ccomponents off a
data
cube: dimensions,, measures, and measure gro oups.

Afte
er completing this lesson, yo
ou will be able to:

• Identify the business


b proble
ems that multiidimensional aanalysis addressses.
• Describe the core concepts of multidimen
nsional analys is.

• 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.

• Identify the software requirrements for multidimensionaal analysis.


MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 5-5

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.

• Large queriies can cause performance


p isssues for transsactional workloads.

• Normalized
d relational datta models are not intuitive ffor business ussers.
MCT USE ONLY. STUDENT USE PROHIBITED
5-6 Creating Multidimensional Dataabases

The Conceptts of Multidimension


nal Analysis

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.

The dimensions enable you to drill


d down thro ough different layers of dataa by using a hie
erarchy. For
exammple, you can initially view sales
s by year, drill
d down to ssales by month h, and then driill down furthe
er to
sale
es by day.

You
u can also filterr by using dimension values that use slicin g and dicing:

• Slicing. Involvves using a me


ember of one dimension
d to pprovide a slicee of the cube. FFor example, yyou
could slice a cube
c by using a particular product and vieew all sales of that product aacross all datess and
customers.

• Dicing. Involvves providing values


v gle value for a cube. For example,
for everry dimension tto locate a sing
you could loo ok for sales of a particular prroduct on a paarticular day to
o a particular ccustomer.

Onee key differencce with a relational system, or


o the new tab ular data mod del, is processin
ng. The
agg
gregations of measures
m are calculated when the cube is p
processed. This enables you to perform th he
com
mplex queries when
w the syste
em has perform
mance capacitty, perhaps at nnight. When b business users rrun
the queries, resultts are extremely fast becausee the complex processing haas already been done.
SQLL Server Analyssis Services pro orm for multidiimensional databases that contain OLAP ccubes.
ovides a platfo
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 5-7

Data
D Sources

A data source iss an object tha


at provides a SQL Server Anaalysis Services database with the information that
is needed for it to connect to a source of da bes it contains . Analysis Servvices can accesss data
ata for the cub
from one or mo ore sources of data. Typicallyy, the source d
database for an
n OLAP cube iss a data wareh house or
a departmental data mart, in which the tables have been denormalized d to reflect a sttar or snowflakke
scchema of fact and
a dimension n tables. Howe ever, SQL Serveer Analysis Serrvices can use virtually any ddatabase
ass a data source
e and abstract the underlying data model with a data so ource view.

At a minimum, a data source includes an id dentifier, a nam


me, and a connnection string. The connectio
on
sttring that is use
ed to access th
he source data
a specifies the following info
ormation:

• 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 name and a description.

• 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

• ma from the underlying dataa sources, inclu


Enhancementts to the schem uding the follo
owing:

• Friendly names for tables, views, and columns.

• 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.

The term cube is used


u because it describes the multidimenssional nature oof the data, as opposed to th
he
one
e-dimensional or two-dimensional nature of o relational taables. However, almost all cu
ubes have morre
n three dimensions.
than

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.

bes contain all of the settingss that define storage, aggreg


Cub gation levels, aand processing
g frequency.

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

SQL Server Analysis Services


S ass an OLAP Platform

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

Mulltidimensional analysis is sup


pported in SQLL Server Stand ard, Business IIntelligence, En nterprise,
Devveloper, or Evaluation editionn. To install SSAS for multidi mensional anaalysis, your serrver must meet the
sam
me software pre t SQL Server database eng
erequisites as the gine.

• Windows Servver® 2008 Serrvice Pack 2 (S


SP2) or R2 (64--bit) or later

• 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.

After completin y will be able to:


ng this lesson, you
• ow to create a data source.
Describe ho

• ow to create a data source view.


Describe ho v

• 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:

• SQL Server 7.0 using the SQ


QL OLE DB pro
ovider or the .N
NET native OLEE DB provider..
• SQL Server 20
000 using the SQL OLE DB provider
p or thee .NET native O
OLE DB provide
er.

• SQL Server ussing the SQL OLE


O DB provide
er or the .NET native OLE DB
B provider.

• Oracle using the Oracle OLE DB provider or the OracleC


Client.NET nattive OLE DB prrovider.
• Microsoft Acccess® with the ngine OLE DB provider.
e Microsoft Offfice 12.0 Acce ss Database En

• Teradata v2R6 with the OLE


E DB 1.3 provid
der from NCR (x86 only).

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:

• A data sourrce view makes available onlly the tables th


hat OLAP and data mining o
objects require
e by
describing a subset of tab
bles and viewss in a data sourrce.

• A data sourrce view handlles the layout of


o tables, filterrs, Structured Q
Query Language (SQL) expre essions,
relationship
ps, and other complexities
c of the schema. Therefore, a d data source vie
ew enables sim
mple
bindings byy SSAS cubes, dimensions, an nd mining mo odels to the tab bles and colum
mns in the dataa source
view.

• You can deefine a data souurce view by using


u the Data Source View WWizard in SQL Server Data T Tools.
One of the benefits of da ws is that they can bring tog ether data from multiple daata
ata source view
sources. To do this, you can
c specify seccondary data s ources in the DData Source V View Designer. You
can also use
e the Data Souurce View Desiigner to browsse source dataa.
MCT USE ONLY. STUDENT USE PROHIBITED
5-18 Creating Multidimensional Daatabases

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:

• Use the Frien


ndlyName pro m a table or view that is easiier for
operty to speciify a name for a column from
users to unde
erstand or morre relevant to the
t subject areea.

• 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.

• Create logical primary keys and relationships for impro


oved performance.

• 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:

1. Right-click the data source view.

2. Click Propertties.

3. In the Properrties pane, speccify settings su


uch as FriendlyyName.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-19

Demonstra
D ation: Creating a Datta Source aand a Dataa Source V
View

X Task 1: Crreate a new SSAS projecct


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\Mood05 folder, ru
un Setup.cmd d as Administraator.

2.. Click Start, click All Prog


grams, click Microsoft
M SQL Server 2012, and then clickk SQL Server D
Data
Tools.

3.. Click New Project.

4.. Select Anallysis Services Multidimenssional and Datta Mining Pro


oject.

5.. In the Nam


me field, type Demo.
D

6.. In the Loca


ation field, typ
pe D:\10778A\\Demofiles\M
Mod05, and th
hen click OK.

X Task 2: Crreate a data source for the


t Adventu
ureWorksDW
W relational database
1.. In Solution Explorer, rightt-click Data So
ources, and th
hen click New Data Source..

2.. On the Welcome to the Data Source Wizard page,, click Next.

3.. On the Sele


ect how to de nection page, click New.
efine the conn

4.. ver name field,, type localhost.


In the Serv

5.. In the Selecct or enter a database


d nam
me field, click A
AdventureWo
orksDW, and tthen click OK.

6.. Click Next.


7.. Click Use a Specific Win
ndows user na
ame and pass word, and entter the user naame
ADVENTUREWORKS\Student and the e password Paa$$w0rd. Then
n click Next.

8.. In the Data


a source name dventureWorrks Demo DS, and then clickk Finish.
e field, type Ad
MCT USE ONLY. STUDENT USE PROHIBITED
5-20 Creating Multidimensional Databases

X Task 3: Create a data source view


1. In Solution Explorer, right-click Data Source Views, and then click New Data Source View.

2. On the Welcome to the Data Source View Wizard page, click Next.

3. Ensure that AdventureWorks Demo DS is selected, and then click Next.

4. Select the DimCustomer, DimDate, DimGeography, DimProduct, and FactInternetSales tables,


and then add them to Included objects.
5. Click Next.

6. In the Name field, type AdventureWorks Demo DSV, and then click Finish.

X Task 4: Modify the data source view


1. In Solution Explorer, right-click AdventureWorks Demo DSV, and then click Open.

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.

6. In the Column name field, type Full Name.

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

Use the Cube Wizzard to create a cube quicklyy and easily:

• The Cube Wizzard guides yo


ou through the
e steps to speccify the data so
ource view and
d measures in the
cube.
• When you cre
eate the cube, you can add existing
e dimen
nsions or creatte new dimenssions that struccture
the cube.

• You can also create dimenssions separatelly, using the D


Dimension Wizaard, and then add them to a
cube.

• You can creatte a cube by choosing the re


elevant data so
ource and dataa source view. Alternatively, you
can build the cube without using a data source
s and theen subsequenttly generate thhe database
schema. Anotther option is to
t create the cube
c and enab ble SSAS to creeate the underrlying schema to
support the cube.
c

• You can use the


t Cube Wiza ard to automattically build at tributes and h
hierarchies, or yyou can choosse to
define them in
i the Cube De
esigner later.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-23

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

Tiime dimension ns are distinct from other dim


mensions becaause SSAS conttains inherent functionality tto
group the mem mbers into levels. SSAS has buuilt-in logic th at puts the co rrect days into
o the correct m
months
nd the correct months into the
an t correct qua he only dimension type that behaves in this way
arter. This is th
beecause, for exa
ample, SSAS has no way of detecting
d whicch product sho ould be assigne ed to each prooduct
group.

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.

• You can add KPIs and actio


ons, change cube partitioning g and storage,, create aggregations, create
e
perspectives on
o cube data, and add transslations to locaalize cube dataa.
• You can also browse the cu
ube, to see how
w modification
ns will affect th
he cube.

Note Creating and modifying a cube is


i covered in m
more detail in Module 6, “Working with
Cubes and Dimensions.”
D
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-25

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.

After it is deployed, you can click


c the Brow
wser tab from w
within the Cub
be Designer to browse the cu
ube and
se
ee its measuress aggregated by dimensionss.

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.

2. Maximize SQL Server Data Tools, which should be open


n with the Dem
mo project loaaded.

3. In Solution Exxplorer, right-cclick Cubes, an


nd click New C
Cube.
4. On the Welco
ome to the Cu
ube Wizard page,
p click Nex
xt.

5. On the Selectt Creation Me


ethod page, ensure that Use
e existing tab
bles is selected
d, and click Ne
ext.

6. On the Selectt Measure Group Tables pa age, click Sugggest. Then no


ote that the wizzard identifies
Internet Sale
es as a measurre group table,, and click Nex
xt.

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

9. On the Comp pleting the Wizard


W page, ch
hange the cub
be name to De
emo Cube and
d click Finish. T
The
cube is create
ed and openedd in the cube designer.
d

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.

X Task 3: Customize cube measures and dimensions


1. In the cube designer, click the Cube Structure tab. Then, in the Measures pane, expand Internet
Sales.

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.

Thiss lesson describ


bes the SSAS security
s modell.

Afte ou will be able to:


er completing this lesson, yo

• Describe the SSAS security model.

• Describe the server role.

• Describe data
abase roles.

• Explain cube permissions.


• Describe cell permissions.

• Describe dimension securityy.

• Test cube seccurity.


MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-29

SSAS Securrity Model

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.

• SSAS has a single fixed se


erver role for administrators.
a . Members of tthis role have full permission
ns to
perform an
ny action in thee instance.

• Administrattors can createe database role


es for users. Yo
ou can grant tthese roles use
er access and d
database
administrattor rights. Role
e permissions are
a database-sspecific.
• You can graant database role
r permission ns for databas e and cube di mensions, individual dimenssion
members, cubes,
c ual cells within a cube, minin
individu ng structures, m
mining modelss, data sourcess, and
stored proccedures.

Note At least one userr must be speccified during th


he installation of an SSAS instance,
otherwise the instance will
w be inaccesssible.
MCT USE ONLY. STUDENT USE PROHIBITED
5-30 Creating Multidimensional Daatabases

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.

Use SQL Server Management


M Sttudio to add members
m to thee server role. Y
You can add m
members to the
e
servver role on the
e Security page of the Analyysis Server Prroperties dialo og box.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-31

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:

• You can cre


eate database roles by using
g SQL Server M
Management Studio or SQL SServer Data To
ools.
• In SQL Servver Manageme
ent Studio, exp
pand the datab
base, and then
n right-click the Roles folderr to add
a new role.

• In SQL Servver Data Tools,, roles are disp


played in Soluttion Explorer aand you can ad
dd them from the
Project meenu.
MCT USE ONLY. STUDENT USE PROHIBITED
5-32 Creating Multidimensional Daatabases

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:

• Users do not typically need


d access to data
a sources.
• You can grant roles read orr read/write pe ubes within th e database. Byy default, a role that
ermission to cu
has permissio
ons for the cub
be has:

• Access to
o the individua
al cells within the
t cube.

• he dimensions and dimensio


Read perrmissions on th on members th
hat the cube co
ontains.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 5-33

Granting
G Cell Permisssions

A role that has read-only or re


ead/write permmissions is graanted permissio ons on the ind dividual cells until you
ap
pply cell security. However, by
b applying ce ell permissionss, you can overrride the defau ult permissionss that
arre inherited fro
om cube permmissions. By deffault, cell perm
missions apply to all cells in tthe cube, but iif you
grant access to one or more cells,
c the role is denied accesss to all other cells until you grant permisssions on
th
hem. Use a Mu ultidimensional Expressions (MDX)
( statemeent to limit thee range of cells to which the e
peermissions app ply.

Note MD
DX statementss are discussed
d in more detaail in Module 8
8, “Introduction
n to MDX.”

Reead access and d read/write acccess are self-e


explanatory, bbut there is alsoo read-continggent access. Reead-
co
ontingent acce ess gives you permissions
p on
n a calculated ccell only if you
u have permisssions on all cellls that
arre referenced in
i the calculation. For examp ple, the Sales M
Manager role has read accesss to the Saless Value
measure,
m but noo access to thee Product Cosst measure. Th he Sales Manag ger role has also been granted read
acccess to the Prrofit calculatedd measure. The Profit meassure is Sales Va alue minus Prroduct Cost. W With
re
ead access, me embers of the Sales
S role can see the resultss of the Profitt measure and,, because theyy also
haave access to the
t Sales Valu ue measure, caan infer the Prooduct Cost m measure even though they haave no
diirect access to this measure. If you apply read-contingen nt access to thhe Profit meassure, users wouuld only
bee able to see the results if th
hey have permission to see b both the Sales Value and Prroduct Cost data.
MCT USE ONLY. STUDENT USE PROHIBITED
5-34 Creating Multidimensional Daatabases

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

After you have configured seccurity for an SS


SAS database, it is important to test your ssecurity setting
gs and
pe
ermissions. Fortunately, you can test permmissions withou
ut logging off from your Win ndows session
th
hrough SQL Seerver Data Toools.

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:

• In the Cube o an individual or to a role to


e Designer, on the Browser tab, you can cchange user to o test
security by clicking the Change User button.
b

• In Role Dessigner, on the Cell


C Data tab, you can click the Test cube e security hyp
perlink. This haas the
advantage that it saves objects if necesssary and defau
ults to the currrent role.
Yo
ou may also ne QL Server Manaagement Studiio, for example
eed to test seccurity from SQ e, if you are te
esting
ro
ole membershiip, or you mayy want to test a client applicaation such as EExcel. Using otther applicatioons to
te
est user permisssions:
• You can use e the Windows Run as feature to start an aapplication such as SQL Servver Manageme ent
Studio, andd test administrative permissions such as th
hose granted tthrough memb bership in the server
role or the database-leveel Full Control (Administratorr) permission.
MCT USE ONLY. STUDENT USE PROHIBITED
5-36 Creating Multidimensional Daatabases

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.

2. Maximize SQL Server Data Tools, which should be open


n with the Dem
mo project loaaded.

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

6. On the Data Sources tab, note


n that by default the rolee has no accesss to any data ssources.

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.

8. On the Cell Data


D tab, note that this is wh
here you can s pecify MDX sttatements thatt define cells in
n the
cube which you want to peermit or deny this
t role to acccess.
9. On the Dime ensions tab, no ole has Read acccess to all dim
ote that the ro mensions in th
he database. Th
hen in
the Select Dimension Set list at the top of the page, cclick Demo Cu ube cube dime ensions and nnote
that these permissions are inherited
i by th
he dimensionss in the Demo Cube cube.
10. On the Dimeension Data ta ab, in the Dimeension list, un
nder Demo Cu
ube, select Me
easures Dimen
nsion.
Then on the Basic
B tab, clea
ar the checkboox for the Costt measure.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5-37

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.

13. On the File menu, click Save All.

X Task 2: Test a role


1. In Solution Explorer, right-click Demo and click Deploy. If prompted, enter the password Pa$$w0rd
for the ADVENTUREWORKS\Student user.

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

Exercise 1: Creating a Data Sou


urce
Scenario
Users are finding the reportin
ng solution at Adventure
A Woorks Cycles ext remely useful, but many
in
nformation workers want to perform their own analysis o of the data in Excel. To supp
port this, you p
plan to
mplement a multidimensiona
im al database. In
nitially, you neeed to create a connection annd data sourcee to the
daata warehousee.

he main tasks for this exercisse are as follow


Th ws:

1.. Prepare the


e lab environm
ment.

2.. Create a ne
ew SSAS projecct.

3.. Create a da
ata source for the
t AdventureWorksDW reelational datab
base.

X Task 1: Prrepare the la


ab environm
ment
• 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$$w w0rd.

• Run the Settup Windows Command Scrript file (Setup


p.cmd) in the D
D:\10778A\Lab
bfiles\Lab05\Sttarter
folder as Ad
dministrator.

X Task 2: Crreate a new SSAS projecct


• Use SQL Se
erver Data Tools to create a new
n SSAS proj ect.

• Name the project


p Adven
nture Works OLAP,
O and the n save it in thee D:\10778A\LLabfiles\Lab05\\Starter
folder.
MCT USE ONLY. STUDENT USE PROHIBITED
5-40 Creating Multidimensional Databases

X Task 3: Create a data source for the AdventureWorksDW relational database


• Use the Data Source Wizard in SQL Server Data Tools.

• The AdventureWorksDW database is on the local server.

• Use Windows authentication to connect to the data source.

• Use the ADVENTUREWORKS\Student account with the password Pa$$w0rd.

• Name the data source Adventure Works Data Warehouse.

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

Exercise 2: Creating and Modifying a Data Source View


Scenario
The AdventureWorksDW database includes a large amount of data that is not required by your users
and the tables use naming conventions that are confusing to business analysts. You need to define which
tables you require and then change the names of the tables to be more user-friendly. Users have also
requested that they can retrieve full names of customers in addition to their first, middle, and last names.

The main tasks for this exercise are as follows:

1. Create a data source view.

2. Modify the data source view

X Task 1: Create a data source view


• Use the Data Source View Wizard in SQL Server Data Tools.

• Use the Adventure Works Data Warehouse data source.

• Include the DimCustomer, DimDate, DimGeography, DimProduct, and FactInternetSales tables.

• Name the data source view Adventure Works DSV.

X Task 2: Modify the data source view


• Use the Data Source View Designer in SQL Server Data Tools to:

• Change the FriendlyName property of FactInternetSales to InternetSales.

• 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

Exercise 3: Creating and Modifying a Cube


Scenario
Now that you have created a data source view, you are ready to create a cube that enables business users
to perform multidimensional analysis on the data. You will then modify the cube to give the measures in
the cube user-friendly names to make analysis simpler for your business users. You will also add additional
attributes to dimensions to provide users with multiple ways to aggregate the measures.

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.

2. Modify the cube.

3. Modify dimensions.

4. Modify attribute columns.

5. Browse the cube.

X Task 1: Create a cube


• Use the Cube Wizard in SQL Server Data Tools to create a new cube.

• Build the cube by using existing tables.

• Have the Cube Wizard suggest measure group tables.

• Use all suggested dimensions other than Internet Sales.

• Name the cube Adventure Works Cube.

• Verify that the cube resembles the following image.


MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5-43

X Task 2: Modify the cube


• Change the name of the Unit Price Discount Pct measure to Unit Price Discount Percent.

• Change the name of the Tax Amt measure to Tax Amount.

X Task 3: Modify dimensions


• Modify the Customer dimension in Dimension Designer.

• Add the City, StateProvinceName, EnglishCountryRegionName, and SalesTerritoryKey


attributes from the Geography table to the dimension.

• Add the CustomerAlternateKey, Title, FirstName, MiddleName, LastName, and Full Name
attributes from the Customer table to the dimension.

• Verify that the modified dimension resembles the following image:

• Modify the Product dimension in Dimension Designer.

• Add the ProductAlternateKey, ProductSubcategoryKey, EnglishProductName, and ListPrice


attributes from the Product table to the dimension.
MCT USE ONLY. STUDENT USE PROHIBITED
5-44 Creating Multidimensional Databases

• Verify that the modified dimension resembles the following image:

• Modify the Date dimension in Dimension Designer.


• Add the EnglishDayNameOfWeek, EnglishMonthName, MonthNumberOfYear,
CalendarQuarter, CalendarYear, and CalendarSemester attributes from the Date table to the
dimension.
• Verify that the modified dimension resembles the following image:
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5-45

X Task 4: Modify attribute columns


• In the dimension designer for the Date dimension, modify the Calendar Semester attribute so that a
semester is uniquely identified by both the calendar year and the calendar semester, but displayed
using only the calendar semester value:

• 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.

X Task 5: Browse the cube


• Deploy the Adventure Works OLAP project, entering the user name ADVENTUREWORKS\Student
and the password Pa$$w0rd if prompted. Then use Cube Browser to view the Adventure Works
Cube cube.
• Add the Sales Amount and Internet Sales Count measures to the data area, and then drag the
Order Date.Calendar Year hierarchy to the left of the Sales Amount column. The cube browser
shows sales amounts and counts for multiple years as shown in the following image.
MCT USE ONLY. STUDENT USE PROHIBITED
5-46 Creating Multidimensional Databases

• 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 select the Adventure Works OLAP database.

• 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?

2.. How can yo


ou use the Cub
be Designer to
o configure a ccube after it haas been create
ed?

3.. After creating a data source by using th


he Data Sourcee Wizard, whaat tool would yyou use to mod
dify the
data sourcee?

4.. How do tim


me dimensionss differ from otther dimension
ns?
MCT USE ONLY. STUDENT USE PROHIBITED
MCT USE ONLY. STUDENT USE PROHIBITED
6-1

Module 6
Working with Cubes and Dimensions
Contents:
Lesson 1: Configuring Dimensions 6-3

Lesson 2: Defining Attribute Hierarchies 6-12

Lesson 3: Sorting and Grouping Attributes 6-21


Lab 6: Defining Dimensions 6-25
MCT USE ONLY. STUDENT USE PROHIBITED
6-2 Working wiith Cubes and Dimennsions

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

All Analysis Servvices dimensio ons are groups of attributes b


based on colu mns from tablles or views in a data
so
ource view. Dim mensions can exist independdently of a cub d in multiple ccubes, can be used
be, can be used
multiple
m times in a single cube, and can be linked betweeen Analysis Serrvices instance
es. A dimension n that
exxists independent of a cube is called a database dimensiion and an insstance of a dattabase dimension
within
w a cube iss called a cube dimension.

After completin
ng this lesson, you
y will be able to:

• he concepts of a dimension.
Describe th

• Edit dimenssions with the Dimension De


esigner.
• Describe th
he dimension storage
s option
ns.

• Describe th
he use of dimension attribute
es.

• Define the columns used to connect dimensions to th


he fact table, tto display to u
users, and to usse in
MDX calcullations.

• Describe dimension typess.


MCT USE ONLY. STUDENT USE PROHIBITED
6-4 Working wiith Cubes and Dimennsions

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.

Attrributes add meeaning to dime


ensions. Each column
c in the dimension tab
ble can provid de an attribute that
provvides a piece of
o information about the dim
mension memb ber. For examp
ple, a RetailSto
ore dimension
mig
ght have Manager and PostalCode attributtes.

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

The Dimension Design


ner

Use the Dimension Designer to edit the attrib


butes, levels, hiierarchies, and
d translations o
of a dimension
n, and
to browse
b the dim
mension.

• Use the Dime


ension Structu
ure tab to view
w and edit thee attributes, levvels, and hierarchies of the
dimension.

• Use the Attribute Relation


nships tab to create,
c modifyy or delete the attribute relattionships of th
he
selected dime
ension.
• Use the Translations tab to
o view and edit the multi-lan
nguage translaations for the attributes, leve
els,
and hierarchies.

• Use the Brow


wser tab to bro
owse memberss of each hieraarchy in the dimension. You can only brow
wse
members afte
er you have deeployed the so
olution.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 6-7

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.

• Data for a dimension


d that uses MOLAP P is stored in a multidimensioonal structure in the instance
e of
Analysis Services. This mu
ultidimensionaal structure is ccreated and po
opulated when n the dimensioon is
processed. MOLAP dimen nsions provide
e better query performance tthan ROLAP d dimensions.

• Data for a dimension


d that uses ROLAP is stored in thee tables used tto define the d
dimension. The e
ROLAP storrage mode can n be used to su dimensions witthout duplicating large amounts of
upport large d
data, but att the expense of query perfoormance. Beca use the dimen nsion relies directly on the taables in
the data so
ource view used e dimension, t he ROLAP sto rage mode alsso supports reaal-time
d to define the
ROLAP.
MCT USE ONLY. STUDENT USE PROHIBITED
6-8 Working wiith Cubes and Dimennsions

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.

Youu can remove attributes


a from
m the dimensio bute and clicking Delete.
on by right-cliccking the attrib
Remmoving attributes from a dim
mension does not
n affect the d data source vi ew, which makkes it possible for a
dataa source view to
t be used by multiple dime
ensions withou ut forcing eachh dimension too use all of the
e same
attributes.

You u can rename an


a attribute to provide a mo ore meaningfu l or user-friend dly name than
n the dimensio on
tablle. You can do this by right-cclicking the atttribute in the D
Dimension Sttructure tab oof the dimensioon
desiigner. You can
n also set the Name
N propertyy of the attribu ow or edit it directly
ute in the Properties windo
if th
he Attributes pane is in the grid view.

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.

• The ValueC Column is retu urned by the MDX


M MemberV rValue function. This allows yyou to create
calculationss that are baseed on a value other
o than thee name or key. For example, a time dimenssion is
stored in a dimension tab ble with one roow for each daay. The key collumn is a SMA ALLINT and the e name
Column is a CHAR(11) that displays the e day, month, aand year. The value column contains the d date as
a SMALLDA ATETIME. This allows calculattions to use thhe true date vaalue rather than converting iit from
string value
es, but it also allows
a the key column to ho ld a smaller vaalue. A value frrom the key co olumn
occurs in evvery row of thee fact table an
nd so reducingg the size of th is value makess the fact table
e
smaller andd makes joins between
b the fa
act table and tthe time dimennsion faster.
MCT USE ONLY. STUDENT USE PROHIBITED
6-10 Working with
w Cubes and Dimeensions

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..

Afte ou will be able to:


er completing this lesson, yo

• Describe hierarchies.

• Distinguish parent-child hie


erarchies from balanced hierrarchies and describe when each type wou
uld be
used.

• Describe ragg
ged hierarchies and the options you have to configure tthem.

• Describe conssiderations forr using hierarchies.


• ute relationships.
Create attribu
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 6-13

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.

A natural hierarrchy is compossed of attributes where each


h attribute is a member prop perty of the atttribute
beelow. For exam
mple, the Custoomer Geograp Country, Statee-Province, Cityy, Postal Code and
phy hierarchy C
Customer is a natural hierarch
hy because of the relationsh ips between th The hierarchy Marital
he attributes. T
Sttatus-Gender is a non-naturaal hierarchy be nd Gender attributes do not have a
ecause the Maarital Status an
re
elationship to each
e other.

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

The reason that parent-child


p mensions can be read-only aand are chang
dim ging dimension ns is that the
structure of the hierarchy is calcculated at run--time. This can
n be highly be neficial if the rrecords in the
dim
mension change e frequently, however
h there are performan nce considerattions. Because the parent-ch hild
hierrarchy is calculated at run-timme, no aggreg gates are calcu
ulated when thhe cube is proccessed. Therefo ore,
for example,
e the total
t sales for each
e sales mannager, includin
ng their own s ales and all the sales of each h
emp ployee that repports to them, is only calculaated when thee query is run.

Thiss trade-off between a versatiile changing dimension


d and query perform mance must be e considered aand,
idea
ally, the effectss tested. If you
u do not want to use a paren nt-child dimen nsion dimensio
ons can be recrreated
as traditional dimensions. For exxample, an em mployee could list their level one managerr, level two
man nager, and so-on up the hierrarchy. This wo ould allow the aggregates foor the dimension to be calcu
ulated
during processing g, but with a lo oss of flexibilityy.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 6-15

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:

• Never This value creates a regular hiera


archy.
• OnlyChildWiithNoName This value hid
des a level mem d and is null or a
mber when it is an only child
zero-length string.
s

• OnlyChildWiithParentNam me This value


e hides a level member whe n it is an only child and it haas the
same name as its parent.

• NoName This value hidess a level memb


ber when it is null or a zero--length string.

• 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 IsAggrregatable property defines whether


w an Alll level is creat ed. In some sccenarios, an Alll level is
irrelevant. For
F example, the Time dimen nsion in a solu
ution holds datta from 12th January 1995, b because
earlier data
a is too costly to
t convert and
d gives minimaal business ben nefit. This rang
ge of dates is n
not
relevant to the business and
a does not need
n to be agg gregated.

• The AttribuuteHierarchyO Ordered prop perty defines w


whether the hieerarchy is ordeered. If this is sset to
False and you
y do not que ute hierarchy, yyou will reducee processing time. If you only use
ery the attribu
an attribute
e hierarchy to order anotherr attribute hierrarchy, it is nott queried.

• 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.

Hiding and disa


abling attribute
e hierarchies can
c improve peerformance an
nd focus data ffor users. For
exxample:

• 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

Attrributes are alw


ways related dirrectly or indire
ectly to the keyy attribute. Ini tially all attributes are directtly
related to the keyy attribute and in this might be the relation nship that you u require. For e example, a Prooduct
dim
mension contain ns ProductKey, Name, Weiight, ProductiionCost, Reco ommendedSa alesCost. In thiis
dim
mension you do o not group byy any attribute e and there is o
only a need fo or the ALL level and one leve el
containing every member.

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.

Attrribute relationsships are straig


ghtforward to create by usin ng the Attribuute Relationsh hips tab of the
e
dim
mension design ner. You can rig ght-click a blank space to crreate a dimenssion relationship and then chhoose
the source attribuute and related bute can only have one related attribute. For
d attribute. Eacch source attrib
exammple a month can only have e one quarter although
a a quuarter can havee several montths and therefoore, in
this relationship, the
t month is th he source attriibute and the quarter is the related attribu
ute.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 6-19

Demonstra
D ation: Creating a Pare
ent-Child Hierarchyy

Task 1: Crreate a parent-child hierarchy


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\Mood06 folder, ru
un Setup.cmd d as Administraator.

2.. In the D:\10


0778A\Demofiles\Mod06 folder, double-cclick Adventurre Works OLA
AP.sln to open
n the
solution in SQL Server Da
ata Tools.

3.. n Explorer, right-click Dimensions and cliick New Dime


In Solution ension.

4.. On the Welcome to the Dimension Wizard


W page, cclick Next.

5.. On the Sele


ect Creation Method
M page,, select Use an
n existing tab
ble and click Next.

6.. On the Spe


ecify Source In
nformation page:
p
• In the Main
M Table bo
ox select DimE
Employee.

• K column lisst, ensure that EmployeeKe


In the Key ey is selected.

• In the Name
N Column box select FullName.

• Click Next.
N

7.. On the Sele


ect Related Ta
ables page, en mSalesTerrito ry is selected aand click Nextt.
nsure that Dim

8.. On the Sele


ect Dimension
n Attributes page,
p xt.
click Nex

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.

2.. In the Prop


perties pane click the ellipsess (…) button fo
or NamingTem
mplate.
MCT USE ONLY. STUDENT USE PROHIBITED
6-20 Working with Cubes and Dimensions

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.

6. In the Properties pane change the MemebersWithData property value to NonLeafDataHidden.


7. In Solution Explorer, right-click Adventure Works OLAP and click Deploy. If prompted, specify the
password Pa$$w0rd for the ADVENTUREWORKS\Student user.

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.

9. Close SQL Server Data Tools.


MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 6-21

Lesson
n3
Sortin
ng and Grouping Attributes

A cube can be difficult


d to navvigate if it has numerous attrributes and atttribute hierarchies. In Analyssis
Se
ervices, you ca
an sort by the member
m namee, the memberr key, or by a rrelated attributte. You can alsso
group attributes. A member group
g is a syste
em-generated d collection of consecutive ddimension mem mbers.
o improve usability in Analyssis Services, members of an attribute can b
To be grouped into a number o of
member
m groupss through a prrocess called discretization.

Th a grouping attributes. Aftter completing


his lesson desccribes sorting and g this lesson, yo
ou will be able
e to:

• 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.

• You can also order by a seccondary attribu ute. This attrib


bute can be a sstandard colummn or a calculaated
column created in the Data a Source View. For example, you want to s ort a Course d dimension. The e
name of the course
c om “Course 1” to “Course 4550”. The key off the course is provided by tthe
runs fro
course vendo or and is not a relevant sort order.
o If you soort by the nam
me, the order iss “Course 1”,
“Course 11”, “Course
“ 111”, “Course 2”, “C
Course 22”, and d so on. Thereffore, you creatte a new colummn in
the dimension table with th he course nummber as a numeeric field. This can then be used to sort the e data
in the correctt order.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 6-23

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:

• Equal Areass, to divide the


e members into groups with
h an equal num
mber of memb
bers.

• Clusters, to use a clusterin


ng algorithm to
t group memmbers based on data. This can form
n the training d
useful grouups, but has a higher
h processsing cost.
• To specify the
t number off groups, you must
m set the D BucketCount property. The
DiscretizationB e default
is based on
n the square ro
oot of the num
mber of distinctt members.

• To specify a naming temp plate, you musst set the Form


mat option forr the NameCo olumn propertty of an
attribute. The default nam
ming templatee displays the ffirst and last group members in the format
“January – March”. You can create yourr own naming templates to modify group names. Becau use
naming tem mplates are based on the meembers that th hey contain, th he names of grroups can chan
nge as
members are added or re emoved.
MCT USE ONLY. STUDENT USE PROHIBITED
6-24 Working with
w Cubes and Dimeensions

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:

1.. Prepare the


e lab environm
ment.

2.. Remove un
nused attribute
es from dimensions.

3.. Add dimension intelligen


nce.

Task 1: Prrepare the la


ab environm
ment
• Ensure the MIA-DC1 and MIA-SQLBI virtual machinees are both run
nning, and then log on to MIA-
SQLBI as AD
DVENTUREW WORKS\Studen nt with the passsword Pa$$w w0rd.
• Run the Settup Windows Command Scrript file (Setup
p.cmd) in the D
D:\10778A\Lab
bfiles\Lab06\Sttarter
folder as Ad
dministrator.

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.

• Open the Customer


C dimension in the dimension
d dessigner and notte that many aattributes have
e been
added to th
his dimension to allow busin ggregate measures in many different ways.
ness users to ag
However, users
u have com
mplained that some
s of these attributes are unnecessary aand that they sshould
be removedd to make browsing the cub be simpler.
MCT USE ONLY. STUDENT USE PROHIBITED
6-26 Working with Cubes and Dimensions

• 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.

Task 3: Add dimension intelligence


• Use the Business Intelligence Wizard on the Date dimension to define dimension intelligence.

• Specify that the dimension is a Time dimension.

• Map the dimension attribute columns as follows:

Attribute Type Dimension Attribute

Year Calendar Year

Half Year Calendar Semester

Quarter Calendar Quarter

Month Month

Date Simple Date

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

Exercise 2: Defining Relationships and Hierarchies


Scenario
Another way in which users want to simplify analysis is to group dimension attributes into hierarchies that
can be used to summarize data at multiple levels. Specifically, dates must be organized in temporal
hierarchies, such as years, semesters, quarters, and months; customers should be grouped into hierarchies
based on their geographical address and their marital status and gender; and products should be
grouped based on their category and subcategory.
The main tasks for this exercise are as follows:

1. Create attributes in the Date dimension.

2. Create a natural hierarchy in the Date dimension.

3. Create attribute relationships in the Customer dimension

4. Create hierarchies in the Customer dimension.

5. Create attribute relationships in the Product dimension.


6. Create hierarchies in the Product dimension.

7. Browse the hierarchies you have created.

Task 1: Create attribute relationships in the Date dimension


• Open the Date dimension in Dimension Designer.
• In the Attribute Relationships tab, create the following new attribute relationships. Note that all of
these relationships are rigid (because, for example, a particular month will always be in the same
calendar quarter).

Source Attribute Related Attribute Relationship Type

Simple Date Month Rigid (will not change over time)

Month Calendar Quarter Rigid (will not change over time)

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.

Task 2: Create a natural hierarchy in the Date dimension


• In the Dimension Structure for the Date dimension, create a hierarchy based on the relationships
you created in the previous task:

• Drag the Calendar Year attribute to the Hierarchies pane.

• Add the following attributes to the <new level> indicator in the hierarchy in this order:
Calendar Semester

Calendar Quarter

Month

Simple Date

• Change the hierarchy name to Calendar Date.

The completed hierarchy should resemble the following image.

• 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

Task 3: Create attribute relationships in the Customer dimension


• Open the Customer dimension in Dimension Designer.

• 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).

Source Attribute Related Attribute Relationship Type

Postal Code City Flexible (may change over time)

City State-Province Name Flexible (may change over time)

State-Province Name English Country Region Name Flexible (may change over time)

Marital Status Gender Flexible (may change over time)

When you have finished, the Attribute Relationships pane should resemble the following image.

Task 4: Create hierarchies in the Customer dimension


• In the Dimension Structure for the Customer dimension, create a hierarchy based on the
relationships you created in the previous task:

• 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.

Task 5: Create attribute relationships in the Product dimension


• Open the Product dimension in Dimension Designer.

• 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).

Source Attribute Related Attribute Relationship Type

English Product Name English Product Subcategory Name Flexible (may


change over time)

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.

Task 6: Create hierarchies in the Product dimension


• In the Dimension Structure for the Product dimension, create a hierarchy based on the relationships
you created in the previous task:

• 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

Task 7: Browse the hierarchies you have created


• Deploy the Adventure Works OLAP project, entering the user name ADVENTUREWORKS\Student
and the password Pa$$w0rd if prompted.

• 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

Exercise 3: Sorting and Grouping Dimension Attributes


Scenario
Users in Adventure Works Cycles have noticed that when browsing data by month, the data is sorted
alphabetically instead of in chronological order. They have asked you to correct this behavior so that
months are shown in calendar order. Additionally, when analyzing customer data by salary, users have
come to the conclusion that it would be more useful to group customer salaries into discrete bands rather
than view data by individual salary amounts. You have therefore been asked to create salary groupings for
customer data.

The main tasks for this exercise are as follows:

1. Modify the sort order of the Month attribute.


2. Group the Yearly Income attribute hierarchy members.

Task 1: Modify the sort order of the Month attribute


• Open the Date dimension in Dimension Designer, and browse Calendar Date hierarchy. Note that
the month level is sorted in alphabetical rather than chronological order.

• On the Dimension Structure tab for the Date dimension, modify the following properties of the
Month Number of Year attribute:

• AttributeHierarchyOptimizedState: NotOptimized

• AttributeHierarchyOrdered: False

• On the Attribute Relationships tab, create the following attribute relationship.

Source Attribute Related Attribute Relationship Type

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.

• On the Dimeension Structu e Customer di mension, mod


ure tab for the dify the followiing properties of
the Yearly In
ncome attribute:

• DiscretizzationMethod
d: Automatic

• DiscretizzationBucketC
Count: 5

• OrderBy
y: Key

• Deploy the project and bro


owse the Yearly Income hierrarchy to veriffy that the valu
ues are now
grouped into salary bands are
a shown in the
t following i mage.

• Open Adventure Works Cube C in the cub


be designer an nd browse thee cube to view the Internet saales
amount by cu ustomer yearlyy income. Veriffy that the salees are aggregaated by the sallary bands you
u
defined for th
he Yearly Inco
ome hierarchy.

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?

2.. Aside from organizationa


al charts, where
e else might yyou find parentt-child hierarchies?

3.. When migh


ht you want to
o use a secondary attribute fo
or sorting dataa?
MCT USE ONLY. STUDENT USE PROHIBITED
7-1

Module 7
Working with Measures and Measure Groups
Contents:
Lesson 1: Working with Measures 7-3

Lesson 2: Working with Measure Groups 7-10

Lab 7: Configuring Measures and Measure Groups 7-24


MCT USE ONLY. STUDENT USE PROHIBITED
7-2 Working wiith Measures and Meeasure Groups

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

Thhis lesson explains how to work


w with meassures, including
g configuring how measuress are displayed
d,
in
nformation abo nfiguring how measures are aggregated.
out measure values, and con

After completin y will be able to:


ng this lesson, you

• Describe th
he concept of a measure.

• List the pro


operties of mea
asures.
• Configure measure
m forma
atting.

• Chose apprropriate aggre


egation functio
ons for requireed additivity.
MCT USE ONLY. STUDENT USE PROHIBITED
7-4 Working wiith Measures and Meeasure Groups

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.

Youu could also picck a specific sttore from the stores


s dimensiion, a specific product from the products
dim
mension, a speccific day from thet time dimension, a speciffic salesperson n from the sale
esperson dimennsion,
and either sales units or sales va alue from the measures dimeension to provvide specific ag ggregated dettails.
Alth
hough measure es are part of the
t measures dimension, theey are distinct from all otherr dimensions aand
are typically just referred
r to as measures.
m

You ures as part of the Cube Wiza


u create measu ard or on the C
Cube Structu re tab of the C
Cube Designerr.

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

Measures from Attribute Columns


You can use attribute columns from dimension tables to define measures, but such measures are typically
semiadditive or nonadditive in terms of their aggregation behavior. For example, a customer might have
an account balance. This can be added for all customers, but it should not be added for an individual
customer over time. If a customer has a positive balance of $10.00 and maintains this for a year, it should
not be summed by week; otherwise, the customer would have a balance of $520.00 rather than $10.00.

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.

Meaasures inherit certain


c properrties from the measure
m group ber, unless thosse
p of which theey are a memb
properties are oveerridden at the
e measure leve el.

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 column in the data sou


urce view to which the meas ure is 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 folder in which the measure will appe


ear when userrs connect to t he cube.

• The display fo
ormat of the measure.
m
• The unique id
dentifier (ID) of
o the measure. Note that thiis property is rread-only.

• Any MDX exp


pressions that define the measure.

• 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.

Note Th he currency forrmat will displa


ay the currenccy symbol of th he location of the client.
Therefore,, the value mayy be incorrect,, and in most sscenarios it wo
ould be more aappropriate
to use a usser-defined Fo
ormatString.

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

The measure prop perty Aggrega ateFunction determines


d howw measures arre aggregated,, and you can
configure it by using the Properrties window of o a measure in n the Cube Deesigner. Some measures do n not
use the SUM funcction and aggregate in anoth her way. For exxample, you m might have a profit margin
meaasure. This is tyypically about 50 percent, an
nd a supplier ttypically has ab
bout 100 prodducts. If you display
the aggregated profit margin fo or each supplie
er, you would expect the vallue to be abou ut 50 percent aand
not about 5000 percent, and therefore you wouldw use the AAVG function iin place of SUM
M.
Agg used, the additivity
gregation funcctions have diffferent levels of additivity. Baased on the function that is u
will fall into one of
o three catego
ories:

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.

3. A nonadditivee measure. You


u cannot aggreegate this alonng any dimenssion in the measure group th hat
contains the measure.
m Inste
ead, you must individually caalculate the meeasure for eacch cell in the cu
ube
that represen
nts the measure e, a calculated measure that returns a perccentage, such as
e. For example
profit margin, cannot be ag
ggregated fromm the percentaage values of cchild members in any dimen nsion.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7-9

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.

Other semiadditive aggregation functions include:

• 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.

• Aggregations.. These are pre


ecalculated summaries of daata from leaf cells that impro
ove query resp
ponse
times.
Thiss lesson describ
bes measure group
g properties and the relaationships bettween measure
e groups and
dim
mensions. It alsoo explains parttitions, aggreg
gations, and ho
ow to configurre measure grooup storage.

Afte
er completing this lesson, yo
ou will be able to:

• Describe mea
asure groups.

• List the prope


erties of measu
ure groups.

• Describe the relationships between


b measure groups an
nd dimensions..
• Explain partitions and meassure group sto
orage.

• Describe aggregations and their effect on


n performancee.

• 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).

• How measu ure aggregatio


ons should be stored. For exaample, you miight optimize ccube performaance by
storing pre-aggregated values
v for some or all of the possible aggreegations for m
measures in a m
measure
group and its related dim
mensions.

ou define one or more meassure groups in SQL Server D ata Tools by u


Yo using the Cube
e Wizard and then add
an
nd configure measure
m group
ps by using thee Cube Design
ner.

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:

• AggregationnPrefix This specifies


s the co
ommon prefixx that is used fo
or all aggregation names off the
measure grou
up.

• DataAggregation This determines whe ether SSAS can


n aggregate peersisted data oor cached dataa for
the measure group. The deefault value is DataAndCach
D heAggregatab ble, which will aggregate
persisted data
a and cached data.
d You can change this too CacheAggre egatable or DataAggregata able.
DataAggregatable can be e useful on systtems with limitted RAM becaause the other two settings wwill
attempt to ke
eep the aggreggations in mem mory to improove performan ce.
• uration This provides confiigurable error--handling setttings for handling of duplicaate
ErrorConfigu
keys, unknow
wn keys, null ke
eys, error limitss, action upon
n error detectio
on, and the errror log file.

• EstimatedRoows This speccifies the estim


mated number of rows in thee fact table. Yo
ou use this wheen
you design ag
ggregations. The
T value is staatic and should
d be kept apprroximately acccurate, either
manually or by
b updating thhe count in the
e Aggregation Design Wizarrd.

• EstimatedSizze This speciffies the estima


ated size (in byytes) of the meeasure group. Y
You use this w
when
you design ag
ggregations

• ID This speccifies the identtifier of the ob


bject.

• IgnoreUnrelaatedDimensioons This deteermines wheth


her unrelated d
dimensions are e forced to the
eir top
level when members of dim
mensions that are
a unrelated tto the measurre group are in
ncluded in a qu
uery.

• 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.

• Type This specifies the type of the measure group.


MCT USE ONLY. STUDENT USE PROHIBITED
7-14 Working with
w Measures and Measure
M Groups

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.

Note Whe en a measure group


g is updated, dimension
n relationship information iss
unavailable until the cube is processed.

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

Many-to-Many Dimension Relationship


Typically, each dimension member relates to many facts, but each fact relates to just one member in each
dimension. This is a standard one-to-many relationship. You may also have many-to-many relationships;
for example, a customer might have multiple reasons for making a purchase, and each purchase reason
will have multiple customers. In a relational database, this relationship would be achieved through an
intermediate table, and in SSAS, a similar technique is used by joining the dimension to an intermediate
fact table, by joining the intermediate fact table to an intermediate dimension, and by joining the
intermediate dimension to the fact table.

Note Foreign-key relationships between all tables involved in a many-to-many


relationship must exist in the underlying data source view.

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

Task 1: Define a referen


nced relationship
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\Mod07 folder, run Setup.cmd a s Administrato or.

2. In the D:\10778A\Demofile er, double-clicck Adventure Works OLAP.sln to open th


es\Mod07 folde he
solution in SQ
QL Server Data
a Tools.

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.

Note that the


e values for eacch region are the
t same. The aggregation iis incorrect.

5. In Solution Exxplorer, right-cclick Geography.dim, and t hen click View


w Designer. Note that this
dimension is based on the Geography
G ta
able and has a Country-Reg gion attribute.

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.

7. Click the tab for the Advennture Works Cube.cube,


C an
nd on the Cube e Structure taab, in the Dataa
Source View pane,
p note tha
at there is no direct
d relationsship between tthe InternetSaales fact table and
the Geography dimension table.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7-17

8. On the Dimension Usage tab, click the intersection of the Internet Sales measure group and the
Geography dimension, click the ellipses (…) button.

9. In the Select relationship type list, select Referenced.

10. In the Intermediate dimension list, select Customer.

11. In the Reference dimension attribute list, select Geography Key, and in the Intermediate
dimension attribute list, select Geography Key.

12. Click OK.

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:

• Right-click the partition, and then click Storage Settings.

• 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.

artitions enablle the source data


Pa d and aggre
egate data of a cube to be d distributed across multiple hard
drives and among multiple se erver computers. You can usee this to greattly improve performance on large
cu
ubes.

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..

For Moree Information n For more innformation abo


out Remote Pa
artitions, see
http://go.microsoft.com
m/fwlink/?LinkID=246785.
MCT USE ONLY. STUDENT USE PROHIBITED
7-22 Working with Measures and Measure Groups

A simple Partition object consists of:

• Basic information that includes the name of the partition, the storage mode, and the processing
mode.

• A slicing definition that is an MDX expression that specifies a tuple or a set.

• An aggregation design that is a collection of aggregation definitions that you can share across
multiple partitions.

Typically, you can partition a measure group horizontally or vertically.

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.

Users specificallly need to analyze reseller sa


ales by producct, so you mustt ensure that tthe cube suppo
orts the
re
equired relatio
onship between n the new rese eller sales mea sure group an
nd the Productt dimension

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

Lab 7: Configuring Measure


M es and M
Measure
e Group
ps

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.

The main tasks for this exercise are as follows:

1. Prepare the la
ab environmen
nt.

2. Create a measure group.


3. Modify measure groups.

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

Task 2: Create a measure group


• Use SQL Server Data Tools to open the Adventure Works OLAP.sln solution in the
D:\Labfiles\Lab07\Starter folder.

• 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

Task 3: Modify measure groups


• Delete the following measures from the cube.

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

• Sales Territory Key

• Revision Number

• Extended Amount

• Unit Price Discount Percent

• Discount Amount
• Product Standard Cost

• Freight

• Revision Number – Fact Reseller Sales

• Extended Amount – Fact Reseller Sales

• Unit Price Discount Pct

• Discount Amount – Fact Reseller Sales

• Product Standard Cost – Fact Reseller Sales

• Freight – Fact Reseller Sales

• Rename the following measures:

Measure Rename to:

Order Quantity Order Quantity – Internet Sales

Unit Price Unit Price – Internet Sales

Total Product Cost Total Product Cost – Internet Sales

Sales Amount Sales Amount – Internet Sales

Tax Amount Tax Amount – Internet Sales

Order Quantity – Fact Reseller Sales Order Quantity – Reseller Sales

Unit Price – Fact Reseller Sales Unit Price – Reseller Sales

Total Product Cost – Fact Reseller Sales Total Product Cost – Reseller Sales

Sales Amount – Fact Reseller Sales Sales Amount – Reseller Sales

Tax Amt Tax Amount – Reseller Sales

Fact Reseller Sales Count Reseller Sales Count


MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 7-27

When you view


v the modiified measuress as a tree, theyy should resem
mble the follow
wing image.

Results: After this exercise, yo


ou should have created a neew measure grroup for the Fa
actResellerSalles
ta
able, removed unrequired measures, and renamed
r meassures.
MCT USE ONLY. STUDENT USE PROHIBITED
7-28 Working with Measures and Measure Groups

Exercise 2: Defining a Regular Relationship


Scenario
Your users have specifically stated that they must be able to analyze reseller sales by product, so you must
create the required relationships to support aggregating reseller sales measures by the Product
dimension.

In this exercise, you will create a regular relationship.

The main task for this exercise is as follows:

1. View existing dimensions for measure groups.

2. Create a dimension.

Task 1: View existing dimensions for measure groups


• Deploy the Adventure Works OLAP project, entering the user name ADVENTUREWORKS\Student
and the password Pa$$w0rd if prompted.

• 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.

Task 2: Create a dimension


• On the Dimensions Usage tab of the cube designer for Adventure Works Cube, define a regular
relationship at the intersection of the Reseller Sales measure group and the Product dimension.

• Define the relationship at the Product Key level of granularity.


• Select ProductKey as the measure group column.

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

Exercise 3: Configuring Measure Group Storage


Scenario
Users have requested that the cube should be optimized to improve performance when analyzing
Internet sales. However, you must balance this need for optimization against the space required to store
aggregations.

The main tasks for this exercise are as follows:

1. Configure the storage mode of the Internet Sales measure group.

2. Design aggregations for the Internet Sales measure group.

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.

• Specify that the Automatic MOLAP setting should be used.

Task 2: Design aggregations for the Internet Sales measure group


• Use the Aggregation Design Wizard to design aggregations for the Internet Sales measure group in
the Adventure Works Cube cube.

• Set all aggregation usage to the default before starting the configuration.

• Use the wizard to count the objects in the measure group.

• Generate aggregations until the performance gain reaches 35%.

• Name the aggregation you have generated InternetSalesAgg.

• 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.

2. What are the two ways in which


w you can partition a meeasure group?
3. How can you use aggregations to improvve query respo
onse time?
MCT USE ONLY. STUDENT USE PROHIBITED
8-1

Module 8
Introduction to MDX
Contents:
Lesson 1: MDX Fundamentals 8-3

Lesson 2: Adding Calculations to a Cube 8-12

Lesson 3: Using MDX to Query a Cube 8-24


Lab 8: Using MDX 8-29
MCT USE ONLY. STUDENT USE PROHIBITED
8-2 Introduction to MDX

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

Yoou can use MD DX to query multidimension


m al data or to ccreate MDX exxpressions for u
use within a cu ube.
However, you must
m first unde ndamentals of MDX. This les son describes MDX. It explains what
erstand the fun
MDX
M is, discusse
es basic MDX query syntax, and
a explains h how to specify query and sliccer axes. Finally, this
le
esson discussess the process that is involved
d to establish ccube context.

After completin
ng this lesson, you
y will be able to:
• Describe MDX.
M

• Explain bassic MDX query syntax.

• 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,

MDX consists of two parts: MDX X statements and


a MDX expreessions. MDX statements retturn record setts,
and client applications use themm to populate the applicatio on that the useer sees. MDX expressions return
gle values and are used in the cube to crea
sing ate values such d members or default memb
h as calculated bers. In
mosst scenarios in SSAS, you willl use MDX exp pressions, but yyou might usee MDX stateme ents in client
appplications or to define subsetts of cube data
a.

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.

Youu use MDX for many things whenw you work


k with multidimmensional cub bes. In the last illustration on
n the
slide
e, you can see an example where
w MDX is used
u to limit th
he cells that caan be read by members of a role.
Lateer in this modu
ule, you will alsso see MDX ussed in SQL Serrver Managem ment Studio, Microsoft Excel® ®,
and SQL Server Re eporting Servicces.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 8-5

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

Basic MDX Query


Q Synttax

The basic MDX qu uery is the SELECT statementt. This is the m


most frequentlyy used query in
n MDX and yo
ou use
it to
o retrieve data from a cube.

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.

• A FROM clausse. This determmines which multidimension


m nal data sourcee to use when extracting datta to
populate the result set of th
he MDX SELEC
CT statement.

• A WHERE clau use. This optio


onally determin nes which dim
mension or mem
mber to use ass the slicer axiss that
restricts the extracting
e of data to a speciffic dimension o
or member.

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 contains a spacce or other spe


ecial character . For example,, you must refe
er to the mem
mber
Gross Profit in MDX as [Grross Profit] beccause the nam
me contains a s pace.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 8-7

• 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.

Qualifying Names to Avoid Ambiguity


The same object name from an OLAP database can appear in more than one place in an OLAP cube—
even in the same dimension or level of a cube. To avoid ambiguity, MDX enables you to add qualifiers to
a member name. The qualifiers ensure that when you read the MDX statement or expression, you know to
which object the name refers. The following are examples of ambiguous situations and how they would
be qualified:

• 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].

Ensuring Correct Member is Returned


MDX does not return an error if a name is ambiguous, that is, if the name appears in more than one place
in a cube. MDX follows the simple rule of using the first occurrence of the name in the database. For
example:

• 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

Queery axes and slicer axes are each


e a set of hierarchies from
m which data is retrieved. Qu
uery axes and slicer
axess have the follo
owing charactteristics:

• pecify the edges of a cell sett that an MDX SELECT statem


Query axes sp ment returns.
• To explicitly specify
s a queryy axis, use the <SELECT query
ry axis clause> , as the code e
examples here
e
illustrate.

• The slicer axiss filters the datta that the MD


DX SELECT stattement returnss, restricting th
he returned daata so
that only data a that intersects with the speecified numbeers will be returned.

• 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]

The following cod


de example pe
erforms the sam
me query by u sing integers.

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

Esttablishing Cube Con


ntext

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

Note The subcube has the same name


e as the cube.

Note The accounts 4200 0 and 4300 aree preceded by an ampersand


d. The ampersand
signifies thatt the value is a key rather than a name.

Youu can also use the


t LOOKUPCUBE and FILTE o refine the cube context. Th
ER functions to he LOOKUPCU UBE
funcction enables you
y to retrievee data from ou
utside the cubee. For examplee, the MDX staatement in the
e
follo
owing code exxample retrieve
es data from the Adventure eWorksArchiv ve cube even tthough the current
context is AdventtureWorks.

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.

SELECT [Measures].[Sales Amount] ON 0,


FILTER([Date].[Date].[Date].MEMBERS, [Measures].[Sales Amount]>1000)
ON 1
FROM [Adventure Works]
MCT USE ONLY. STUDENT USE PROHIBITED
8-12 Introductiion to MDX

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.

er completing this lesson, yo


Afte ou will be able to:

• Describe how
w to add calculations to a cub
be.
• Explain the co
oncepts of calcculated memb
bers.

• Describe nam
med sets.

• List useful non-family MDX


X functions.
• List useful fam
mily MDX funcctions.

• Define subcubes by using the SCOPE stattement.


MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-13

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 Organizer pane in form view


v to displayy the contentss of the cube script in an ord
dered
format.

• Use the Callculation Toolss pane in both form view and


d script view tto display metaadata, function
ns, and
tools that are
a available to
o the cube.

• 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.

• Use the Named Set Form


m Editor pane in form view to
o edit named ssets in the cub
be script.
Th
he Calculated Member Build der is a principal interface fo r creating calcculated members by using M
MDX.
he interface includes several regions:
Th

• The top reg


gion contains three
t boxes th
hat enable you to change thee name of the member and the
dimension and location for
f the new me ember:

• 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:

1.. To create a calculated me


ember for a sin
ngle MDX queery, you can deefine that calcu
ulated membe
er by
using the WITH
W keyword..

2.. To create a calculated me


ember that is available
a throu
ughout an MD
DX session, use
e the CREATE
MEMBER sttatement.

ou can define a calculated member


Yo m to havve one of two contexts:

1.. Query-scop ped. A calculate


ed member th
hat is defined aas a part of an MDX query and whose scop
pe is
limited to that query.

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.

Yoou should be aware


a that beccause calculate
ed members p e data, they are
perform calculaations on cube
exxecuted at run
n time. Therefo u of calculatted members ccan cause query execution tiimes to
ore, extensive use
in
ncrease and processing timess to decrease.
MCT USE ONLY. STUDENT USE PROHIBITED
8-16 Introductiion to MDX

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:

• You can use named


n sets in MDX queries in client appliccations and yo
ou can also use
e them to define
sets in subcub
bes.

• Named sets simplify


s MDX queries
q and prrovide useful aaliases for com plex, typically used, set
expressions.

Here are two exam


mple named se
ets:

• To create a named set for a single MDX query,


q you can
n define that named set by u
using the WITH
H
keyword.

• To create a named set that is available th


hroughout an M
MDX session, u use the CREAT
TE SET stateme ent. A
named set that is created by
b using the CR REATE SET stattement will no
ot be removed until after the
e MDX
session closess.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-17

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.

2.. In the D:\10


0778A\Demofiles\Mod08 folder, double-cclick click Adve
enture Workss OLAP.sln to open it
in SQL Servver Data Tools..
3.. In Solution Explorer, rightt-click Adventture Works O
OLAP, and then
n click Deploy
y. If prompted,, specify
the user name ADVENTU UREWORKS\S Student and th
he password P
Pa$$w0rd.
4.. In Solution Explorer, double-click Adve
enture Workss Cube.cube, aand in the cub
be designer, click the
Calculationns tab.

5.. On the toolbar of the Callculations tab


b, click New Naamed Set.

6.. In the Nam


me box, change
e the name of the new nameed set to [Acc essories].

7.. On the Metadata tab, in the Calculatio


on Tools panee, expand Product, expand Product Cate
egory,
expand Me
embers, and th hen expand Alll.

8.. he Expression box.


Drag Accesssories into th

9.. On the File


e menu, click Save
S All.
MCT USE ONLY. STUDENT USE PROHIBITED
8-18 Introduction to MDX

Task 2: Browse the cube by using the new named set


1. In SQL Server Data Tools, on the Build menu, click Deploy Adventure Works OLAP. If you see a
warning that the database will be overwritten, click Yes.

2. When deployment has successfully completed, click the Browser tab.

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.

6. Close SQL Server Data Tools.


MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-19

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.

For More e Informationn For more in


nformation abo
out the DAX laanguage, see M
Module 11,
“Introducction to DAX.”
MCT USE ONLY. STUDENT USE PROHIBITED
8-20 Introduction to MDX

NONEMPTY
NONEMPTY is a useful function because it returns the rows that are not empty from a set, as in the
following code example.

NonEmpty([Product Category].[Product Category Key].Members,[Measures].[Sales Amount])

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

In the prevvious example,, the PARENT function


f of thee member San
n Francisco wo
ould return CA..

• 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.

Afte ou will be able to:


er completing this lesson, yo

• Use MDX in SQL


S Server Management Stu
udio.
• Use MDX in Microsoft
M Excel.

• Use MDX in SQL


S Server Rep
porting Service
es.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-25

Using
U MDX
X in SQL Se
erver Mana
agement SStudio

Too run MDX queries in SQL Se


erver Managemment Studio, ssimply connectt to the SSAS iinstance when
n you
sttart Manageme
ent Studio andd you can then
n create a new
w MDX query.

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.

Exce el uses .ODC fiiles to store co


onnection strinng informationn. If you edit th ou can use an MDX
he .ODC file, yo
statement as the source.
s The illu
ustration on thhe slide shows an .ODC file tthat uses an M
MDX statementt.
Initiially the string only specified
d the Adventu ure Works cub be, but in this eexample, it has been filtered
d to
show w appropriate e data. This enaables you to hide the MDX ffrom the user b but customizee the MDX
statements, which h gives you the e benefits of a straightforwa rd application with the functionality of the
e
MDX language.

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

Exercise 1: Querying a Cube by


y Using MD
DX
Scenario
Yo
ou are a BI devveloper for the
e Adventure Works
W Cycles coompany, and yyou are creatin ng a custom analysis
ap t Chief Finance Officer (CFFO). The appliccation must reeturn sales data for productss,
pplication for the
ustomers, and dates from the Adventure Works
cu W Cube, soo you have inittially decided to experimentt with
MDX
M syntax to query the cube and retrieve business dataa.

n this exercise, you will write multiple MDX


In btain the necesssary informattion for the salles
X queries to ob
management
m te
eam.

he main tasks for this exercisse are as follow


Th ws:

1.. Prepare the


e lab environm
ment.

2.. Deploy an OLAP


O database.

3.. Write simple MDX querie


es.

4.. Write an MDX query to re


eturn data on rows and colu
umns.

Task 1: Prrepare the la


ab environm
ment
• 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$$w w0rd.

• Run the Settup Windows Command Scrript file (Setup


p.cmd) in the D
D:\10778A\Lab
bfiles\Lab08\Sttarter
folder as Ad
dministrator.
MCT USE ONLY. STUDENT USE PROHIBITED
8-30 Introduction to MDX

Task 2: Deploy an OLAP database


• Use SQL Server Data Tools to open the Adventure Works OLAP.sln solution in the
D:\10778A\Labfiles\Lab08\Starter folder. Then deploy the solution, entering the user name
ADVENTUREWORKS\Student and the password Pa$$w0rd if prompted.

• When deployment has completed successfully, close SQL Server Data Tools.

Task 3: Write simple MDX queries


• In SQL Server Management Studio, connect to the localhost instance of Analysis Services, and then
create and execute a new MDX query in the Adventure Works OLAP database that displays the
Sales Amount – Internet Sales measure for each product category.

• Use the following MDX code:

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.

• Use the following MDX code:

SELECT
[Measures].[Internet Sales Count] On 0,
NonEmpty([Customer].[Customer Geography].[ English Country Region Name].Members) On
1
FROM [Adventure Works Cube]

Task 4: Write an MDX query to return data on rows and columns


• In SQL Server Management Studio, create and execute an MDX query that returns the Sales Amount
measure with calendar years from the Calendar Date hierarchy on columns and cities from the
Customer Geography hierarchy on rows.

• Use the following MDX code:

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

Exercise 2: Creating a Calculate


ed Membeer
Scenario
Th
he CFO has alsso asked you to extend the cube
c to includ e measures fo
or profit and grross profit marrgin, so
yo
ou must createe calculated members
m for these and ensurre that you can
n include themm in queries froom the
cu
ustom applicattion you plan to
t build.

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:

1.. Define a Profit calculated


d member base
ed on physicall measures.

2.. Define grosss profit margiin calculations.


3.. Query the new
n calculated
d members.

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

Task 2: Define gross prrofit margin calculationss


• Create a seco
ond new calculated member named [Grosss Profit Marg gin] that subtrracts the Totall
ales measure from the Saless Amount – In
Product Costt – Internet Sa nternet Sales measure and then
divides by Sales Amount – Internet Sale
es to return a percentage.

• 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.

• Use the following


f MDX
X code.

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]

Results: After thiss exercise, you should have created


c two caalculated mem
mbers and then
n queried them
m.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 8-33

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?

2.. What are th


he three paness of the Calcullations tab an
nd what purpose does each p
pane serve?

3.. How can yo


ou create named sets?
MCT USE ONLY. STUDENT USE PROHIBITED
9-1

Module 9
Customizing Cube Functionality
Contents:
Lesson 1: Working with Key Performance Indicators 9-3

Lesson 2: Working with Actions 9-11

Lesson 3: Working with Perspectives 9-16


Lesson 4: Working with Translations 9-19

Lab 9: Customizing a Cube 9-24


MCT USE ONLY. STUDENT USE PROHIBITED
9-2 Customizinng Cube Functionalityy

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.

er completing this module, you


Afte y will be able to:

• Describe Key Performance Indicators.

• 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.

Youu must ensure that


t business rules
r are follow ue because an unsuitable MDX
wed to assign the status valu
form
mula could result in a departtment, or the company
c as a whole, being incorrectly asssigned a successful,
or unsuccessful,
u sttatus.

One e key advantag ge of KPIs in Analysis


A es is that they aare server-bassed and are co
Service onsumable by
diffe
erent client ap
pplications. If a KPI is client-bbased it must b be recreated fo or each client application an
nd
poteentially the ressults could difffer if the imple
ementations arre not identicaal.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementiing Data Models andd Reports with Microssoft® SQL Server® 2012 9-5

Elements of
o a KPI

A simple KPI obbject is compossed of a name e, a description


n, the goal, thee actual value aachieved, a staatus
va
alue, a trend value, a status indicator,
i a tre
end indicator, aand a folder wwhere the KPI iis viewed.

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

Additional properties of the KPI include:

• 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.

Thhe example in the above illuustration uses several


s MDX fu
unctions to retturn the KPI vaalue, KPI goal, KPI
sttatus, and KPI trend
t for the channel
c revenuue measure off the Adventurre Works datab base for the
de escendants of three members of the Fiscal Year attributee hierarchy.
MCT USE ONLY. STUDENT USE PROHIBITED
9-8 Customizinng Cube Functionalityy

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.

2. In the D:\10778A\Demofile er, double-clicck Adventure Works OLAP.sln to open th


es\Mod09 folde he
solution in SQ
QL Server Data
a Tools.

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.

6. In the Name box, type Resseller Revenue


e, and then in the Associate
ed measure group list, clickk
Reseller Sale
es.
7. On the Metadata tab in the Calculation Tools
T pane, exxpand Measurres, expand Re
eseller Sales, aand
then drag the
e Sales Amount – Reseller Sales
S measuree to the Value
e Expression b
box.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 9-9

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

Task 2: Browse a KPI


1. On the File menu, click Save All.

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.

7. Close SQL Server Data Tools.


MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-11

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.

A simple Action object


o is compoosed of: basic information, t he target wheere the action iis to occur, a
condition to limit the action sco
ope, and the tyype.
Basiic information includes the name
n of the acction, the targeet of the actio
on, and an optiional condition
n for
the action.

The target is the actual


a location
n in the cube where
w the actio
on is to occur aand is compossed of a targett type
and a target objecct.

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.

A coondition is a Boolean MDX statement


s thatt evaluates to ttrue or false. Iff the statemen
nt is true, the aaction
is pe
erformed, if th
he statement iss false, the actiion is not perfformed.

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.

Reporting Submmits a parameteerized URL-based request to


o a report serve
er and
return
ns a report to a client application.

Drillthrough Returns a drillthrou gh statement as an expressiion, which the client


utes to return tthe set of rowss that represen
execu nts the underlyying
data from
f the data source of the selected cells of the cube wwhere
the acction occurs. FFor example, yoou could use tthis action on a
measu ure group for sales orders too drillthrough to details of th
he
orders that contribu ute to an aggrregated total.
MCT USE ONLY. STUDENT USE PROHIBITED
9-14 Customizing Cube Functionaliity

Building Actions for a Cube

Use the Actions tab


t of the cube
e designer to build
b actions ffor a cube and specify the fo
ollowing details for
stan
ndard actions:

• Name: select a name that identifies the action.


a
• Action Targeet: select the object
o to which
h the action is attached. For Target type, select from the
following objects:

• 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

• Action Content: select the type of action from the following:

Type Description

Dataset Retrieves a dataset.

Proprietary Performs an operation by using an interface other than those listed here.

Rowset Retrieves a rowset.

Statement Runs an OLE DB command.

URL Displays a variable page in an Internet browser.

• Additional Properties: select additional action properties from the following:

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

Application Describes the application of the action.

Description Describes the action.

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.

Caption is MDX If the Caption value is generated dynamically by an MDX statement,


specify True.

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.

er completing this lesson, yo


Afte ou will be able to:

• 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.

• The dimenssions are a sub


bset of the cub
be dimensions..
• The measurre groups are a subset of the
e cube measurre groups.

• The calculations are a sub


bset of the cub
be calculationss.

• The KPIs are a subset of the


t cube KPIs.
• The actionss are a subset of
o the cube acctions.

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

The first column of


o the Perspecctives tab in th
he cube design
ner is the Cube Objects colu
umn, which lists all
of the objects in the
t cube.

You
u can add a perspective to th
he Perspectivess tab by:

• Clicking New
w Perspective on the Cube menu.
m

• Clicking the New


N Perspecttive button on
n the toolbar.

• g anywhere in the pane and click New Perrspective on tthe shortcut m


Right-clicking menu.
You
u can remove a perspective by:
b

• Clicking any cell


c in the coluumn for the pe
erspective thatt you want to d
delete. Then, o
on the Cube m
menu,
click Delete Perspective.
P
• Clicking the Delete
D Perspe
ective button on
o the toolbarr.

• 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.

After completin y will be able to:


ng this lesson, you

• Describe tra
anslations.
• Implement cube translations.

• Implement dimension tra


anslations.
MCT USE ONLY. STUDENT USE PROHIBITED
9-20 Customizing Cube Functionaliity

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.

A simple Translatiion object is co


omposed of: la
anguage ID nu umber, and traanslated captio on. The languaage ID
nummber is an Inte
eger with the laanguage ID. Th
he translated ccaption is the ttranslated textt.

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:

• Upon connecction, the client passes its ow nalysis Service


wn LCID to the instance of An es.
• The instance uses the LCID to determine which set of trranslations to use when provviding metadaata for
Analysis Serviices objects to each businesss user.

• If an Analysis Services objecct does not contain the speccified translatio


on, the defaultt language is u
used
to deliver the
e content to the client.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-21

Im
mplementting Cube Translations

Click the New Translation


T buutton on the tooolbar of the TTranslations taab in the cube designer to crreate a
ne
ew translation and to removve a translation
n, click Delete Translation tto delete the sselected translaation.

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

Use the Translations tab in the


e dimension de
esigner to defi ne and manag
ge translationss for the dimen
nsion.

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.

• <Language> bject in the selected languag


>: Type or select the propertty value of the dimension ob ge.

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.

Finally, the com


mpany employss a number of senior sales m ge is French. These
managers whosse first languag
ussers would like
e to be able to
o view cube data and metadaata in French.
MCT USE ONLY. STUDENT USE PROHIBITED
9-24 Customizing Cube Functionaliity

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.

2. Deploy an OLLAP database.


3. Create a drilltthrough action
n.

4. Browse a drilllthrough action.

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.

• Run the Setup


p Windows Co ommand Scriptt file (Setup.cm
md) in the D:\1
10778A\Labfiiles\Lab09\Sttarter
folder as Adm
ministrator.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-25

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.

Task 3: Crreate a drilltthrough actiion


• In SQL Servver Data Tools,, on the Calculations tab off the cube desiigner for Adve
enture Workss
Cube.cube e, create a new
w drillthrough action
a named Internet Sale es Details Drillthrough Actiion.

• Specifyy Internet Sale


es in the Meassure group m
members list.

• Specifyy the following


g dimensions and
a return colu
umns.

Dimen
nsion Returrn Columns

Custo
omer Engl ish Country R
Region Name
e and Full Nam
me

Orderr Date Simp


ple Date

Produ
uct Engl ish Product N
Name

• Specifyy the caption Drillthrough


D to
t order detaiils…

• Verify that the completed


d action resem
mbles the follow
wing image, a nd then deplo
oy the solution
n,
entering the user name ADVENTUREW
A WORKS\Stude ent and the paassword Pa$$w
w0rd if promp pted.
MCT USE ONLY. STUDENT USE PROHIBITED
9-26 Customizing Cube Functionaliity

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.

• In Excel, use the


t PivotTable
e to view Saless Amount – In
nternet Sales w with Order Da
ate.Calendar D
Date
on columns and
a Product Category
C on ro
ows, as shown in the following image.

• In the PivotTa mount for Bikess in 2003 (cell D4 in the imag


able, right-click the sales am ge above), poiint to
Additional Actions,
A and cllick Drillthrou
ugh to order ddetails….The o order details fo
or bikes in 200
03
should be dissplayed in a neew worksheet asa shown in thhe following immage.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 9-27

• 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.

The main tasks for this exercise are as follows:

1. Define a Sales Summary pe


erspective.
2. Browse the cu
ube using the Sales Summarry perspective..

Task 1: Define a Sales Summary


S pe
erspective
• In SQL Serverr Data Tools, on the Perspecctives tab of th
he cube desig ner for Adven
nture Works
Cube.cube, create
c a new perspective
p nammed Sales Sum mmary.
• Include only
o the follow
wing cube obje
ects in the persspective.

Cube Ob
bject Object Type

Sales Am
mount – Interrnet Sales Measure in tthe Internet S
Sales Measure
eGroup

Custom
mer CubeDimen sion

• The completed perspecctive should re


esemble the fo
ollowing imagee.
MCT USE ONLY. STUDENT USE PROHIBITED
10778A: Implementing Data Models and Reports with Microsoft® SQL Server® 2012 9-29

Task 2: Browse the cube using the Sales Summary perspective


• Deploy the solution, entering the user name ADVENTUREWORKS\Student and the password
Pa$$w0rd if prompted.

• 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

Exercise 3: Implementing a Translation


Scenario
The company employs a number of senior sales managers whose first language is French. These users
would like to be able to view cube data and metadata in French.

In this exercise you will add the final enhancement to the revenue information cube by specifying
translations for the French speakers in your company.

The main tasks for this exercise are as follows:

1. Specify translations for the Time Dimension metadata.

2. Specify translations for the Adventure Works cube metadata.

3. Browse the cube using the new translations.

Task 1: Specify translations for the Time Dimension metadata


• Using the dimension designer for the Date dimension, create a French (France) translation.

• 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

• Verify that the Translatio ons tab for the


e Date dimenssion resembless the following
g image, and then
save all filess in the solutio
on.

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

• Verify that the Translations tab for the Adventure


A Wo
orks Cube cub
be resembles tthe following
image, and th hen save all file
es in the solutiion.

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.

Results: After thiss exercise, you have specified


d translations ffor the time dimension metadata and for the
Advventure Works cube metadatta, and browse ed the cube ussing the new translations.
MCT USE ONLY. STUDENT USE PROHIBITED
100778A: Implementingg Data Models and RReports with Microsooft® SQL Server® 20012 9-33

Modu
ule Reviiew and
d Takeaw
ways

Review
R Quesstions
1.. How are KP
PIs useful to th
he business?

2.. What value


e do Actions ad
dd to the busin
ness?

3.. What objeccts can be disp


played or hidde
en in a perspeective?
MCT USE ONLY. STUDENT USE PROHIBITED

You might also like