dbTalk Databases Forums  

Dynamic defauly Time member

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


Discuss Dynamic defauly Time member in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
aralew@gmail.com
 
Posts: n/a

Default Dynamic defauly Time member - 01-10-2006 , 01:54 PM






Hi:

I am trying to find the first month in the time dimension where a
particular measure has no value.

E.g. Jan06 is the last month that I have data in the unit, so I want
the time dimension to return me Jan06 as a default member.

I try to use this MDX
head(Filter([Time].[Mo Short Name].Members,NOT
IsEmpty(Time.CurrentMember)),1).Item(0)

But, this will only work when all the measures that associate with it
has no value. I have plan # for the rest of the year.

How do I specifically say that if the [measure].[unit] is empty then
retrun me the head of the set.

Thanks
Arale


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Dynamic defauly Time member - 01-10-2006 , 07:14 PM






How about:

Head(Filter([Time].[Mo Short Name].Members,NOT
IsEmpty([Measures].[unit])),1).Item(0)


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #3  
Old   
aralew@gmail.com
 
Posts: n/a

Default Re: Dynamic defauly Time member - 01-11-2006 , 05:19 PM



Hi Deepak:

Thanks for the reply. I try, but it doesn't work. It gives me the
last child in the time hierarchy. (which has the plan number, but 0
unit)

Thanks


Reply With Quote
  #4  
Old   
Vladimir Chtepa
 
Posts: n/a

Default Re: Dynamic defauly Time member - 01-12-2006 , 05:09 AM



Hi,

Try instead of IsEmpty(Time.CurrentMember)
this IsEmpty(Time.CurrentMember, [measure].[unit])

Using

NonEmptyCrossjoin([Time].[Mo Short Name].Members, {[measure].[unit]}, 1)

instead of

Filter([Time].[Mo Short Name].Members,NOT
IsEmpty(Time.CurrentMember)),1)

would be more quickly.

Thanks,
Vladimir Chtepa


<aralew (AT) gmail (DOT) com> schrieb im Newsbeitrag
news:1136922846.545069.25890 (AT) z14g2000cwz (DOT) googlegroups.com...
Quote:
Hi:

I am trying to find the first month in the time dimension where a
particular measure has no value.

E.g. Jan06 is the last month that I have data in the unit, so I want
the time dimension to return me Jan06 as a default member.

I try to use this MDX
head(Filter([Time].[Mo Short Name].Members,NOT
IsEmpty(Time.CurrentMember)),1).Item(0)

But, this will only work when all the measures that associate with it
has no value. I have plan # for the rest of the year.

How do I specifically say that if the [measure].[unit] is empty then
retrun me the head of the set.

Thanks
Arale




Reply With Quote
  #5  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Dynamic defauly Time member - 01-12-2006 , 11:03 PM



Well, if you really want to exclude 0, that's not necessarily the same
as empty, so maybe try:

Quote:
Head(Filter([Time].[Mo Short Name].Members,
[Measures].[unit] > 0),1).Item(0)

Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.