dbTalk Databases Forums  

MDX lag function question

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


Discuss MDX lag function question in the microsoft.public.sqlserver.olap forum.



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

Default MDX lag function question - 11-02-2004 , 12:10 PM






I have a dimension called "Date" with three different levels - Year, Month,
and Day. I also have a single measure called "Cost".

I'd like to create a Named Set which JUST shows the Day from seven days ago.
Not every single day the past seven days, only the day from seven days ago.

I've tried the following to no avail: [Date].[Day].Lag(7), [Measures].[Cost]

Much thanks in advance!



Reply With Quote
  #2  
Old   
Charlie
 
Posts: n/a

Default Re: MDX lag function question - 11-03-2004 , 08:17 AM






Lag() should work.
What happens when you use it?



"Jesse O" <jesperzz (AT) hotmail (DOT) com> wrote

Quote:
I have a dimension called "Date" with three different levels - Year, Month,
and Day. I also have a single measure called "Cost".

I'd like to create a Named Set which JUST shows the Day from seven days
ago. Not every single day the past seven days, only the day from seven
days ago.

I've tried the following to no avail: [Date].[Day].Lag(7),
[Measures].[Cost]

Much thanks in advance!





Reply With Quote
  #3  
Old   
Mark A Morris
 
Posts: n/a

Default Re: MDX lag function question - 11-03-2004 , 05:05 PM



Try
Iif(IsLeaf([Date].CurrentMember),[Date].CurrentMember.Lag(7))

"Charlie" wrote:

Quote:
Lag() should work.
What happens when you use it?



"Jesse O" <jesperzz (AT) hotmail (DOT) com> wrote in message
news:ek35BdQwEHA.3668 (AT) tk2msftngp13 (DOT) phx.gbl...
I have a dimension called "Date" with three different levels - Year, Month,
and Day. I also have a single measure called "Cost".

I'd like to create a Named Set which JUST shows the Day from seven days
ago. Not every single day the past seven days, only the day from seven
days ago.

I've tried the following to no avail: [Date].[Day].Lag(7),
[Measures].[Cost]

Much thanks in advance!






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.