dbTalk Databases Forums  

Want to retrieve total amount in whether slicing by Year, Qtr or M

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


Discuss Want to retrieve total amount in whether slicing by Year, Qtr or M in the microsoft.public.sqlserver.olap forum.



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

Default Want to retrieve total amount in whether slicing by Year, Qtr or M - 11-02-2005 , 02:40 PM






Thank you advance. This group has being a life saver.
I am trying to retrieve total for the whole year , whether I am slicing the
data by Year, Quarter or Month. but the following code does not work. I am
also trying to do the sime for the previous year. So if I get the total for
this year, I want the total for the previous year.


([Measures].[Revenue],ClosingPeriod ( [Time].[Year],
[Time].CurrentMember.Parent))
The problem is that I want to check in the calculated measure, that If I am
at the year level, only to return the current, but if I am at any other level
then use year level.


Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Want to retrieve total amount in whether slicing by Year, Qtr or M - 11-02-2005 , 09:37 PM






This will get the full year amount for the current year:

Quote:
([Measures].[Revenue],Ancestor([Time].CurrentMember, [Time].[Year]))

And this would get the full year amount for the previous year:

Quote:
([Measures].[Revenue],Ancestor([Time].CurrentMember, [Time].
[Year]).Prevmember)
Quote:
--
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbell

In article <3F65693A-7CE8-4173-9334-D50BD31C6A18 (AT) microsoft (DOT) com>,
Tomas (AT) discussions (DOT) microsoft.com says...
Quote:
Thank you advance. This group has being a life saver.
I am trying to retrieve total for the whole year , whether I am slicing the
data by Year, Quarter or Month. but the following code does not work. I am
also trying to do the sime for the previous year. So if I get the total for
this year, I want the total for the previous year.


([Measures].[Revenue],ClosingPeriod ( [Time].[Year],
[Time].CurrentMember.Parent))
The problem is that I want to check in the calculated measure, that If I am
at the year level, only to return the current, but if I am at any other level
then use year level.




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

Default Re: Want to retrieve total amount in whether slicing by Year, Qtr - 11-03-2005 , 10:16 AM



Thank you very very much. That did the trick
tomas


"Darren Gosbell" wrote:

Quote:
This will get the full year amount for the current year:


([Measures].[Revenue],Ancestor([Time].CurrentMember, [Time].[Year]))


And this would get the full year amount for the previous year:


([Measures].[Revenue],Ancestor([Time].CurrentMember, [Time].
[Year]).Prevmember)


--
Regards
Darren Gosbell [MCSD]
dgosbell_at_yahoo_dot_com
Blog: http://www.geekswithblogs.net/darrengosbell

In article <3F65693A-7CE8-4173-9334-D50BD31C6A18 (AT) microsoft (DOT) com>,
Tomas (AT) discussions (DOT) microsoft.com says...
Thank you advance. This group has being a life saver.
I am trying to retrieve total for the whole year , whether I am slicing the
data by Year, Quarter or Month. but the following code does not work. I am
also trying to do the sime for the previous year. So if I get the total for
this year, I want the total for the previous year.


([Measures].[Revenue],ClosingPeriod ( [Time].[Year],
[Time].CurrentMember.Parent))
The problem is that I want to check in the calculated measure, that If I am
at the year level, only to return the current, but if I am at any other level
then use year level.





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.