dbTalk Databases Forums  

Conditional Named Set

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


Discuss Conditional Named Set in the microsoft.public.sqlserver.olap forum.



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

Default Conditional Named Set - 09-23-2004 , 08:07 AM






How can we make a conditional named set?

I want to make a named set by filtering another named set if it exists. But
below expression does not work:
iif
(
VBA!ISERROR(Count(StrToSet("[NS_Account]"))),
sum(Except(DESCENDANTS([Account].CurrentMember, , LEAVES))),
sum(Except(DESCENDANTS([Account].CurrentMember, , LEAVES),
StrToSet("[NS_Account]")))
)

neither this one:
Except
(
{[Account].Members},
iif(VBA!ISERROR(Count(StrToSet("[NS_Account]"))), {},
StrToSet("[NS_Account]"))
)

Thanks...

Ipek Guven




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

Default Re: Conditional Named Set - 09-23-2004 , 10:33 AM






Iif() returns values, not sets, so second expression won't work. For the
first expression, are you summing the cube default measure (otherwise
the measure should be explicit)?
In any case, you don't need Except for the true condition:

Quote:
iif
(
VBA!ISERROR(Count(StrToSet("[NS_Account]"))),
sum(DESCENDANTS([Account].CurrentMember, , LEAVES),
[Measures].[MyMeasure]),
sum(Except(DESCENDANTS([Account].CurrentMember, , LEAVES),
StrToSet("[NS_Account]")), [Measures].[MyMeasure])
)

Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.