dbTalk Databases Forums  

Last Twelve Months Calculated Member

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


Discuss Last Twelve Months Calculated Member in the microsoft.public.sqlserver.olap forum.



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

Default Last Twelve Months Calculated Member - 01-07-2004 , 04:56 PM






Hello There,

I am trying to create a calculated memmber that will
aggregate last twelve monhts of data based on the current
month.
Let's say the current month in time dimension is
2003.OCT, so I would like to desing a calculated member
that will aggregate 2003.OCT + 2003.SEP+...2003.JAN +
2002.NOV + 2002.DEC

I was thinking on the lag function but never used it
before, so i am not sure if that would work.

any help will be highly appreciated thanks!!

martino

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

Default Re: Last Twelve Months Calculated Member - 01-07-2004 , 05:48 PM






Assuming the calculated member is a measure, something like this:

SUM(LastPeriods(12), MyMeasure)

public @ the domain below
www.tomchester.net


"martino rivaplata" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello There,

I am trying to create a calculated memmber that will
aggregate last twelve monhts of data based on the current
month.
Let's say the current month in time dimension is
2003.OCT, so I would like to desing a calculated member
that will aggregate 2003.OCT + 2003.SEP+...2003.JAN +
2002.NOV + 2002.DEC

I was thinking on the lag function but never used it
before, so i am not sure if that would work.

any help will be highly appreciated thanks!!

martino



Reply With Quote
  #3  
Old   
Thierry [MS]
 
Posts: n/a

Default Re: Last Twelve Months Calculated Member - 01-07-2004 , 06:18 PM



You can use the Lag function or also the YTD or ParallelPeriod functions
depending on what you want to do with these 12 months (get data from same
month last year, get the YTD value of these two month, rolling average....)

Thierry
This posting is provided "AS IS" with no warranties, and confers no rights.

"martino rivaplata" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello There,

I am trying to create a calculated memmber that will
aggregate last twelve monhts of data based on the current
month.
Let's say the current month in time dimension is
2003.OCT, so I would like to desing a calculated member
that will aggregate 2003.OCT + 2003.SEP+...2003.JAN +
2002.NOV + 2002.DEC

I was thinking on the lag function but never used it
before, so i am not sure if that would work.

any help will be highly appreciated thanks!!

martino



Reply With Quote
  #4  
Old   
martino rivaplata
 
Posts: n/a

Default Re: Last Twelve Months Calculated Member - 01-07-2004 , 06:20 PM



would not something like this work:?

SUM(LastPeriods(12),[TIME].[2003.OCT]),CATEGORY.ACTUAL)

thanks a lot for your thoughts!

Quote:
-----Original Message-----
Assuming the calculated member is a measure, something
like this:

SUM(LastPeriods(12), MyMeasure)

public @ the domain below
www.tomchester.net


"martino rivaplata"
anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:041401c3d571$8498e820$a501280a (AT) phx (DOT) gbl...
Hello There,

I am trying to create a calculated memmber that will
aggregate last twelve monhts of data based on the
current
month.
Let's say the current month in time dimension is
2003.OCT, so I would like to desing a calculated member
that will aggregate 2003.OCT + 2003.SEP+...2003.JAN +
2002.NOV + 2002.DEC

I was thinking on the lag function but never used it
before, so i am not sure if that would work.

any help will be highly appreciated thanks!!

martino


.


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

Default Re: Last Twelve Months Calculated Member - 01-08-2004 , 12:13 AM



You don't want to hardwire the end date -- by omitting it the current member
is the default.

Also, whatever dim the calc belongs to must be part of the tuple that is the
2nd arg to SUM. If it's a measure you must specify a measure.

public @ the domain below
www.tomchester.net


"martino rivaplata" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
would not something like this work:?

SUM(LastPeriods(12),[TIME].[2003.OCT]),CATEGORY.ACTUAL)

thanks a lot for your thoughts!

-----Original Message-----
Assuming the calculated member is a measure, something
like this:

SUM(LastPeriods(12), MyMeasure)

public @ the domain below
www.tomchester.net


"martino rivaplata"
anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:041401c3d571$8498e820$a501280a (AT) phx (DOT) gbl...
Hello There,

I am trying to create a calculated memmber that will
aggregate last twelve monhts of data based on the
current
month.
Let's say the current month in time dimension is
2003.OCT, so I would like to desing a calculated member
that will aggregate 2003.OCT + 2003.SEP+...2003.JAN +
2002.NOV + 2002.DEC

I was thinking on the lag function but never used it
before, so i am not sure if that would work.

any help will be highly appreciated thanks!!

martino


.




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.