dbTalk Databases Forums  

MDX last 3 months

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


Discuss MDX last 3 months in the microsoft.public.sqlserver.olap forum.



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

Default MDX last 3 months - 11-17-2004 , 04:28 AM






HI people!

My query:

SELECT
{ [MyDimension].[MyMembers]} ON COLUMNS ,
{ [Measures].[MyMembers] } ON ROWS
FROM [MyCube]
WHERE [Time].[2004].[Quarter 4].[November]

I want total between today and today- (today,last year),
last 30 days and
last 7 days.


so I've tried something like this with VBA functions, but no success:

WHERE StrToMember("[Time].["+ CSTR(YEAR(NOW())+"].[Quarter
4].["+CTR(MONTH(NOW))]")>CSTR(YEAR(NOW())-1

Does anybody know how to do that?
Any help would be appreciated. Thanks.

Vlado.




Reply With Quote
  #2  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: MDX last 3 months - 11-18-2004 , 01:15 PM






You need to create calculated member:

WITH MEMBER [Time].Total AS ' Aggregate( {[Time].[2003].[Quarter
4].[November], [Time].[2004].[Quarter 4].[November]} ) '
SELECT
{ [MyDimension].[MyMembers]} ON COLUMNS ,
{ [Measures].[MyMembers] } ON ROWS
FROM [MyCube]
WHERE [Time].Total

--
==================================================
Mosha Pasumansky - http://www.mosha.com/msolap
Analysis Services blog at http://www.sqljunkies.com/WebLog/mosha
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================



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.