dbTalk Databases Forums  

How to identify set (similar as possible)

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


Discuss How to identify set (similar as possible) in the microsoft.public.sqlserver.olap forum.



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

Default How to identify set (similar as possible) - 08-10-2006 , 03:48 PM






Simple question appears when reading BOL

<cut here>
The following example returns TRUE if [Time].[Fiscal].CurrentMember is a
leaf member:

IsLeaf([Time].[Fiscal].CurrentMember)
<cut here>

But if CurrentMember is set, this request will generate an error. Is it
possible to identify such situation before evaluating IsLeaf?

Thank you in advance for help.


Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: How to identify set (similar as possible) - 08-10-2006 , 04:46 PM






CurrentMember can be used against 1 dimension only, not against a set.

use the Extract function to extract 1 dimension only from your set, then use
the currentmember
IsLEaf(Extract(<<my set>>, [Time].[Fiscal]).CurrentMember)


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

Quote:
Simple question appears when reading BOL

cut here
The following example returns TRUE if [Time].[Fiscal].CurrentMember is a
leaf member:

IsLeaf([Time].[Fiscal].CurrentMember)
cut here

But if CurrentMember is set, this request will generate an error. Is it
possible to identify such situation before evaluating IsLeaf?

Thank you in advance for help.




Reply With Quote
  #3  
Old   
igorkov
 
Posts: n/a

Default Re: How to identify set (similar as possible) - 08-11-2006 , 12:25 PM



"Jéjé",

the problem is that you never know either is CurrentMember is a member or
set (lets assume). So i'd like to create a construction something like this

IIF( [Time].[Fiscal].CurrentMember is set, IsLeaf(Extract.....),
IsLeaf([Time].[Fiscal].CurrentMember)

Thank you.

"Jéjé" wrote:

Quote:
CurrentMember can be used against 1 dimension only, not against a set.

use the Extract function to extract 1 dimension only from your set, then use
the currentmember
IsLEaf(Extract(<<my set>>, [Time].[Fiscal]).CurrentMember)




Reply With Quote
  #4  
Old   
Jéjé
 
Posts: n/a

Default Re: How to identify set (similar as possible) - 08-11-2006 , 05:09 PM



currentmember always return a member, not a set.

what you don't know is if the dimension is currently used in a set!
using the extract function on a set when you don't know if the set contain
this dimension or not raise an error when the dimension is not here.
try to use the iserror function or convert the set to string and test the
string himself using string comaprison functions.



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

Quote:
"Jéjé",

the problem is that you never know either is CurrentMember is a member or
set (lets assume). So i'd like to create a construction something like
this

IIF( [Time].[Fiscal].CurrentMember is set, IsLeaf(Extract.....),
IsLeaf([Time].[Fiscal].CurrentMember)

Thank you.

"Jéjé" wrote:

CurrentMember can be used against 1 dimension only, not against a set.

use the Extract function to extract 1 dimension only from your set, then
use
the currentmember
IsLEaf(Extract(<<my set>>, [Time].[Fiscal]).CurrentMember)






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.