Demonstrate use of ssas interactive features

Assignment Help PL-SQL Programming
Reference no: EM131458901

Performing OLAP with SSAS and MDX

Objective:

Demonstrate use of SSAS interactive features and MDX queries to perform OLAP operations;

Estimated time to complete: 40 min reading +45-50 min. solve queries

Tasks:

In this assignment we are going to use perform OLAP operations on a cube called DS715 located in a multidimensional database called SSAS_DS715 that has been defined based on the tables in the database given by the description below:

Tb_Supplier(Supp_ID, Name, City, State)
Tb_Consumer(Con_ID, Name, City, State)
Tb_Product(Prod_ID, Name, Product_Category, Product_Line, Product_Packaging)
Tb_Offers(Supp_ID, Prod_ID, Quantity, Price)
Tb_Requests(Con_ID, Prod_ID, Quantity, Price)
Tb_Transactions(Tran_ID, Supp_ID, Con_ID, Prod_ID, Quantity, Price)

The dimensions of the cube are: Tb_Supplier, Tb_Consumer and
Tb_Product.

Measure groups are: Tb_Offers, Tb_Requests and Tb_Transactions.

The following dimension hierarchies have been defined within the dimensions:

Tb_Supplier: State > City > Name Tb_Consumer: State > City > Name Tb_Product: Product_Packaging > Name
Product_Category > Product_Line > Name

Performing OLAP
Can be done in two ways:
- Using the interactive Browse interface to build OLAP queries;
- Using the Multidimensional Expressions (MDX) syntax.

Interactive OLAP

Microsoft SQL Server Analysis Services (SSAS) provides a very intuitive interactive browse feature that is based on the drag-and-drop metaphor.

Basic understanding of cubes with dimensions, measures, and hierarchies is sufficient for creating OLAP queries.

The queries created can also be scripted which means the equivalent MDX query is generated, which can then be visualized, copied and tweaked for further execution. That makes the feature a useful tool to also learn the actual MDX syntax.

After you logged-in into Microsoft SQL Server Analysis Services do the following:

1. Expand the SSAS_DS715 multidimensional database.

2. Expand the Cubes folder.

3. Right-click on the DS715 cube and choose: Browse.

4. Expand the Measures tree and the Tb_Consumer, Tb_Product, Tb_Supplier dimension trees. The result will look like below:

5. Drag and drop measure and dimension attributes on the blank center area to build a query.

Click right on the blank center area and chose"Clear Grid" to abandon and delete the current query and its result.

When finished execute the query by clicking on the "Execute Query" icon; i.e. the third from the right with a red exclamation mark.

Note query result will show automatically as soon as a measure attribute is drag on the surface.

The result may be like:

6. Click on the leftmost top icon, tool tip "Design Mode", to create equivalent MDX code. The code looks like:

7. Carefully study the generated code, remove all optional syntax elements and arrange in easy to read format.

8. Move the code in a new query window and execute.

9. Make changes and create new queries.

10. Repeat the process until you become and MDX expert.

Multidimensional Expressions (MDX)

Multidimensional Expressions (MDX) is a query language specialized for OLAP that is designed to manipulate and retrieve multidimensional data in Microsoft SQL Server Analysis Services (SSAS).

MDX is similar in many ways to SQL, but it allows expressing queries on cube data in terms of dimensions, hierarchies and measures. Those are the higher level abstractions business analysts are comfortable to work with during their OLAP sessions.

However, MDX is not an extension of the SQL language and is different from SQL in many ways. In order to create MDX queries that return and format multidimensional data, we need to understand basic concepts in MDX and dimensional modeling, MDX syntax elements, MDX operators, MDX statements, and MDX functions.

While it not our objective to present here the details of the MDX syntax, we can get a good sense of how MDX works and how to start building our own MDX queries by looking at some representative samples.

For a presentation of MDX check for example the book from APress, Pro SQL Server 2012 BI Solutions, by Randal Root and Caryn Mason (APress, 2012).

Check the MDX solutions to the sample queries from Assignment#4.

Test and run each query below against the DS715 located in the SSAS_DS715 database and compare the results with the sample queries from Assignment#4.

--apex - grand total
SELECT { Measures.[Quantity - Tb Transactions], [Measures].[Tb Transactions Count],
Measures.[Price - Tb Transactions] } ON COLUMNS FROM DS715

--base
SELECT NON EMPTY {
[Measures].[Price - Tb Transactions],
[Measures].[Quantity - Tb Transactions] } ON COLUMNS, NON EMPTY {
([Tb Supplier].[Name].[Name].ALLMEMBERS * [Tb Consumer].[Name].[Name].ALLMEMBERS *
[Tb Product].[Name].[Name].ALLMEMBERS ) } ON ROWS FROM DS715
--aggregates by product SELECT NON EMPTY {
[Measures].[Quantity - Tb Transactions], [Measures].[Tb Transactions Count],
[Measures].[Price - Tb Transactions] } ON COLUMNS, NON EMPTY {
[Tb Product].[Name].[Name].ALLMEMBERS } ON ROWS
FROM DS715
--aggregates by products sold to consumers in Wisconsin? SELECT NON EMPTY {
[Measures].[Quantity - Tb Transactions], [Measures].[Tb Transactions Count],
[Measures].[Price - Tb Transactions] } ON COLUMNS, NON EMPTY {
[Tb Product].[Name].[Name].ALLMEMBERS } ON ROWS FROM [DS715]
WHERE [Tb Consumer].[State].&[Wisconsin]
--Quantity of milk sold by each supplier from Wisconsin? SELECT NON EMPTY {

[Measures].[Quantity - Tb Transactions]} ON COLUMNS, NON EMPTY {
[Tb Supplier].[Name].[Name].ALLMEMBERS } ON ROWS FROM [DS715]
WHERE ([Tb Product].[Name].[Name].&Milk, [Tb Supplier].[State].&[Wisconsin])

