dbTalk Databases Forums  

Default member - TAIL

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


Discuss Default member - TAIL in the microsoft.public.sqlserver.olap forum.



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

Default Default member - TAIL - 02-10-2006 , 06:02 AM






Hi all,

I am currently using the TAIL function as a default member in AS2000.
"Tail([Time].[Date].Members).Item(0)"

Is there a way I can use the same method to say minus 1 day?
i.e. I want to deafault to the last available day minus 1.

Many thanks
Immy
p.s. If anyone can answer my recent post RE: Linked Cubes, that'd be great
too!



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

Default Re: Default member - TAIL - 02-10-2006 , 12:27 PM






Hey there!

By the looks of your MDX it looks like you are returning back only 1
member in your set. This means you have only the last day available to
you. So you need to return back the last 2 days in your dimension.
With this in mind you can just use this MDX to get your last day - 1.

Tail([Time].[Date].Members, 2).Item(1)

The set can be thought of like an array. Since you are using Tail
(instead of Head) your first member is the last date, the second member
would be the second to the last date, etc. Thus, by using the (1)
notation you are grabbing the second member in the set, which if I
understand your question correctly is what you want.

HTH

V


Immy wrote:
Quote:
Hi all,

I am currently using the TAIL function as a default member in AS2000.
"Tail([Time].[Date].Members).Item(0)"

Is there a way I can use the same method to say minus 1 day?
i.e. I want to deafault to the last available day minus 1.

Many thanks
Immy
p.s. If anyone can answer my recent post RE: Linked Cubes, that'd be great
too!


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.