Professional Documents
Culture Documents
MDX in SQL Server 2008: Szymon Wilk TWO, 2009/10
MDX in SQL Server 2008: Szymon Wilk TWO, 2009/10
MDX in SQL Server 2008: Szymon Wilk TWO, 2009/10
Szymon Wilk
(na podstawie materiaw przygotowanych przez Krzysztofa Dembczyskiego)
TWO, 2009/10
Preparation
1.
2.
3. 4. 5.
Introduce necessary changes to the project configuration Deploy the data cube Connect to the data cube (Analysis Services) Create and execute specific MDX queries
Navigate to the deployed data cube (OLAP Tutorial Analysis Services Tutorial) and open a new query window
Query 1
Show the sales amount in March 2002 and April 2002 (Due Date dimension; rows) grouped by gender (columns)
Query 1 Solution
Query 2
Show the sales amount between February and November 2002 (rows) grouped by gender (columns)
Query 2 Solution
Query 3
Show the sales amount for all months (rows) grouped by gender (columns)
Query 3 Solution
Query 4
Show the sales amount for all 2002 quarters (rows) grouped by gender (columns)
Query 4 Solution
Query 5
Show the sales amount for all years and product lines (rows) grouped by gender (columns)
Query 5 Solution
Query 6
Show the sales amount (total over all years) for these product lines, for which the total sales in 2001 exceeded 600,000$ (rows), grouped by gender (columns)
Query 6 Solution
Query 7
Show the sales amount (total over all years) for all products (Product Name) from the Road product line (rows), grouped by gender (columns). Products should be ordered by the order quantity.
Query 7 Solution
Query 8
Show the sales amount and the order quantity over all products (columns) in 2001 and 2002 (rows). Also calculate in an additional column the average order value (sales amount / order quantity) Calculate in an additional row the difference between 2002 and 2001 for all reported measures/values
Query 8 Solution