dbTalk Databases Forums  

Comparing sales figures

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Comparing sales figures in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
angie via SQLMonster.com
 
Posts: n/a

Default Comparing sales figures - 05-17-2005 , 12:28 AM






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

Reply With Quote
  #2  
Old   
Wayne Snyder
 
Posts: n/a

Default Re: Comparing sales figures - 05-18-2005 , 04:46 AM






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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.