dbTalk Databases Forums  

last year total

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


Discuss last year total in the microsoft.public.sqlserver.olap forum.



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

Default last year total - 10-21-2004 , 03:43 PM






I am using the ParallelPeriod function to get the sales for last year same
period. How can I get the last year total (1/1 to 12/31) no matter where I am
in the time dimension. If I am on 10/21/2004, I'd like to see the total for
the whole year of 2003.

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

Default RE: last year total - 10-21-2004 , 04:35 PM






This Foodmart query might be helpful:

with member measures.[LastYearSales] as '(ancestor(time.currentmember
,[Year]).Prevmember, [unit sales])'
select
{[Measures].[Unit Sales] ,[LastYearSales] } on columns,
descendants( [1998],month,self_and_before) on rows
from Sales

HTH,
Brian
www.geocities.com/brianaltmann/olap.html
"christy" wrote:

Quote:
I am using the ParallelPeriod function to get the sales for last year same
period. How can I get the last year total (1/1 to 12/31) no matter where I am
in the time dimension. If I am on 10/21/2004, I'd like to see the total for
the whole year of 2003.

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.