Create OLAP Project using SSAS

2014-06-08 sql-server

Case Scenario

In the previous articles of this serial, I’ve introduced how to use SQL Server as database for online transaction processing, build ETL packages for data integration and create reports. SSAS is another important feature supporting online analytical processing.

Finally, we are going to build a simple multidimensional database to support OLAP in Excel or other tools.

Create SSAS Project

1) Create SSAS project ‘SSAS-Sample’

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb.png

2) Create data source ‘HiSqlServer-Sample’

Connect to database using SQL Server authentication.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_1.png

Use the credentials of the current user for Analysis Services to connect to the data source

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_2.png

Input the name as ‘HiSqlServer-Sample’ and then save.

3) Create data source view ‘SalesDSV’

Open the ‘New Data Source View’ dialogue and choose the data source we just created.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_3.png

Name Matching: Same name as primary key.

Select Tables: Add all the three tables (Areas, Products, Sales).

Input the name as ‘SalesDSV’ and then save the dialogue.

4)Create Dimension DimArea

Create dimension Areas by using Dimension Wizard.

Select Creation Method: Use an existing table.

Specify Source Information:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_12.png

Select Dimension Attributes:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_13.png

Completing the Wizard:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_14.png

The dimension now looks like the following screenshot:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_15.png

5) Create dimension DimProduct

Use same way to create another dimension Products.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_16.png

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_17.png

Once the dimension is created, create a hierarchy named ‘Product Category’ using attributes Product Name and Color.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_18.png

6) Create a cube SalesCube

Create the cube by using Cube Wizard.

Select Creation Method: Use an existing table.

Select Measure Group Tables:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_19.png

Select Measures:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_20.png

Select Existing Dimensions:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_21.png

Input cube name as ‘SalesCube’ and save the dialogue.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_22.png

7) Deploy the project

Use the deployment function in Visual Studio to deploy the project.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_23.png

Once it is deployed, you can also query the multidimensional database through SSMS.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_24.png

8) Browse the cube

In Visual Studio or SSMS, you can generate all kinds of reports by simply dragging measures and dimension attributes.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_25.png

9) OLAP through Excel

Open Excel and create data source by using ‘From Analysis Services’.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_27.png

Input the credential:

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_28.png

Choose the database and then cube.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_29.png

Save the connection file and finish.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_30.png

Import the data using PivotTable Report.

Windows-Live-Writer/Create-OLAP-Project-using-SSAS_10AE6/image_thumb_31.png

Now, you are able to do the data analysis through Excel very easily.

https://app.kontext.tech/Images/Uploaded%20Files/DataAndBusinessIntelligence/Windows-Live-Writer_Create-OLAP-Project-using-SSAS_10AE6_image_66.png