Sie sind auf Seite 1von 16

CPSC 304: Tutorial #10

An Introduction to SQL Server Analysis Services and


Data Warehousing

Due Date: Tuesday, November 27, 2018 at 12:00 Noon

To be released: Tuesday, November 20 @ 12:00

Updated: Mon., Nov. 19: to provide only one file for download on Piazza that works for both the lab
environment and your PC/laptop environment.

Submission Instructions

The tutorials must be done in a group of two (not three). Each partner must enroll themselves in
the group. For enrolling, follow these steps:

1. Log in to the course on Canvas.

2. Click on People → Groups (at the top) → Groups (again). Do not click on Everyone.
Now, look for an available Group. The group name for this tutorial starts with
Group_T10_1 where “T10” is the tutorial number and the “_1” indicates the group number
that you’ll be using. You will probably have to scroll down through many pages of project
groups before finding the tutorial groups. (Sorry, this is a bug or a very poor design feature
in Canvas. Technical support is aware of the complaints.) You should type in
“Group_T10_” (without the quotes) in the search box to try for a “faster” search for a spare
group, but even that will take up to a minute for your first such search. Both members of
the group have to join the same group number. You can pick any available group that has
0 members. By chance, it’s possible that someone else joined the same group number at
the same time that you did. If you notice a partner name that’s different than your own
partner, you should leave that group and pick another group instead. Starting with Tutorial
5, if you do not join a proper Group, you will lose 0.5 marks out of 2.

3. Be sure that your name, student number, undergrad CS userid, and group number are on
the PDF file (or .txt file) that you are submitting. Also, make sure your partner’s name,
student number, and CS userid are there. If you fail to put this information on your
submission, you will lose 0.5 marks out of 2.0.

4. To submit your work, click on the Assignments tab on the LHS, and submit your file(s) in
the correct tutorial group number. One submission per group is required. If your tutorial
section has an odd number of students, and your TA lets you work alone, then you still
have to create a group (even though you’re the only one in the group). If you don’t create
a group, then we will have problems marking it on Canvas.

CPSC 304 SQL Server Data Warehousing Tutorial     1 
Only one partner should submit the assignment. Verify with your partner that the submission
has actually taken place, and that it’s on time. (We think Canvas lets you see your partner’s
submission.)

Late submission policy: 25% penalty per day late (i.e., 0.5 points subtracted per day late, based
2.0 total points), or 5% per hour (0.1 points subtracted per hour), whichever is in your favor. We
will only accept submissions for up to two days late; otherwise, it’s a real hassle to coordinate
marking.

Introductory Comments

 This is a hands-on exercise involving Microsoft’s SQL Server Analysis Services (data
warehouse software); so, like the past few weeks, this week’s “tutorial” is more like a lab.

Whose Hardware and Software? The first part of these instructions is the same as that for
Tutorial 9; however, data warehousing requires the installation of additional products. Because of
this, some of you may wish to stick with the lab software.

The back-end RDBMS (SQL Server 2012) has been installed and configured on a single server in
the Department of Computer Science. The front-end IDE for this tutorial is SQL Server
Management Studio (SSMS). It has been installed on all the PCs in the undergraduate PC labs—
including rooms ICCS 008, 014, 015, X050, X250, and X350. You can use your own equipment,
or you can use our lab for this tutorial; the latter is recommended if you experience problems with
your mix of hardware and software. You can use any lab room, provided there is no class
scheduled in the lab at that time—and yes, the labs are open after hours. The lab schedule is found
at:

https://www.cs.ubc.ca/students/undergrad/services/lab-availability

Running it from a Laptop or from Home? If you wish to work from home or from your laptop
and still be able to access our back-end SQL Server (hosted by the department), then you’ll need
to install a free copy of each of the following. You’ll need about 3 GB of disk space. The
installation time might be 40-60 minutes with an SSD disk, and longer with an HDD (platter) drive.
Here are the three products you’ll need on your machine:

