0% found this document useful (0 votes)
86 views20 pages

Tutoriel 4 - Multidimensional Modeling-Install SSAS - Deploy Cube and Generate PowerBI Report

This document provides instructions for installing and configuring SQL Server Analysis Services in multidimensional mode. It describes installing Analysis Services, configuring tools like Visual Studio, defining a data source and data source view from sample data, and deploying an initial Analysis Services project and cube.

Uploaded by

Lahmar Akram
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)
86 views20 pages

Tutoriel 4 - Multidimensional Modeling-Install SSAS - Deploy Cube and Generate PowerBI Report

This document provides instructions for installing and configuring SQL Server Analysis Services in multidimensional mode. It describes installing Analysis Services, configuring tools like Visual Studio, defining a data source and data source view from sample data, and deploying an initial Analysis Services project and cube.

Uploaded by

Lahmar Akram
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/ 20

Multidimensional Modeling

(Adventure Works Tutorial)

Prerequisite: 1. Install SQL Server


Analysis Services
This step is required if you did not already add to your SQL Server
Installation the Analysis Services feature

SQL Server Analysis Services is installed by using the SQL Server Installation Wizard.

SQL Server Analysis Services is multi-instance, which means that you can install more
than one copy on a single computer, or run new and old versions side-by-side. Any
instance you install runs in one of three modes, as determined during setup:
Multidimensional and Data Mining, Tabular, or SharePoint. If you want to use
multiple modes, you'll need a separate instance for each one.

After you install the server in a particular mode, you can use it host solutions that
conform to that mode. For example, a tabular mode server is required if you want
tabular model data access over the network.

Install using the wizard

The following shows which pages in the SQL Server Installation wizard are used to
install Analysis Services.

1. Select Analysis Services from the Feature Tree in Setup.


2. On the Analysis Services Configuration page, select a mode : Choose the
Multidimensional and Data Mining Mode.

Tabular mode uses the VertiPaq in-memory analytics engine (VertiPaq), which is the
default storage for tabular models. After you deploy tabular models to the server,
you can selectively configure tabular solutions to use DirectQuery disk storage as an
alternative to memory-bound storage.

Multidimensional and Data Mining mode use MOLAP as the default storage for
models deployed to Analysis Services. After deploying to the server, you can
configure a solution to use ROLAP if you want to run queries directly against the
relational database rather than storing query data in an Analysis Services
multidimensional database.

Memory management and IO settings can be adjusted to get better performance


when using non-default storage modes. See Server properties in Analysis Services for
more information.

Prerequisite: 2. Get tools and designers


(Analysis services projects extension)
SQL Server Setup no longer installs the model designers or management tools used
for solution design or server administration. In this release, tools have a separate
installation, which you can get from the following links:

 Download Visual Studio 2019


 Download Analysis Services projects extension

You'll need both Visual Studio and SSMS to create, deploy, and work with Analysis
Services instances and databases. Tools can be installed anywhere, but be sure to
configure ports on the server before attempting a connection. See Configure the
Windows Firewall to Allow Analysis Services Access for details.

Install SSDT with Visual Studio 2019

If Visual Studio 2019 is already installed, you can edit the list of workloads to include
SSDT. If you don’t have Visual Studio 2019 installed, then you can download and
install Visual Studio 2019 Community.

To modify the installed Visual Studio workloads to include SSDT, use the Visual
Studio Installer.

1. Launch the Visual Studio Installer. In the Windows Start menu, you can search
for "installer".

2. In the installer, select for the edition of Visual Studio that you want to add SSDT
to, and then choose Modify.
3. Select SQL Server Data Tools under Data storage and processing in the list
of workloads.
For Analysis Services, Integration Services, or Reporting Services projects, you can
install the appropriate extensions from within Visual Studio
with Extensions > Manage Extensions or from the Marketplace.

 Analysis Services
 Integration Services
 Reporting Services
Now we are ready for the multidimensional modeling

STEP 1: Defining a Data Source View within an Analysis Services Project

Creating an Analysis Services Project


In this task, you create the SQL Server Analysis Services Tutorial project, based on an
SQL Server Analysis Services multidimensional model template.

In the following task, you use SQL Server Data Tools to create a new SQL Server
Analysis Services project named Analysis Services Tutorial, based on the SQL Server
Analysis Services Project template. A project is a collection of related objects. Projects
exist within a solution, which includes one or more projects. For more information,
see Create an Analysis Services Project (SSDT).

To create a new Analysis Services project

1. Open SQL Server Data Tools. (Visual Studio 2019)


2. Create a new Analysis Services Multidimensional project. Choose the Analysis
Services Multidimensional and Data Mining Project template.

Notice the default project name, location, and the default solution name are
generated in the bottom of the dialog box. By default, a new directory is
created for the solution.

3. Choose a project Name, which also changes the Solution name box, and then
click OK.

You have successfully created the Analysis Services Tutorial project, based on
the Analysis Services Multidimensional and Data Mining Project template, within
a new solution that is also named Analysis Services Tutorial.

Defining a Data Source


In this task, you specify the AdventureWorksDW database as the data source for
the SQL Server Analysis Services dimensions and cubes that you define in subsequent
lessons.

After you create an SQL Server Analysis Services project, you generally start working
with the project by defining one or more data sources that the project will use. When
you define a data source, you are defining the connection string information that will
be used to connect to the data source. For more information, see Create a Data
Source (SSAS Multidimensional).

