dbTalk Databases Forums  

MemberToStr()

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


Discuss MemberToStr() in the microsoft.public.sqlserver.olap forum.



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

Default MemberToStr() - 01-12-2004 , 04:39 PM






I need to create the total sales for the current year and
the last year. Since I have 2 dimensional, [Time] and
[Store], and one measure, [Sales].

It is easy to get the total sales for the current year

select
{[Measures].[Sales]} on column,
{[Year].children} on rows
from Sales

However, how can I create the calculated Members for the
last year. I try to create it as follow:

Member [Measures].[Last Year Sales] AS
'sum( StrToSet(MemberToStr([Year].currentmember) -
1) , [measures].[Sales])'

But it doesn't work

Any one can help me?

Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: MemberToStr() - 01-12-2004 , 06:04 PM






Here you go:

( [Year].CurrentMember, Measures.Sales ) +
( [Year].PrevMember, Measures.Sales )

public @ the domain below
www.tomchester.net

"Tomas Leung" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I need to create the total sales for the current year and
the last year. Since I have 2 dimensional, [Time] and
[Store], and one measure, [Sales].

It is easy to get the total sales for the current year

select
{[Measures].[Sales]} on column,
{[Year].children} on rows
from Sales

However, how can I create the calculated Members for the
last year. I try to create it as follow:

Member [Measures].[Last Year Sales] AS
'sum( StrToSet(MemberToStr([Year].currentmember) -
1) , [measures].[Sales])'

But it doesn't work

Any one can help me?



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.