1) Microsoft SQL Server Management Studio (currently SSMS version 17.9; but, if you have
a different version 17, or a version from 2016 or 2014, that should be fine; the lab has
version 17.8.1). You can get the current version by following this link:

https://msdn.microsoft.com/en-us/library/mt238290.aspx

CPSC 304 SQL Server Data Warehousing Tutorial     2 
2) Microsoft Visual Studio (currently version 2017, but if you already have an earlier version,
say 2012 or later, that should be fine; the lab has version 2012). Visual Studio has the
components needed to access the data warehouse. You didn’t need this for the previous
tutorial which just used SQL Server, but our data warehouse tutorial needs it. The current
version is Community 2017, and you can get it by using Microsoft’s Imagine academic
software licensing agreement (formerly called Dreamspark) which is free for CPSC
students. When installing Visual Studio 2017 Community, don’t select any special
features/packages, etc., just go with the default options. The details for acquiring the
software through Imagine (very easy, basically it just needs your CWL ID) are described
starting on this MyCS web page:

https://my.cs.ubc.ca/docs/free-software-microsoft

3) Microsoft SQL Server Data Tools (currently 2017; the lab has version 2012). You’ll need
it to work with the data cube and the Visual Studio solution file. During the installation,
we’ll only choose to install SQL Server Analysis Services (along with the default SQL
Server option); but, do not choose SQL Server Reporting Services or SQL Server
Integration Services. Here is the download link (all on one line):

https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt

Additionally, if you wish to install a personal copy of SQL Server on your machine (warning:
it will take some time and substantial disk space), you can do so for free by using Microsoft’s
Imagine academic software licensing agreement; but, you are on your own for support. Most
students will probably just use the CPSC Department’s hosted version of SQL Server—and
they’ll use it either in the lab or from their laptop/home PC. Installing the complete SQL Server
on your own machine isn’t needed.

Important Note: If you are using your own laptop and you are on the UBCSecure network, than
you won’t need to use a VPN. However, if you are not on UBCSecure (e.g., you’re off campus),
then you need to launch the Cisco VPN. The Cisco VPN is available for free download from
UBC’s ITServices. The VPN will allow you to access our centralized single-server copy of SQL
Server, which runs on a machine called mayne. For security reasons, mayne only accepts campus
IP addresses (and the VPN will give you an on-campus IP address). DBA activities require higher
privileges than the defaults for most undergraduate software; therefore, our tech staff have
arranged these privileges for you.

By the way, the Department no longer allows undergraduates to run Remote Desktop, which was
required for data warehousing in the past. This is due to licensing (and possibly security) issues.

CPSC 304 SQL Server Data Warehousing Tutorial     3 
Therefore, we recommend that students either do this tutorial in the lab; or install SSMS, Visual
Studio, and Data Tools on their own machine and follow the instructions below.

Screenshots? Some of the deliverables to be handed in for this tutorial can be taken using
Microsoft’s Accessories program called “Snipping Tool”—accessible via the list of programs in
the start menu (lower LHS Windows icon—you can also use the magnifying glass / search function
to find “snipping tool”), or on Windows 7 via All Programs → Accessories → Snipping Tool, or
just use the Print Screen key on your keyboard, etc.) Save your screenshot as a .jpg file that you
can later submit via Canvas or paste into a Word file and/or convert to PDF (before handing in).
Important: Label your screenshots with file names that give the appropriate Deliverable number
(e.g., deliverable_1.jpg). Your TAs will be happier, and you won’t lose marks.

SQL Server Data Warehousing

The main goal of this tutorial is to give you hands-on experience with the basic concepts of data
warehousing (i.e., OLAP and multidimensional analysis) using Microsoft’s SQL Server family of
products. First, you’ll connect to the sample FoodMart 2008 database using Microsoft SQL
Server Management Studio. Then, you’ll import a solutions file into Microsoft SQL Server
Analysis Services (SSAS). This solution file deals with multidimensional objects known as data
cubes that you will manipulate and analyze. Throughout this tutorial, you will work on a set of
questions to hand in.

