<?xml version="1.0" encoding="utf-8"?>
<!--
 fmsmall.xml - a report comprised of several MDX queries against FoodMart
 Copyright (c) 2004 Active Interface, Inc. All Rights Reserved
 www.activeinterface.com
-->
<slideset>
	<template>repository/ppt/landscape_blue_c.ppt</template>
	<slide type="coverpage">
		<title>FoodMart 2000 OLAP Queries</title>
		<subtitle>small version</subtitle>
	</slide>
	<slide type="bar" PlotBy="Column">
		<title>Unit Sales by Promotion Media Type</title>
		<notes>Made axis scale thousands and made axis number
		currency. I don't know if these are worth automating.</notes>
		<query type="mdx">
WITH
	MEMBER Measures.[$Unit Sales] 
		AS 'Measures.[Unit Sales]', FORMAT_STRING = '#,#'
SELECT 
	{
	[Measures].[$Unit Sales]
	}
	ON COLUMNS, 
	ORDER(
		EXCEPT(
			[Promotion Media].[Media Type].MEMBERS,
			{[Promotion Media].[Media Type].[No Media]}
		),
		[Measures].[$Unit Sales],
		DESC
	)
	ON ROWS
FROM [Sales]
		</query>
	</slide>
	<slide type="table">
		<title>Sales of a Product Brand</title>
		<subtitle>as a percentage of the sales of that product within its subcategory</subtitle>
		<notes>s15</notes>
		<query type="mdx">
WITH
	MEMBER Measures.[$Unit Sales] 
		AS 'Measures.[Unit Sales]', FORMAT_STRING = '#,#'
	MEMBER MEASURES.[Percentage Sales]
		AS '([Product].CURRENTMEMBER, Measures.[Unit Sales]) / ([Product].CURRENTMEMBER.PARENT, Measures.[Unit Sales])', FORMAT_STRING = '#.00%'
SELECT
	{
		MEASURES.[$Unit Sales],
		MEASURES.[Percentage Sales]
	}
	ON COLUMNS,
	HEAD([Product].[Brand Name].MEMBERS,20)
	ON ROWS
FROM [Sales]
		</query>
	</slide>
	<slide type="textbox">
		<title>Units Shipped and Ordered by Store</title>
		<notes>heading row should be different - bold, orange?</notes>
		<query type="mdx">
SELECT
	{
	[Measures].[Units Shipped],
	[Measures].[Units Ordered]
	}
	ON COLUMNS,
	NON EMPTY
		[Store].[Store Name].MEMBERS
	ON ROWS
FROM [Warehouse]
		</query>
	</slide>
	<slide type="accumcolumn">
		<title>Sales and Accumulated Sales</title>
		<subtitle>by Month (1997)</subtitle>
		<notes>S7</notes>
		<query type="mdx">
WITH 
	MEMBER Measures.[$Store Sales]
		AS 'Measures.[Store Sales]', FORMAT_STRING = '$###,###'
	MEMBER [Measures].[Accumulated Sales]
		AS 'Sum(YTD(),[Measures].[Store Sales]) - [Measures].[Store Sales]', FORMAT_STRING = '$###,###'
SELECT 
	{
		[Measures].[Accumulated Sales],
		[Measures].[$Store Sales]
	}
	ON COLUMNS,
	{
		DESCENDANTS
			(
				[Time].[1997],
				[Time].[Month]
			)
	}
	ON ROWS
FROM Sales
		</query>
	</slide>
	<slide type="packedcolumn">
		<title>Monthly Year-to-Date Sales</title>
		<subtitle>for each product category in 1997</subtitle>
		<notes>s22</notes>
		<query type="mdx">
WITH
	MEMBER Measures.YTDSales
		AS 'SUM(YTD(), Measures.[Store Sales])', FORMAT_STRING = '$#,#.00' 
SELECT
	{
		DESCENDANTS
			(
				[Time].[1997],
				[Month]
			)
	}
	ON COLUMNS,
	{
		HEAD([Product].[Product Category].MEMBERS,10)
	}
	ON ROWS
FROM [Sales]
WHERE
	(
		Measures.YTDSales
	)
		</query>
	</slide>
	<slide type="pie" PlotBy="Column">
		<title>Top Store Costs by City</title>
		<notes>s34 Try as pie</notes>
		<query type="mdx">
WITH
	SET Top5Cities AS
		'TOPCOUNT([Store].[Store City].MEMBERS, 5, [Store Cost])'
	MEMBER Measures.[$Store Cost] 
		AS 'Measures.[Store Cost]', FORMAT_STRING = '$###,###'
	MEMBER [Store].[Other Cities] AS
		'([Store].[All Stores], [Store Cost]) - SUM(Top5Cities, [Store Cost])'
SELECT
	{
		Measures.[$Store Cost]
	}
	ON COLUMNS,
	{
		Top5Cities, [Store].[Other Cities]
	}
	ON ROWS
FROM [Sales] 
		</query>
	</slide>
	<slide type="line" PlotBy="Column">
		<title>Store Sales by Month</title>
		<subtitle>with +/- 3 St.Dev. Control</subtitle>
		<notes>
With [store sales] in the middle, I am getting format="#"
for the first column, because of my logic looking for
"IND" and setting value=0. The quick solution is perhaps
to make the [store sales] first - if this is the column
from which chart is getting its axis format.  I've comfirmed
that putting it first fixed the chart axis - so it looks
like it does indeed come from the first one.
		</notes>
		<query type="mdx">
WITH 
	MEMBER Measures.[$Store Sales]
		AS 'Measures.[Store Sales]', FORMAT_STRING = '$###,###'
	MEMBER [Measures].[Rolling Sales] AS 
		'AVG(LASTPERIODS(3), [Store Sales])'
	MEMBER [Measures].[Deviations] AS 
		'3 * STDDEV(LASTPERIODS(12), [Store Sales])'
	MEMBER [Measures].[Upper Limit] AS 
		'[Rolling Sales] + [Deviations]', FORMAT_STRING = '$###,###'
	MEMBER [Measures].[Lower Limit] AS 
		'[Rolling Sales] - [Deviations]', FORMAT_STRING = '$###,###'
SELECT
	{
		[$Store Sales], [Upper Limit], [Lower Limit]
	}
	ON COLUMNS,
	DESCENDANTS(
		[Time].[1997], [Time].[Month]
	)
	ON ROWS
FROM [Sales]
		</query>
	</slide>
</slideset>

