Lab Assignment 3 - Cleveland State University

10
Lab Assignment 3 Cube Structure:

Transcript of Lab Assignment 3 - Cleveland State University

Lab Assignment 3 Cube Structure:

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] )

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];

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] )

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] )

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] )

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] )

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]

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])

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.