Step 1: Connect to SQL Server Locally (in the Lab) or Remotely

SQL Server Analysis Services is the data warehouse component for SQL Server. It has strong
security and licensing requirements. But, first, we have to run SSMS.

 [If you are using your own equipment to access the Department of Computer Science’s SQL
Server DBMS remotely, perform this series of steps before moving on. Lab users can bypass
this part.]

o If you haven’t already done so, install the front-end client software on your machine.
(See “Whose Hardware and Software?” above for instructions.)
o If you are not on the UBCSecure network on campus, then start the VPN.
o To launch SSMS: On a Windows machine, right-click on your desktop. Select New
→ Shortcut. In the “location of the item” field, enter the following:

runas /netonly /user:cs-use\username ssms.exe

CPSC 304 SQL Server Data Warehousing Tutorial     4 
… where username is your CS userid. (If you have multiple versions of SSMS
installed, and you find that you’re executing an older version, then you can replace
ssms.exe with the appropriate complete path in double quotes.) Then, click Next,
and you’ll be asked to name your shortcut. Finally, click Finish. (This step only needs
to be done once. Type it exactly as is; be careful with the spaces.)

o When you double-click this new shortcut icon, the program will ask for your password.
Enter it. Then, continue with the instructions in the section “All users, do this part”, a
few lines below this one.

 [Users of lab PCs, do this part.] Sign on to the PC with your normal CS undergrad account
(e.g., a2b3 hereinafter called userid) and password.

o To start Microsoft SQL Server Management Studio 17 on Windows 10, do one of the
the following (the Windows defaults change from time to time):
 Right-click on the Microsoft flag icon in the lower left hand corner of the
screen. Select Search from the list, and type in ssms. That should open up
SQL Server Management Studio.
 Click on the Start/flag icon (lower LHS) → scroll through the list of
applications (you can also use the magnifying glass / search function in the
lower LHS to find it) → Microsoft SQL Server Tools 17 → Microsoft SQL
Server Management Studio 17. (Note: Version 2017 or 2016 of SSMS should
be fine.)

 [All users, do this part.] Sign on to the DBMS using the “Connect to Server” pop-up box:

Server Type: Database Engine


Server Name: mayne.use.cs.ubc.ca,1433\CSUGRADSQL
1433 refers to the standard port number for SQL Server.
CSUGRADSQL is the name of the particular database instance.
Authentication: Windows Authentication

Then, click on Connect.

 [If you’re using your own copy of the back-end DBMS (and not the Department’s database
server on mayne), then follow these steps. Most of you can skip this part.]:
o Download the Foodmart_2008_SQL.zip file found on Piazza. This zip file holds
a backup file containing the database that we will use for our tutorial exercises.

CPSC 304 SQL Server Data Warehousing Tutorial     5 
o Unzip the file. Remember where you saved it.
o Using SQL Server Management Studio’s Object Explorer, restore the database on your
own version of SQL Server. For information about backup files and restores, see the
previous SQL Server tutorial.
o Log in similarly to how you did it for the previous tutorial.

 [If you are using your own equipment to access the Department’s DBMS (on mayne) and to
use the data warehouse remotely, perform this series of steps before moving on. Lab users can
bypass this part.]

o To be able to use the data warehousing feature (besides having the Database Engine
open above): On a Windows machine, right-click on your desktop. Select New →
Shortcut. In the “location” (target) field, enter the following all on one line, and be
careful with the spaces because this string is a path:

C:\Windows\System32\runas.exe /netonly /user:cs‐use\userid


"C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\devenv.exe"

… where userid is your CS userid, and there is a single space after each of:
runas.exe, netonly, userid, Program, Files, Microsoft, and
Visual. (This step only needs to be done once.) Note: If you have an earlier version
of Visual Studio, then use the appropriate path location for its devenv.exe. The path
will probably start with some of the same prefixes (parent folders).

