dbTalk Databases Forums  

How to accomplish the following in MDX

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


Discuss How to accomplish the following in MDX in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Belinda
 
Posts: n/a

Default How to accomplish the following in MDX - 01-27-2004 , 06:09 AM






I want to accomplish the following in a MDX query:


002.2003 003.2003 YTD FY LYFy
===============================================
SalesActual 12000 10000 45000 60000 80000
SalesBudget 9000 5000 35000 50000 55000
Variance 4000 5000 10000 10000 25000
=================================================

I want to specify period 003.2003 and the system compute the previous
period i.e.,002.2003. Also, I want in YTD to compute the Year to date
i.e 001.2003 to 003.2003, for FY I want to calculate the value for the
full year 2003 period 001 to 012, LYFy I want to calculate based on
the value entered 003.2003 the value for the full year in 2002 (period
001 to 012).

I have cubes called Localsales and with calculated measures
SalesActual, SalesBudget and Variance can you please let me know how I
can accomplish the above in MDX.

Can you please provide the MDX query how I can accomplish this.

Thanks
Belinda

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: How to accomplish the following in MDX - 01-27-2004 , 07:32 PM






Here is a sample MDX query for the Foodmart Warehouse cube.
The month in question is defined in the [QueryMonth] set:

Quote:
With Member [Measures].[UnitVariance] as
'[Measures].[Units Ordered]-[Measures].[Units Shipped]'
Set [QueryMonth] as '{[Time].[1998].[Q2].[4]}'
Member [Time].[YTD] as 'Aggregate(YTD([QueryMonth].Item(0)))'
Member [Time].[FY] as 'Ancestor([QueryMonth].Item(0),[Time].[Year])'
Member [Time].[LYFY] as
'Ancestor([QueryMonth].Item(0),[Time].[Year]).PrevMember'

Select {[QueryMonth].Item(0), [QueryMonth].Item(0).PrevMember,
[Time].[YTD], [Time].[FY], [Time].[LYFY]} on Columns,
{[Measures].[Units Ordered],[Measures].[Units Shipped],
[Measures].[UnitVariance]} on Rows
from Warehouse
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.