In the following task, you define the AdventureWorksDW2019 sample database as


the data source for your project. While this database is located on your local
computer for the purposes of this tutorial, source databases are frequently hosted on
one or more remote computers.

To define a new data source

1. In Solution Explorer (on the right of the Microsoft Visual Studio window), right-
click Data Sources, and then click New Data Source.

2. On the Welcome to the Data Source Wizard page of the Data Source
Wizard, click Next to open the Select how to define the connection page.
3. On the Select how to define the connection page, you can define a data
source based on a new connection, based on an existing connection, or based
on a previously defined data source object. In this tutorial, you define a data
source based on a new connection. Verify that Create a data source based on
an existing or new connection is selected, and then click New.
4. In the Connection Manager dialog box, you define connection properties for
the data source. In the Provider list box, verify that Native OLE DB\SQL Server
Native Client 11.0 is selected.

5. In the Server name text box, type your own server name.

To connect to the specific computer instead of the local computer, type the
computer name or IP address.

6. Verify that Use Windows Authentication is selected. In the Select or enter a


database name list, select AdventureWorksDW2019.

7. Click Test Connection to test the connection to the database.


8. Click OK, and then click Next.
9. On the Impersonation Information page of the wizard, you define the security
credentials for SQL Server Analysis Services to use to connect to the data
source. Impersonation affects the Windows account used to connect to the
data source when Windows Authentication is selected. SQL Server Analysis
Services does not support impersonation for processing OLAP objects.
Select Use the service account, and then click Next.

10. On the Completing the Wizard page, accept the default name, Adventure
Works DW 2019, and then click Finish to create the new data source.

Defining a Data Source View


In this task, you define a single unified view of the metadata from selected tables in
the AdventureWorksDW database.

1. Right click on Data Source Views -> New Data Source View

2. Select the Data Source you already created


3. Add FactInternetSales + Add related tables

4. Remove FactInternetSalesReasons

5. And finally Next and Finnish.


Check in the project properties that the server name is correct: choose the same server
name used to add data source. (Right click on project name and select properties)

Notice: The server name is the Analysis service instance server to which the
project will be deployed. Not in a tabular mode but a multidimensional one!
Deployment step:

First we will try to deploy the solution before creating the cube, in
order to make sure that everything is working.

Right click on project name and select Deploy or click on start to deploy your project

In case deployment ends up with errors:

a. Make sure Browsing server is enabled:

Open SQL Server Configuration Manager=> If you are using Windows 10, here is the
way to open it:
Go to: C:\Windows\SysWOW64 and find SQLServerManager15.msc and double
click

Check if SQL Server Browser is running, if it’s not the case, right click = > properties
=> Service => set Sart mode to manual => Apply and OK
Finally, right click and Start the SQL Server Browser.

b. Make sure your SQL server is running in multidimensional mode (not


tabular mode)

If not, open SQL Server Management Studio -> File -> Connect Object Explorer ->

Choose Server type: Analysis Services


Keep the same server name as Server Engine and choose Windows Authentication ->
Connect

Now you can see in Object Explorer an Analysis Services Server connected.

Now we are ready to Deploy the Cube


1. First, use the wizard to create a New cube (Right click on Cube-> New Cube)

2. Select Use existing tables option and click Next


3. Check Fact Internet Sales to extract measures, and in the next step keep all
measures checked:

4. In the “Select Existing dimensions”, choose all dimensions and uncheck Fact
Internet Sales (It will not be a dimension!)
5. Finnish the cube creation

Important Notice: If you try to deploy in this stage, you will get an error because you
didn’t grant the NT SERVICE\MSOLAP$MSSQLSERVER the right permissions to access
your data. To avoid this error, do the following:

6. In Microsoft SQL Management Studio, you need to :


a. Open up SQL Server Management Studio [login to the database engine]>
Security > Login (Right click) > New Login >add user: make sur you use the correct
login
(For me it is NT SERVICE\MSOLAP$MSSQLSERVER1)

b. Select the database being analyzed in the drop-down list at the bottom >
c. User Mapping [click on the database in the list] >
In the window database role membership click on db_datareader [this grants access
to read the data]

Now we are ready to deploy the cube: In visual studio, right click on solution name and choose
deploy or use directly START.
STEP 2: First use of Cube

Double click on the cube in the solution explorer and choose the Brower mode

You can drop measures and dimensions in the center of the screen to visualize some
elements of the cube. Remember to “Click to execute the query”.

In our case, we will try to create a multidimensional table for the sales amount
depending on 2 dimensions: Dim Product and Dim Sales Territory.

You just need to drag and drop the needed dimensions.


And here is the final table:

We would like to indicate more than keys in the multidimensional table. We would
like to analyze the sales amount by Sales Territory Region and English Subcategory
Product Name.

Try to complete the next steps based on this video


(https://youtu.be/PHckRz8vpuM?t=294)

Step 3: Explore Cube in PowerBi

1. Now, try to import your cube to PowerBi Desktop: Get Data-> SQL Server
Analysis Services Database
2. Put the correct name of your server

3. Choose to load: Sales Amount, English Product Subcategory Name and Sales
Territory Region
4. Now, finish by creating an histogram of sales amount by Sales Territory
Region and Product Subcategory Name. Then filter the sales <500 000

You might also like