o When you double-click this new shortcut icon (or right-click and open—click Yes if
you’re asked to run it as a utility), the program will ask for your password. This will
associate your userid with your database objects for the data warehouse. Visual Studio
will open.

Step 2: Connect to the FoodMart 2008 Database (Just a review step to make sure things are
working, so far)

 Use SQL Server Management Studio’s Object Explorer to expand Databases → FoodMart
2008. Note that it is a read-only database. Right-click on one of the tables, and then choose
Select Top 1000 Rows to verify that data exists and that you can access the table.
 Note: If you are writing your own SQL statements using the SQL Query feature in SQL Server
Management Studio, and (unlike the previous bullet) if you haven’t already selected a database,

CPSC 304 SQL Server Data Warehousing Tutorial     6 
then you need to qualify the table name fully—or just specify the following statements once
(“go” is often—but not always—optional):
o use “FoodMart 2008”
o go
o followed by your SQL statement (e.g., “select * from employee”)

Step 3: SQL Server’s FoodMart 2008 Data Warehouse Project

 Regardless of whether or not you’re in the lab, download the SQL Server Analysis Services
solutions file called FoodMart_2008_AS.zip from Piazza. This approximately 200 KB zip
file holds a database solutions file (that we have converted to work in both the lab and on your
equipment), and there are other supporting files that we will use to browse data cubes.
o Really old versions of Visual Studio and Data Tools may require the use of an
unconverted file. If this applies to you, then let us know, and we can provide an old,
unconverted file; but, it may just be easiest to use the lab machines.
 Unzip the FoodMart_2008_AS.zip file (e.g., right-click on the file and Extract All… or
open with the 7-zip File Manager), and remember its location. You may wish to use the Z:
drive for the unzipped file.
 Now, we’re ready to start using the data warehouse. Assuming that you already have Visual
Studio open (in the lab, open Microsoft Visual Studio 2012), click on File → Open →
Project/Solution, and then search through your newly unzipped folder(s) to find and open the
solutions file called FoodMart 2008.sln. Alternatively, you can just double-click on the
FoodMart 2008.sln file in your downloaded and unzipped folder (you may have to look in
a subfolder).
o If you get a message asking you if this is a trustworthy source, click OK.
o If you get a message about a one-way upgrade, click OK. You can ignore any warnings
or messages that result, as long as there are no errors.
o If you get an “unsupported” message (in Solution Explorer) when trying to open the
FoodMart 2008.sln file, then right-click on the project within Solution Explorer and
reload it.
 If it is still “unsupported”, then this is a clue that you do not have the (reasonably
current) version of SQL Server Data Tools installed. We experienced this error
ourselves, and the problem went away when we repeated the installation
instructions above.
 Inside Visual Studio, but within the Solution Explorer feature, right-click on FoodMart
2008.ds (within Data Sources—you might have to expand it), and choose View Designer.
o Click Edit…
 You might get a warning message, “The specified provider is not supported.”
 If so, click OK.

CPSC 304 SQL Server Data Warehousing Tutorial     7 
 For Provider (at the top), choose SQL Server Native Client 11.0 via
the arrow and drop-down box, if it’s not already selected.
 For the Server name:
 If you’re in the lab, type (rather than choose from a list):
MAYNE\CSUGRADSQL
 Otherwise, you need to type the longer name:
MAYNE.USE.CS.UBC.CA (Note that there is no CSUGRADSQL instance
here.)
 Use Windows Authentication
 Using the drop-down arrow, select FoodMart 2008 for the database name (it
might take a few seconds to appear). See the image below, with your
appropriate choice of server name described above.
 Test Connection
 “Test connection succeeded.”
 OK
 OK
o OK

CPSC 304 SQL Server Data Warehousing Tutorial     8 
 

 In Solution Explorer, right-click the Properties on the project name (the project name has
exactly this string: “FoodMart 2008” in bold font).
o Within the Build pane, the Deployment Server edition and version should be:
 Developer
 11.0 (if in the lab); 14.0 (if using Visual Studio 2017)
