dbTalk Databases Forums  

Really simple mdx question

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


Discuss Really simple mdx question in the microsoft.public.sqlserver.olap forum.



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

Default Really simple mdx question - 10-02-2006 , 04:58 PM






I can't believe I'm having trouble with this, but I am.
I need to create a custom member in my time dimension that aways returns the
most recent date in the cube. I thought that something like
'closingperiod(day)' would work, but I get no results. My time dimension has
levels of year, quarter, month, and day.
TIA, Dave

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

Default Re: Really simple mdx question - 10-03-2006 , 08:19 PM






closingperiod is not the right formula.

try something like:

tail(nonempty(time.day.members, measures.[any measure]),1).item(0)

nonempty(time.day.members, measures.[any measure]) return the days with
existing values
Tail return the last X members from a set (the latest in our case)
because this produce a set the .Item(0) is required to get 1 member only

I have not tested this formula (I have no server in front of me)
but there is other formula like this one to do the job.

good luck!


"KitenutDave" <KitenutDave (AT) discussions (DOT) microsoft.com> wrote

Quote:
I can't believe I'm having trouble with this, but I am.
I need to create a custom member in my time dimension that aways returns
the
most recent date in the cube. I thought that something like
'closingperiod(day)' would work, but I get no results. My time dimension
has
levels of year, quarter, month, and day.
TIA, Dave



Reply With Quote
  #3  
Old   
Jesse O.
 
Posts: n/a

Default Re: Really simple mdx question - 11-03-2006 , 05:57 PM



this is what we use

{Tail(Filter([Date].[Date].[Day].Members, Not
IsEmpty(([Date].[Date].CurrentMember))), 1)};



"Jeje" <willgart (AT) hotmail (DOT) com> wrote

Quote:
closingperiod is not the right formula.

try something like:

tail(nonempty(time.day.members, measures.[any measure]),1).item(0)

nonempty(time.day.members, measures.[any measure]) return the days with
existing values
Tail return the last X members from a set (the latest in our case)
because this produce a set the .Item(0) is required to get 1 member only

I have not tested this formula (I have no server in front of me)
but there is other formula like this one to do the job.

good luck!


"KitenutDave" <KitenutDave (AT) discussions (DOT) microsoft.com> wrote in message
news58B9E9C-9136-4D56-B901-BF04099A8EC4 (AT) microsoft (DOT) com...
I can't believe I'm having trouble with this, but I am.
I need to create a custom member in my time dimension that aways returns
the
most recent date in the cube. I thought that something like
'closingperiod(day)' would work, but I get no results. My time dimension
has
levels of year, quarter, month, and day.
TIA, Dave





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.