Perhaps this will help get you started
MDX Query That Displays Month-to-Month Store Sales Growth
WITH
SET [Months] AS 'EXCEPT( DESCENDANTS([Time].[1997],[Time].
[Month]), {[Time].[1997].[Q1].[1]} )'
MEMBER [Measures].[Growth] AS ' ((Time.CURRENTMEMBER,
[Store Sales]) - (Time.PREVMEMBER,
[Store Sales])) / (Time.PREVMEMBER, [Store Sales])',
FORMAT_STRING = '#.00%'
MEMBER [Measures].[Avg Growth] AS 'Avg( [Months],
[Growth] )', FORMAT_STRING = '#.00%'
SELECT {[Avg Growth]} ON COLUMNS,
ORDER([Product].[Product Category].MEMBERS,
[Avg Growth], BDESC) ON ROWS
FROM Sales
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"angie via SQLMonster.com" <forum (AT) nospam (DOT) SQLMonster.com> wrote
Quote:
Hello
I need to show comparitive sales between any 2 given dates.
How can I do that? At least one date will be given by the user and the
other date needs to be givendate - 30
thank you
--
Message posted via http://www.sqlmonster.com |