o Within the Deployment pane, change the Target Server to:
 MAYNE\CSUGRADSQL (if you’re in the lab), but
MAYNE.USE.CS.UBC.CA\CSUGRADSQL otherwise
 Be sure to include your CS userid in the Target Database name (i.e., change
FoodMart 2008_cs304 to FoodMart 2008_userid). This will
differentiate your new data cube (database) from that of other students.
 OK
 Within Solution Explorer, right-click on the project name FoodMart 2008, and choose
Deploy.
o If you get a message saying that the FoodMart 2008_userid database already exists,
and asking if you would like to overwrite it and continue, then click Yes.
 After perhaps 20-60 seconds of “Deploying and Processing” (on a slow machine, this can take
several minutes), you should get a “Deployment Completed Successfully” message near the
bottom of the Deployment Progress box (it is a pop-up box in Visual Studio 2017, and you can
close that pop-up box afterwards).
o By the way, Deployment reads the source data and builds a data cube (using many steps
behind the scene that have already been prepared for you), and now you are ready to
browse the cube and make modifications to its view.

Step 4: Browse a Data Cube

 Double-click on the Sales and Employees.cube, located under the Cubes folder within the
FoodMart 2008 object in Solution Explorer. You should see an E-R diagram at this point. In
the resulting Cube Structure pane, click on the Browser tab (it’s on the far right of the Cube
Structure’s toolbar).
 From the Measure Group menu on the left, expand Sales and Employees → Measures → Sales.
Hover your cursor over the Unit Sales measure, and observe what it says; you’ll encounter this
syntax shortly. Drag and drop the Unit Sales measure into the center of the Browser window.
o The total Unit Sales should display (e.g., $776,760). If it doesn’t, you might have to
“Click to execute the query” in the main window—this is a new thing in the Visual
Studio 2017 interface.

CPSC 304 SQL Server Data Warehousing Tutorial     9 
o Although pivot table functionality is no longer provided with newer versions of SQL
Server, we can filter the results to specify only certain days and products. Later, we
will use Excel for our pivot table. (It looks like Microsoft wants to standardize on
Excel for pivoting.)
 In the Dimension column near the top, select Dimension Time.
 In the Hierarchy column, select Day.
 In the Operator column, select Equal.
 In the Filter Expression column, click on the arrow. Expand All, and check off
both Saturday and Sunday.
 OK
 If the previous step did not already update the result on the screen (i.e., to
$223,248), then do the following to execute your query. Depending on the
version of software that you’re using, either click on the link in the main
window (just like before), or click on the red exclamation mark in the toolbar,
or just right-click in the main window and choose Execute Query.
 Additionally, do the same kind of filtering on the Products hierarchy within the
Product dimension to display the Unit Sales (on Saturdays and Sundays) for
just drinks that are pure juice beverages—in particular, all Washington-brand
juices.
 What you’re doing is drilling down to view the (aggregated) unit sales
total for only specific products. Although it’s not obvious from the pane
displayed, you’re actually filtering on a product’s Family, Department,
Category, SubCategory, Brand, and finally the individual Product. This
hierarchy is maintained behind the scenes in the data cube. (These are
all things that you would have had to implement on your own when
building the data cube—and it would be tedious and error-prone.)

CPSC 304 SQL Server Data Warehousing Tutorial     10 
Deliverable 1: Give a good business reason for why a user should be given the flexibility to both
drill down a hierarchy (into the data warehouse/cube), and roll up the hierarchy (i.e., go in the
other direction). Give examples of the kinds of questions that users can answer with such queries.

Deliverable 2: Drill down on the drink products and find Washington Apple Juice.

1) For this product, what is the grand total (one total) of all daily unit sales?
2) (a) Which day has the highest number of sales for that product?
(b) Are the sales evenly distributed? Explain.
3) Why would a business want to track the total number of unit sales on a particular day?
4) Why would a business want to identify any outliers (anomalies)? Provide some examples
of what a manager might do with this information.