--Quantity of milk sold by each supplier from Wisconsin in the state of
--Illinois?

SELECT NON EMPTY {
[Measures].[Quantity - Tb Transactions]} ON COLUMNS, NON EMPTY {
[Tb Supplier].[Name].[Name].ALLMEMBERS } ON ROWS FROM [DS715]
WHERE ([Tb Product].[Name].[Name].&Milk, [Tb Supplier].[State].&[Wisconsin],
[Tb Consumer].[State].&Illinois)

More sample queries:

--aggregates by consumers, nulls included and grand total SELECT {Measures.[Quantity - Tb Transactions],
Measures.[Price - Tb Transactions] } ON COLUMNS, [Tb Consumer].[Name].ALLMEMBERS ON ROWS
FROM DS715

--aggregates by consumers, nulls included, no grand total SELECT {Measures.[Quantity - Tb Transactions] ,
Measures.[Price - Tb Transactions] } ON COLUMNS, [Tb Consumer].[Name].[Name] ON ROWS
FROM DS715

--aggregates by consumers, no nulls, no grand total
SELECT NON EMPTY { Measures.[Quantity - Tb Transactions], Measures.[Price - Tb Transactions] } ON COLUMNS,
NON EMPTY [Tb Consumer].[Name].[Name] ON ROWS FROM DS715

--aggregates for select consumers
SELECT NON EMPTY { Measures.[Quantity - Tb Transactions], Measures.[Price - Tb Transactions] } ON COLUMNS,
NON EMPTY {[Tb Consumer].[Name].[Fisher],
[Tb Consumer].[Name].[Gray], [Tb Consumer].[Name].[Hammer]
} ON ROWS FROM DS715

Given the DS715 cube located in the SSAS_DS715 database solve the following queries (all aggregates will be from the Tb_Transactions measure group):

1) Aggregates by combinations of supplier name and product name?

2) Aggregates by supplier states?

3) Number of transactions between supplier-city-consumer-city pairs?

4) Name of each product sold in Wisconsin and quantity of sales for the product?

5) Quantity of sales aggregated by product and supplier state?

6) Quantity of computer sales aggregated by suppliers in Wisconsin?

7) Quantity of auto sales by each supplier from Wisconsin to consumers in Illinois?

8) Quantity of auto sales by each supplier in Madison to consumers in Illinois?

9) Quantity of each product sold by supplier Bernstein to consumers in Chicago?

10) Quantity of milk sold by supplier Bernstein to consumers in Chicago?

11) For each product list quantity sold by suppliers in Madison to consumers in Chicago versus quantity sold by suppliers in Chicago to consumers in Madison (result columns will be: product name, quantity Madison_Chicago, quantity Chicago_Madison?

Return:
Please post your solutions to the queries above in properly formatted MDX syntax (each clause on its own line and with capitalized keyword and operators) in the D2L dropbox created for this assignment.


Attachment:- Assignment Instructions.rar

Verified Expert

Multidimensional Expressions (MDX) is a query language specialized for OLAP that is designed to manipulate and retrieve multidimensional data in Microsoft SQL Server Analysis Services (SSAS).MDX is similar in many ways to SQL, but it allows expressing queries on cube data in terms of dimensions, hierarchies and measures. Those are the higher level abstractions business analysts are comfortable to work with during their OLAP sessions. The given assignment writes few MDX Queries.

Reference no: EM131458901

Questions Cloud

Describe and analyze your symbolic culture : Do you think that sociologists should try to reform society or only study society objectively? Give reasons why? Describe and analyze your symbolic culture.
How many performance obligations can you identify : ACCT 3401 Fall 2016 Financial Reporting & Analysis Case Assignment. How many performance obligations can you identify in the sales agreement between FEI and BWL
Explain the different types of probability samples : Explain the different types of probability samples. Types of probability samples include simple random samples, stratified samples, and cluster samples.
Identify the types of nonprobability samples : What are the principal methods for collecting primary data? The principal methods for collecting primary data are observation, surveys.
Demonstrate use of ssas interactive features : Demonstrate use of SSAS interactive features and MDX queries to perform OLAP operations - Basic understanding of cubes with dimensions, measures, and hierarchies is sufficient for creating OLAP queries.
Identify the different types of survey methods : Identify the different types of survey methods. Different survey methods may include telephone interviews.
What is the most common method of primary data collection : What is the most common method of primary data collection outside the United States? Face-to-face interviewing remains the most common method for conducting.
Importance of structure in relationship to strategy : Discuss the importance of structure in relationship to strategy. Explain which of these factors should come first, and why.
Explain why some americans have such a low rate of college : The major components of social structure are culture, social class, social status, roles, groups, and social institutions.

Reviews

inf1458901

5/5/2017 4:55:17 AM

Thanks As a part of the assignment, you have just written the queries in MDX which is what assignment wanted. I just wanted to get written the queries. And that all these answers are correct.

inf1458901

5/2/2017 6:35:27 AM

Please post your solutions to the queries above in properly formatted MDX syntax (each clause on its own line and with capitalized keyword. All 3 mistakes as told were typos , i have corrected them and now everything is fine, please let me know if you need any other help in this assignment.

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd