dbTalk Databases Forums  

Using NON EMPTY in a calculated measure?

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


Discuss Using NON EMPTY in a calculated measure? in the microsoft.public.sqlserver.olap forum.



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

Default Using NON EMPTY in a calculated measure? - 09-18-2003 , 08:06 PM






I have a calculated measure (C) that is the ratio of two sparsely-populated
measures (A and B). For dimension members in which A and B don't exist, I
still get the calculated measure C. This means that a lot of dimension
members show up that have no values for A and B whenever I add measure C to
the pivot table.

How can I suppress C when there are no A and B measures? I tried a NON
EMPTY statement in the calculated measure but can't get the syntax right.

Thanks.

Jon

jpearce (AT) remove_this_dgapartners (DOT) com



Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: Using NON EMPTY in a calculated measure? - 09-19-2003 , 12:20 AM






Notice the calc members have a property "non empty behavoir". For calc C set
this property to A or B.

tom @ the domain below
www.tomchester.net


"Jon Pearce" <jon (AT) remove_this (DOT) pearcefamily.org> wrote

Quote:
I have a calculated measure (C) that is the ratio of two
sparsely-populated
measures (A and B). For dimension members in which A and B don't exist, I
still get the calculated measure C. This means that a lot of dimension
members show up that have no values for A and B whenever I add measure C
to
the pivot table.

How can I suppress C when there are no A and B measures? I tried a NON
EMPTY statement in the calculated measure but can't get the syntax right.

Thanks.

Jon

jpearce (AT) remove_this_dgapartners (DOT) com





Reply With Quote
  #3  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: Using NON EMPTY in a calculated measure? - 09-19-2003 , 09:03 PM



"Tom Chester" <publicNOSPAM (AT) tomchester (DOT) net> wrote

Quote:
Notice the calc members have a property "non empty behavoir". For calc C
set
this property to A or B.
However, remember that "Non Empty Behavior" is just a performance hint. It
cannot overwrite results of the calculation.
Therefore if you want that the result of A/B was NULL when both A and B
NULLs, you need to code it as

iif( IsEmpty(B) AND IsEmpty(A), NULL, A/B )

and then set Non Empty Behavior to A.

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================




Reply With Quote
  #4  
Old   
Jon Pearce
 
Posts: n/a

Default Re: Using NON EMPTY in a calculated measure? - 09-24-2003 , 07:50 AM



Works great - thanks to both of you.

BTW - Fast Track to MDX is great - thanks, Mosha

Jon


"Mosha Pasumansky [MS]" <moshap (AT) microsoft (DOT) com> wrote

Quote:
"Tom Chester" <publicNOSPAM (AT) tomchester (DOT) net> wrote in message
news:1nwab.112$OC.72322 (AT) news (DOT) uswest.net...
Notice the calc members have a property "non empty behavoir". For calc C
set
this property to A or B.

However, remember that "Non Empty Behavior" is just a performance hint. It
cannot overwrite results of the calculation.
Therefore if you want that the result of A/B was NULL when both A and B
NULLs, you need to code it as

iif( IsEmpty(B) AND IsEmpty(A), NULL, A/B )

and then set Non Empty Behavior to A.

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================





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.