Step 5: MDX Queries

So far in CPSC 304 you have studied various query languages including some or all of: SQL
and its DDL, DML, and DCL subsets; relational algebra; (possibly) Datalog; and (possibly)
tuple or domain relational calculus. Now, let us introduce Multidimensional Expressions
(MDX)—a query language for data warehouses created by Microsoft, but it has become well-
accepted and is used by other vendors, too. You might say that SQL is to the SQL Server
relational DBMS, as MDX is to SQL Server’s data warehousing software.

CPSC 304 SQL Server Data Warehousing Tutorial     11 
 Use SQL Server Management Studio (SSMS) to launch an MDX query, as follows. Go to
Object Explorer in the upper LHS and press the Connect button, and then choose Analysis
Services… and connect to:

MAYNE.USE.CS.UBC.CA\CSUGRADSQL or MAYNE\CSUGRADSQL

 Scroll down the list of databases in Object Explorer. Near the bottom, you should
get a new set of SSAS Databases (expand or refresh the list, if necessary).
 Next, right-click on the name of your SSAS database (FoodMart 2008_userid)
→ New Query → MDX.

 MDX queries give us the functionality to query data cubes like we did in the cube browser
earlier. Type in the simple query below (spacing and case normally don’t matter) and press
the !Execute button (or Query → Execute, or right-click → Execute, or F5—we’ve seen
all of these options in the different versions).

SELECT
FROM [Warehouse and Sales]

(By the way, the word Warehouse in Warehouse and Sales does not refer to a
data warehouse.)

 This produces the single number: 626866 which is the total number of items ordered.
(The number of items ordered is the default measure.)
 We can generate more complex query results like those in Step 4, where we drilled
down to view a Product or Product Category’s unit sales.
 Execute the following MDX query (be careful with the braces and square brackets, but
either upper or lower case is fine):
SELECT { Drink, Food, [Non-Consumable] } ON COLUMNS,
{ Measures.[Unit Sales] } ON ROWS
FROM [Warehouse and Sales]

 You will see the results of the query similar to the results below:

CPSC 304 SQL Server Data Warehousing Tutorial     12 
 By the way, you can leave out the square brackets if they enclose a single, non-
hyphenated word. The parentheses are optional in most cases.

Deliverable 3: Explain the relationships between the MDX query results above, and the Data
Cube from Step 4. Hint: Think about drilling down or rolling up (i.e., the level of aggregation).

Deliverable 4: Next, execute the following MDX query:


SELECT { Drink, Food, [Non-Consumable] } ON COLUMNS,
{ Measures.[Unit Sales], Measures.[Store Cost] } ON ROWS
FROM [Warehouse and Sales]

Take a screenshot of your results, but be sure to include the your database name with its userid
(normally found in the upper LHS).

Deliverable 5: Build an equivalent query to Deliverable 4’s MDX query, but this time, do it using
the cube browser described in Step 4. Begin by clearing the canvas/grid (via right-click). Think
about how you would build your query using what you’ve seen so far. After you build your OLAP
query, take a screenshot of your results, to be handed in. (If your version of the data warehousing
software won’t let you process all three of Drink, Food, and Non-Consumable products at the same
time, you’ll need to execute the query in three parts.)

Step 6: Your Own Query

Deliverable 6: Create a unique data warehouse query of your own. Choose either of these
methods: (a) creating and running an MDX query, like for Deliverable 4; or (b) visually in the
cube browser by drilling down or rolling up on some dimension of your choice, like for Deliverable
5. Copy-and-paste your query/results (e.g., via Alt-PrintScreen on a PC), and explain what the
results of your query mean.

CPSC 304 SQL Server Data Warehousing Tutorial     13 
Step 7: Export to Excel (Create a Pivot Table)

