Top Banner
Lab Assignment 3 Cube Structure:
10

Lab Assignment 3 - Cleveland State University

Dec 03, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lab Assignment 3 - Cleveland State University

Lab Assignment 3 Cube Structure:

Page 2: Lab Assignment 3 - Cleveland State University

Query 1: Show the cities in United States where the total sales amount is more than $2 million for all the product.

SELECT NON EMPTY { [Measures].[Sales Amount] } ON COLUMNS, NON EMPTY { ( order(visualtotals (filter([Dim Geography].[Geography Hierarchy].[City].allmembers, [Measures].[Sales Amount] > 2000000)),[Measures].[Sales Amount] , basc) ) } ON ROWS FROM [Adventure Works DW2017] WHERE ( [Dim Sales Territory].[Sales Hierarchy].[Sales Territory Country].&[United States] )

Page 3: Lab Assignment 3 - Cleveland State University

Query 2: Predict the color of each bike depending on the gender:

Select Non Empty([Dim Customer].[Customer Hierarchy].[Gender].ALLMEMBERS) on columns, [Dim Product].[Product Hierarchy].[Color].ALLMEMBERS on rows from [Adventure Works DW2017] where[Dim Product Category].[English Product Category Name].&[Bikes];

Page 4: Lab Assignment 3 - Cleveland State University

Query 3 Predict which cities we need more bikes supply to in next year. Decide top 5 cities that we need put more bike supply.

SELECT NON EMPTY { [Measures].[Order Quantity] } ON COLUMNS, NON EMPTY { ( TopCount( order([Dim Geography].[Geography Hierarchy].[City].allmembers , [Measures].[Order Quantity], BDESC) ,5) ) } ON ROWS FROM [Adventure Works DW2017] WHERE ( [Dim Product Category].[Product Category Hierarchy].[English Product Category Name].&[Bikes], [Dim Date].[Year].&[2014] )

Page 5: Lab Assignment 3 - Cleveland State University

Query 4 Drill down more in 2008 to see the purchase of bikes in each quarter and each month respectively in different cities then find out any unusual sales trend we should know about to prepare for next year

Each Quarter:

SELECT NON EMPTY { [Order Date].[Quarter].[Quarter].allmembers } ON COLUMNS, NON EMPTY { ( order( [Dim Geography].[Geography Hierarchy].[City].allmembers , [Measures].[Order Quantity] , DESC) ) } ON ROWS FROM [Adventure Works DW2017] WHERE ( [Dim Date].[Year].&[2008] , [Dim Product Category].[English Product Category Name].&[Bikes] )

Page 6: Lab Assignment 3 - Cleveland State University

Each Month:

SELECT NON EMPTY { [Order Date].[Month].[Month].allmembers } ON COLUMNS, NON EMPTY { ( order( [Dim Geography].[Geography Hierarchy].[City].allmembers , [Measures].[Order Quantity] , DESC) ) } ON ROWS FROM [Adventure Works DW2017] WHERE ( [Dim Date].[Year].&[2008] , [Dim Product Category].[English Product Category Name].&[Bikes] )

Page 7: Lab Assignment 3 - Cleveland State University

Order quantity for all kinds of products:

SELECT NON EMPTY { [Measures].[Order Quantity] } ON COLUMNS, NON EMPTY { ( order( [Dim Product].[Color].allmembers , [Measures].[Order Quantity] , DESC) ) } ON ROWS FROM [Adventure Works DW2017] WHERE ( [Dim Date].[Year].&[2008] , [Dim Product Category].[English Product Category Name].&[Bikes] )

Page 8: Lab Assignment 3 - Cleveland State University

Sales For each year

SELECT NON EMPTY { [Order Date].[Year].[Year].allmembers } ON Rows, NON EMPTY { ( [Measures].[Sales Amount] ) } ON Columns FROM [Adventure Works DW2017]

Page 9: Lab Assignment 3 - Cleveland State University

Sales for each Quarter:

SELECT NON EMPTY { [Order Date].[Quarter].[Quarter].allmembers } ON Rows, NON EMPTY { ( [Measures].[Sales Amount] ) } ON Columns FROM [Adventure Works DW2017] WHERE ( [Dim Date].[Year].&[2008])

Page 10: Lab Assignment 3 - Cleveland State University

Summary: With the help of drill down:

• We have seen that Sales decreased from 1st quarter to 3rd quarter and then again picked up in 4th quarter for year 2008.

• We have also seen that Sales amount decreased from 2010 to 2012 and then again picked up in 2013.

• We have seen that black color bikes are the most ordered in 2008.