dbTalk Databases Forums  

MDX on a Period Dimension

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


Discuss MDX on a Period Dimension in the microsoft.public.sqlserver.olap forum.



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

Default MDX on a Period Dimension - 02-18-2004 , 03:59 AM






Hi,

I have a Dimension [PERIODE].[Mois] containing
November 2001
December 2001
January 2002
.....
January 2004

What I want to do is when I select a month, to have the Sum(All the
month of the year before the year of the month I have selected )

For example I select May 2003 , I would like to have the sum from
January to december 2002

I try this

Sum(Filter([Periode].[Mois].Members,
val(Right([PERIODE].CurrentMember.Name, 4))-1
=val(Right(([Periode].[Mois].allMembers).item(0).item(0).Name, 4))-1
AND (Val(Right(left([PERIODE].CurrentMember.Name, 6), 2)) <= 12)

),[Measures].[Un]
)

But It doesn't work

Can someone help me ????

Thanks

Rhanima

Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default RE: MDX on a Period Dimension - 02-18-2004 , 07:01 AM






Try:

(Ancestor([PERIODE].CurrentMember,[Year Level]).lag(1),Measures.[Un])

Replace [Year Level] with the name of the level containing the years in your [Periode] dimension.
Sum is not necessary since the member of the year level returned by this query holds the aggregated value.
HTH,
Brian
www.geocities.com/brianaltmann/olap.html



Reply With Quote
  #3  
Old   
Rhanima
 
Posts: n/a

Default Re: MDX on a Period Dimension - 02-19-2004 , 03:29 AM



Thanks for you answer Brian

But I don't have a year Level in my Periode dimension !
I only have months . So I have to manage with the name (for example
November 2003) with this formula "Right([PERIODE].CurrentMember.Name,
4)" to have the year ...

Do you have an idea ?


"Brian Altmann" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Try:

(Ancestor([PERIODE].CurrentMember,[Year Level]).lag(1),Measures.[Un])

Replace [Year Level] with the name of the level containing the years in your [Periode] dimension.
Sum is not necessary since the member of the year level returned by this query holds the aggregated value.
HTH,
Brian
www.geocities.com/brianaltmann/olap.html

Reply With Quote
  #4  
Old   
Brian Altmann
 
Posts: n/a

Default Re: MDX on a Period Dimension - 02-19-2004 , 06:21 AM



Why can't you add a Year level to your dim
Regards
Brian

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.