The following steps assume that you already have an SSMS session running and an SSAS (data
warehouse) session running, as per the previous parts of this tutorial.

 [If you are using a lab machine, follow these steps; otherwise, skip to the next section below.]
 Launch Excel (Microsoft Office 2013 or newer) to create a new spreadsheet (i.e., a blank
workbook). (You may need to search for the product “excel.exe” using the Windows
Search feature in the lower LHS of Windows 10.)
 In the blank spreadsheet, select the Data tab.
 In the Get External Data group, select “From Other Sources”.
o Select “From Analysis Services”.
 Use MAYNE\CSUGRADSQL as the Server name. Windows Authentication is fine.
o Next
o Continue with the section below that’s labelled “All users, continue here”.

 [If you are using your own equipment to access the Department of Computer Science’s SQL
Server DBMS remotely, perform this series of steps before moving on. Lab users can bypass
this step.]
 If you are not on the UBCSecure network on campus, then start the VPN.
 To prepare your connection between Excel and SSAS, do the following: On your own
Windows machine, right-click on your desktop. Select New → Shortcut. In the
“location of the item” field, enter the following, all on one line, and the spaces are just
one single space each:

runas /netonly /user:cs-use\username


“C:\Program Files\Microsoft Office\Office16\EXCEL.EXE”

… where username is your CS userid, and the path length in ordinary double quotation
marks is the location of Excel on your machine (mine was for Excel 2016; it’ll be
roughly the same for your particular version and installation of Excel—for example, it
might be in “C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE”
instead). (This step only needs to be done once. Type it carefully.) Then, click Next,
and you’ll be asked to name your shortcut. Finally, click Finish.
 Double-click this new shortcut icon. You might be asked if you want to run the
program as a utility; if so, specify Yes. Next, the program will ask for your password.
Fill it in. Then, after successfully getting Excel to launch, continue with the following
steps.

CPSC 304 SQL Server Data Warehousing Tutorial     14 
 If Excel didn’t launch, then enter the above runas command in the command
prompt (command line interface), and you’ll be able to see the error message;
it is likely that your path was incorrect.
 Create a new spreadsheet (i.e., a blank workbook).
 In the blank spreadsheet, select the Data tab.
 In the Get External Data group, select “From Other Sources”.
 Select “From Analysis Services”.
 Use MAYNE.USE.CS.UBC.CA\CSUGRADSQL as the Server name. Windows
Authentication is fine. Usually, you don’t have to supply your credentials.
o Next

 [All users, continue here]


 Within database FoodMart 2008_userid, use the cube for Sales and Employees.
o Next
o Finish
 Use the default (Existing worksheet) as the destination for your pivot table.
o OK
 In the RHS list of dimensions and measures, check all the measures from the PivotTable
Fields that you want in your spreadsheet. For example, you might decide to check off Unit
Sales followed by Store Cost.
o Note that these values become columns in the spreadsheet.
 In the RHS list of dimensions and measures, check all the dimensions/hierarchies from the
PivotTable Fields that you want in your spreadsheet. For example, you might decide to
check off both the Products hierarchy in the Product dimension, and the Time hierarchy in
the Time dimension.
o Note that these values become rows in the spreadsheet.
 You can now use Excel in any way that you like (e.g., delete columns, add columns, colour
cells, add them up, create a graph). Begin by expanding some of the + signs in the
spreadsheet (e.g., Drink and calendar categories).
 Save your spreadsheet, using an appropriate name.

Deliverable 7: Capture a screenshot (copy-and-paste via Alt-PrintScreen) of your spreadsheet to


hand in (expand a few cells by clicking on +) to show that you completed this part of the exercise.
In particular, drill down on your choice of beverages and your choice of date/time frame, and show
us the expanded options in your screenshot.

CPSC 304 SQL Server Data Warehousing Tutorial     15 
ANSWER: A sample solution might be as follows (but students: do something different for your
Deliverable 7 screenshot):

This completes the SQL Server and Data Warehouse tutorial.

You may close your applications. You don’t need to save your SQL queries in SSMS.

CPSC 304 SQL Server Data Warehousing Tutorial     16 

Das könnte Ihnen auch gefallen